aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/Unix/Signals.inc
Commit message (Collapse)AuthorAgeFilesLines
* Update aosp/master LLVM for rebase to r235153Pirama Arumuga Nainar2015-05-181-2/+2
| | | | | Change-Id: I9bf53792f9fc30570e81a8d80d296c681d005ea7 (cherry picked from commit 0c7f116bb6950ef819323d855415b2f2b0aad987)
* Update aosp/master llvm for rebase to r233350Pirama Arumuga Nainar2015-04-091-21/+23
| | | | Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
* Update aosp/master LLVM for rebase to r230699.Stephen Hines2015-03-231-0/+2
| | | | Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
* Update aosp/master LLVM for rebase to r222494.Stephen Hines2014-12-021-57/+209
| | | | Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
* Update LLVM for 3.5 rebase (r209712).Stephen Hines2014-05-291-16/+16
| | | | Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
* Update to LLVM 3.5a.Stephen Hines2014-04-241-1/+1
| | | | Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
* Merge remote-tracking branch 'upstream/release_34' into merge-20140211Stephen Hines2014-02-111-2/+2
|\ | | | | | | | | | | | | | | Conflicts: lib/Linker/LinkModules.cpp lib/Support/Unix/Signals.inc Change-Id: Ia54f291fa5dc828052d2412736e8495c1282aa64
| * [conf] Add config variable to disable crash related overrides.Daniel Dunbar2013-08-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - We do some nasty things w.r.t. installing or overriding signal handlers in order to improve our crash recovery support or interaction with crash reporting software, and those things are not necessarily appropriate when LLVM is being linked into a client application that has its own ideas about how to do things. This gives those clients a way to disable that handling at build time. - Currently, the code this guards is all Apple specific, but other platforms might have the same concerns so I went for a more generic configure name. Someone who is more familiar with library embedding on Windows can handle choosing which of the Windows/Signals.inc behaviors might make sense to go under this flag. - This also fixes the proper autoconf'ing of ENABLE_BACKTRACES. The code expects it to be undefined when disabled, but the autoconf check was just defining it to 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189694 91177308-0d34-0410-b5e6-96231b3b80d8
* | Merge commit '10251753b6897adcd22cc981c0cc42f348c109de' into merge-20130807Stephen Hines2013-08-071-8/+6
|\ \ | |/ | | | | | | | | | | | | Conflicts: lib/Archive/ArchiveReader.cpp lib/Support/Unix/PathV2.inc Change-Id: I29d8c1e321a4a380b6013f00bac6a8e4b593cc4e
| * Revert part of 186302 to fix buildbots.Craig Topper2013-07-151-1/+2
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186303 91177308-0d34-0410-b5e6-96231b3b80d8
| * Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).Craig Topper2013-07-151-6/+3
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186301 91177308-0d34-0410-b5e6-96231b3b80d8
| * Don't use PathV1.h in Signals.h.Rafael Espindola2013-06-131-4/+4
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183947 91177308-0d34-0410-b5e6-96231b3b80d8
* | Merge commit '100fbdd06be7590b23c4707a98cd605bdb519498' into merge_20130612Stephen Hines2013-06-121-0/+9
|\ \ | |/
| * [SystemZ] Support System Z as host architectureUlrich Weigand2013-05-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The llvm::sys::AddSignalHandler function (as well as related routines) in lib/Support/Unix/Signals.inc currently registers a signal handler routine via "sigaction". When this handler is called due to a SIGSEGV, SIGILL or similar signal, it will show a stack backtrace, deactivate the handler, and then simply return to the operating system. The intent is that the OS will now retry execution at the same location as before, which ought to again trigger the same error condition and cause the same signal to be delivered again. Since the hander is now deactivated, the OS will take its default action (usually, terminate the program and possibly create a core dump). However, this method doesn't work reliably on System Z: With certain signals (namely SIGILL, SIGFPE, and SIGTRAP), the program counter stored by the kernel on the signal stack frame (which is the location where execution will resume) is not the instruction that triggered the fault, but then instruction *after it*. When the LLVM signal handler simply returns to the kernel, execution will then resume at *that* address, which will not trigger the problem again, but simply go on and execute potentially unrelated code leading to random errors afterwards. To fix this, the patch simply goes and re-raises the signal in question directly from the handler instead of returning from it. This is done only on System Z and only for those signals that have this particular problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181010 91177308-0d34-0410-b5e6-96231b3b80d8
* | Merge remote-tracking branch 'upstream/master' into merge-20130502Stephen Hines2013-05-021-3/+9
|\ \ | |/ | | | | | | | | | | | | Conflicts: lib/Support/Unix/Signals.inc unittests/Transforms/Utils/Cloning.cpp Change-Id: I027581a4390ec3ce4cd8d33da8b5f4c0c7d372c8
| * Inline variable into the #ifdef block where it's used.Benjamin Kramer2013-04-281-1/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180688 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix typo. Stupid me.Joerg Sonnenberger2013-04-271-1/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180686 91177308-0d34-0410-b5e6-96231b3b80d8
| * Only use cxxabi.h's demangler, if it is actually available.Joerg Sonnenberger2013-04-271-2/+8
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180684 91177308-0d34-0410-b5e6-96231b3b80d8
* | Merge commit 'b3201c5cf1e183d840f7c99ff779d57f1549d8e5' into merge_20130226Stephen Hines2013-03-051-16/+26
|\ \ | |/ | | | | | | | | | | | | Conflicts: include/llvm/Support/ELF.h lib/Support/DeltaAlgorithm.cpp Change-Id: I24a4fbce62eb39d924efee3c687b55e1e17b30cd
| * Rewrite comments.Dan Gohman2013-02-201-3/+5
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175651 91177308-0d34-0410-b5e6-96231b3b80d8
| * SIGQUIT is a "kill" signal, rather than an "int" signal, in this context.Dan Gohman2013-02-201-2/+2
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175648 91177308-0d34-0410-b5e6-96231b3b80d8
| * Fix gcc/printf/ISO C++ warningEdwin Vane2013-01-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the use of the 't' length modifier to avoid a gcc warning. Based on usage, 32 bits of precision is good enough for printing a stack offset for a stack trace. 't' length modifier isn't in C++03 but it *is* in C++11. Added a FIXME to reintroduce once LLVM makes the switch to C++11. Reviewer: gribozavr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173711 91177308-0d34-0410-b5e6-96231b3b80d8
| * Move the internal PrintStackTrace function that is used for ↵Argyrios Kyrtzidis2013-01-091-11/+15
| | | | | | | | | | | | | | | | llvm::sys::PrintStackTraceOnErrorSignal(), into a new function llvm::sys::PrintStackTrace, so that it's available to clients for logging purposes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171989 91177308-0d34-0410-b5e6-96231b3b80d8
* | Merge remote-tracking branch 'upstream/master' into merge-llvmStephen Hines2013-01-211-11/+23
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp lib/MC/MCAssembler.cpp lib/Support/Atomic.cpp lib/Support/Memory.cpp lib/Target/ARM/ARMJITInfo.cpp Change-Id: Ib339baf88df5b04870c8df1bedcfe1f877ccab8d
| * Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
| * Support: Don't remove special files on signals.Daniel Dunbar2012-10-171-9/+21
| | | | | | | | | | | | | | - Similar to Path::eraseFromDisk(), we don't want LLVM to remove things like /dev/null, even if it has the permission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166105 91177308-0d34-0410-b5e6-96231b3b80d8
| * Make backtraces work again with both the configure and cmake build.Benjamin Kramer2012-09-281-1/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164817 91177308-0d34-0410-b5e6-96231b3b80d8
| * Add an --enable-backtraces option to configure to determineEric Christopher2012-09-211-1/+1
| | | | | | | | | | | | | | | | | | whether or not we want to print out backtrace information. Useful for libraries that don't need backtrace information on a crash. rdar://11844710 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164426 91177308-0d34-0410-b5e6-96231b3b80d8
* | Merge branch 'upstream' into merge-2012_09_10Stephen Hines2012-09-101-3/+3
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp lib/Support/DynamicLibrary.cpp lib/Support/LockFileManager.cpp Change-Id: I91e94c3a7a76e19c688307c5a480a640a3bd2b7e
| * Whitespace.NAKAMURA Takumi2012-09-061-2/+2
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163289 91177308-0d34-0410-b5e6-96231b3b80d8
| * Unix/Signals.inc: Fix a typo. Thanks to Dani Berg!NAKAMURA Takumi2012-09-061-1/+1
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163288 91177308-0d34-0410-b5e6-96231b3b80d8
* | Merge with LLVM upstream r160668 (Jul 24th 2012)Shih-wei Liao2012-08-031-9/+41
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: include/llvm/Support/ELF.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/Support/Memory.cpp lib/Transforms/Instrumentation/AddressSanitizer.cpp Change-Id: Iddd658cf2eadc7165b2805b446d31af2c5c9917f
| * Don't call 'FilesToRemove[0]' when the vector is empty, even to computeChandler Carruth2012-06-161-1/+1
| | | | | | | | | | | | | | the address of it. Found by a checking STL implementation used on a dragonegg builder. Sorry about this one. =/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158582 91177308-0d34-0410-b5e6-96231b3b80d8
| * Harden the Unix signals code to be more async signal safe.Chandler Carruth2012-06-161-9/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is likely only the tip of the ice berg, but this particular bug caused any double-free on a glibc system to turn into a deadlock! It is not generally safe to either allocate or release heap memory from within the signal handler. The 'pop_back()' in RemoveFilesToRemove was deleting memory and causing the deadlock. What's worse, eraseFromDisk in PathV1 has lots of allocation and deallocation paths. We even passed 'true' in a place that would have caused the *signal handler* to try to run the 'system' system call and shell out to 'rm -rf'. That was never going to work... This patch switches the file removal to use a vector of strings so that the exact text needed for the 'unlink' system call can be stored there. It switches the loop to be a boring indexed loop, and directly calls unlink without looking at the error. It also works quite hard to ensure that calling 'c_str()' is safe, by ensuring that the non-signal-handling code path that manipulates the vector always leaves it in a state where every element has already had 'c_str()' called at least once. I dunno exactly how overkill this is, but it fixes the deadlock-on-double free issue, and seems likely to prevent any other issues from sneaking up. Sorry for not having a test case, but I *really* don't know how to test signal handling code easily.... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158580 91177308-0d34-0410-b5e6-96231b3b80d8
* | Reconfigure config.h and llvm-config.h.Logan Chien2012-05-091-2/+2
| | | | | | | | | | | | | | The config.h and llvm-config.h was out-of-date, and missing a lot of important #defines. Change-Id: I1394a2de64915efd56686de4bdb7999cc9705660
* | Merge with LLVM upstream r155090.Shih-wei Liao2012-04-241-2/+2
|\ \ | |/ | | | | | | | | | | Conflicts: lib/Support/Unix/PathV2.inc Change-Id: I7b89833849f6cbcfa958a33a971d0f7754c9cb2c
| * Fix null to integer conversion warnings.Jean-Daniel Dupas2012-03-241-2/+2
| | | | | | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153395 91177308-0d34-0410-b5e6-96231b3b80d8
* | Patch apple-related breakage.Stephen Hines2012-03-071-2/+2
|/ | | | Change-Id: I77cc6b6c465dfc803c65144236c09e9592b90c87
* Disable the crash reporter when running lit tests.Argyrios Kyrtzidis2012-01-111-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147965 91177308-0d34-0410-b5e6-96231b3b80d8
* Include <pthread.h> before we use pthread_self/pthread_killDouglas Gregor2011-04-291-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130510 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | | | Luis Felipe Strano Moraes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-291-0/+303
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8