LLVM backend for 6502
Go to file
Chandler Carruth 0b8b3ba21e Harden the Unix signals code to be more async signal safe.
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
2012-06-16 00:09:41 +00:00
autoconf Remove the PTX back-end and all of its artifacts (triple, etc.) 2012-05-24 21:38:21 +00:00
bindings [python] Add negative MemoryBuffer testcase 2012-03-22 11:23:52 +00:00
cmake cmake: Pass the -m32 flag to modules if LLVM_BUILD_32_BITS is enabled 2012-06-08 09:41:23 +00:00
docs [docs] Make it pretty. 2012-06-15 22:17:44 +00:00
examples Fix typos found by http://github.com/lyda/misspell-check 2012-06-02 10:20:22 +00:00
include Adding acessors to COFFObjectFile so that clients can get at the (non-generic) bits 2012-06-15 01:08:25 +00:00
lib Harden the Unix signals code to be more async signal safe. 2012-06-16 00:09:41 +00:00
projects Remove the PTX back-end and all of its artifacts (triple, etc.) 2012-05-24 21:38:21 +00:00
runtime Free the allocated filename. Found by clang static analyzer. 2012-06-15 09:11:47 +00:00
test Unit test for LSR kind=Special fix: r158536. 2012-06-15 22:46:31 +00:00
tools Remove assignments which aren't used afterwards. 2012-06-15 19:28:20 +00:00
unittests Round 2 of dead private variable removal. 2012-06-06 19:47:08 +00:00
utils Add two newlines in ParseSubtargetFeatures's debug output after the CPU is printed. 2012-06-12 04:21:36 +00:00
.gitignore Add tools/lld to .gitignore. 2012-05-02 21:25:32 +00:00
CMakeLists.txt Remove the PTX back-end and all of its artifacts (triple, etc.) 2012-05-24 21:38:21 +00:00
configure Remove the PTX back-end and all of its artifacts (triple, etc.) 2012-05-24 21:38:21 +00:00
CREDITS.TXT Update the documentation of CellSPU, in case it gets removed in 3.1. 2012-04-29 20:00:55 +00:00
LICENSE.TXT Add YAML parser to Support. 2012-04-03 23:09:22 +00:00
llvm.spec.in Tidy up. s/Low Level Virtual Machine/LLVM/. 2012-01-25 22:00:23 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile Do not install llvm-config-host for cross-builds of clang. rdar://11317847 2012-05-09 00:07:02 +00:00
Makefile.common [docs] Remove unsupported references to ExtraSource variable. 2012-05-15 21:32:27 +00:00
Makefile.config.in - Added ExecutionEngine/MCJIT tests 2012-05-17 21:07:47 +00:00
Makefile.rules llvm-ld does not exist anymore, use llvm-link instead. 2012-05-23 20:34:19 +00:00
README.txt Testing commit access 2012-05-24 14:20:13 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.

If you're writing a package for LLVM, see docs/Packaging.html for our
suggestions.