Commit Graph

23 Commits

Author SHA1 Message Date
Marcos Pividori fe9288a6a0 [sanitizer] Move DescribeSignalOrException to sanitizer_common.
Differential Revision: https://reviews.llvm.org/D29459

llvm-svn: 293956
2017-02-02 23:01:59 +00:00
Kuba Mracek 48090f5b82 [asan] Provide bug descriptions for all reports (not just ErrorGeneric)
Differential Revision: https://reviews.llvm.org/D27012

llvm-svn: 288065
2016-11-28 21:18:15 +00:00
Kuba Mracek 073cea6128 [asan] Add a "dump_registers" flag to print out CPU registers after a SIGSEGV
This patch prints out all CPU registers after a SIGSEGV. These are available in the signal handler context. Only implemented for Darwin. Can be turned off with the dump_registers flag.

Differential Revision: https://reviews.llvm.org/D11365

llvm-svn: 287957
2016-11-26 00:50:08 +00:00
Filipe Cabecinhas a8b5f5e9d1 [asan] Reify ErrorGeneric
Summary:
Finish work on PR30351 (last one, after D24551, D24552, and D24554 land)

Also replace the old ReportData structure/variable with the current_error_ static
member of the ScopedInErrorReport class.

This has the following side-effects:
  - Move ASAN_ON_ERROR(); call to the start of the destructor, instead
    of in StartReporting().
      - We only generate the error structure after the
        ScopedInErrorReport constructor finishes, so we can't call
        ASAN_ON_ERROR() during the constructor. I think this makes more
        sense, since we end up never running two of the ASAN_ON_ERROR()
        callback. This also works the same way as error reporting, since
        we end up having a lock around it. Otherwise we could end up
        with the ASAN_ON_ERROR() call for error 1, then the
        ASAN_ON_ERROR() call for error 2, and then lock the mutex for
        reporting error 1.
  - The __asan_get_report_* functions will be able to, in the future,
    provide information about other errors that aren't a "generic
    error". But we might want to rethink that API, since it's too
    restricted. Ideally we teach lldb about the current_error_ member of
    ScopedInErrorReport.

Reviewers: vitalybuka, kcc, eugenis

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D24555

llvm-svn: 282107
2016-09-21 20:18:18 +00:00
Filipe Cabecinhas 490f96cba6 [asan] Store full AddressDescription objects in ErrorInvalidPointerPair
Reviewers: kcc, vitalybuka, eugenis

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D24777

llvm-svn: 282102
2016-09-21 19:21:01 +00:00
Filipe Cabecinhas 1b3742eb8f [asan] Reify ErrorInvalidPointerPair
Summary: Continue work on PR30351

Reviewers: vitalybuka, kcc, eugenis

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D24554

llvm-svn: 281593
2016-09-15 08:10:56 +00:00
Filipe Cabecinhas 719db0c0c5 [asan] Reify ErrorODRViolation
Summary: Continue work on PR30351

Reviewers: vitalybuka, kcc, eugenis

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D24552

llvm-svn: 281592
2016-09-15 08:10:52 +00:00
Filipe Cabecinhas b50a5b31ce [asan] Reify ErrorBadParamsToAnnotateContiguousContainer
Summary: Continue work on PR30351

Reviewers: vitalybuka, kcc, eugenis

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D24551

llvm-svn: 281591
2016-09-15 08:10:48 +00:00
Filipe Cabecinhas 36229e96bc [asan] Reify ErrorStringFunctionSizeOverflow
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D24394

llvm-svn: 281444
2016-09-14 07:37:20 +00:00
Filipe Cabecinhas 7a196b9913 [asan] Reify ErrorStringFunctionMemoryRangesOverlap
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D24393

llvm-svn: 281443
2016-09-14 07:37:14 +00:00
Filipe Cabecinhas b0de43a673 [asan] Reify ErrorSanitizerGetAllocatedSizeNotOwned
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D24392

llvm-svn: 281392
2016-09-13 20:47:42 +00:00
Filipe Cabecinhas 5f862c20cb [asan] Reify ErrorMallocUsableSizeNotOwned
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D24391

llvm-svn: 281391
2016-09-13 20:47:37 +00:00
Filipe Cabecinhas 92c5b5de5c [asan] Reify ErrorAllocTypeMismatch
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D24390

llvm-svn: 281390
2016-09-13 20:47:33 +00:00
Filipe Cabecinhas 6fb5462c46 [asan] Reify ErrorFreeNotMalloced
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D24389

llvm-svn: 281389
2016-09-13 20:47:29 +00:00
Filipe Cabecinhas 1989be7cf0 [asan] Reify ErrorDeadlySignal
Summary: Keep reifying other errors.

Reviewers: kcc, samsonov

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D23873

llvm-svn: 280930
2016-09-08 12:58:15 +00:00
Filipe Cabecinhas 25ad7b52c3 [asan] Reify ErrorNewDeleteSizeMismatch
Summary: Keep reifying other errors.

Reviewers: kcc, samsonov

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D23874

llvm-svn: 280812
2016-09-07 14:20:54 +00:00
Filipe Cabecinhas 453b55551f Fix buildbot bug: Wasn't printing scariness for DoubleFree
llvm-svn: 280213
2016-08-31 09:39:47 +00:00
Filipe Cabecinhas b16672d91d Reify ErrorDoubleFree
Summary: Keep reifying other errors.

Reviewers: kcc, samsonov

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D23717

llvm-svn: 280201
2016-08-31 07:38:09 +00:00
Filipe Cabecinhas fddfdca030 Start reifying error descriptions (Re-do of D23672 supporting VS2013)
Summary:
@kcc: I know you've accepted the other revision, but since this is a
non-trivial change, I'm updating it to show why D24029 would help.

This commit sets up the infrastructure to use reified error
descriptions, and moves ReportStackOverflow to the new system.

After we convert all the errors, we'll be able to simplify ScopedInErrorReport
and remove the older debugging mechanism which had some errors partly reified
in some way. We'll be able to maintain the external API.

ScopedInErrorReport will be able to track one of the reified errors at a time.
The purpose of this is so we have its destructor actually print the error and
possibly interface with the debugger (will depend on the platform, of course).

Reviewers: kcc, samsonov, timurrrr

Subscribers: kcc, llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D24030

llvm-svn: 280111
2016-08-30 17:08:55 +00:00
Filipe Cabecinhas c0d14ecea3 Revert "Start reifying error descriptions. Second try: Try to appease Visual Studio."
This reverts r279931. Will try it with the same Visual Studio version
before committing again.

llvm-svn: 279932
2016-08-28 10:42:21 +00:00
Filipe Cabecinhas b477ce015d Start reifying error descriptions. Second try: Try to appease Visual Studio.
Summary:
This commit sets up the infrastructure to use reified error
descriptions, and moves ReportStackOverflow to the new system.

After we convert all the errors, we'll be able to simplify ScopedInErrorReport
and remove the older debugging mechanism which had some errors partly reified
in some way. We'll be able to maintain the external API.

ScopedInErrorReport will be able to track one of the reified errors at a time.
The purpose of this is so we have its destructor actually print the error and
possibly interface with the debugger (will depend on the platform, of course).

Reviewers: kcc, samsonov, timurrrr

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D23672

llvm-svn: 279931
2016-08-28 10:32:44 +00:00
Filipe Cabecinhas d2cc637793 Revert "Start reifying error descriptions"
This reverts r279862 to investigate VS failures.

llvm-svn: 279865
2016-08-26 20:59:02 +00:00
Filipe Cabecinhas 403423cb59 Start reifying error descriptions
Summary:
This commit sets up the infrastructure to use reified error
descriptions, and moves ReportStackOverflow to the new system.

After we convert all the errors, we'll be able to simplify ScopedInErrorReport
and remove the older debugging mechanism which had some errors partly reified
in some way. We'll be able to maintain the external API.

ScopedInErrorReport will be able to track one of the reified errors at a time.
The purpose of this is so we have its destructor actually print the error and
possibly interface with the debugger (will depend on the platform, of course).

Reviewers: kcc, samsonov, timurrrr

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D23672

llvm-svn: 279862
2016-08-26 20:49:11 +00:00