[LLVMbugs] [Bug 18638] New: crash recovery (forking into itself) should be made opt-in, and not be enabled by default

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 27 16:39:21 PST 2014


            Bug ID: 18638
           Summary: crash recovery (forking into itself) should be made
                    opt-in, and not be enabled by default
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yuri at tsoft.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Currently all clang jobs fork themselves to improve crash recovery and
reporting. While this improves the crash reporting, this has several drawbacks:
* it unnecessarily slows down and complicates successful jobs, that are
(obviously) the vast majority of runs
* it makes profiling, debugging, tracing such process more difficult, since it
would normally require setting special option to follow fork childs. This also
the may trigger some other tool issues related to forks. For example, on
FreeBSD gdb doesn't stop in clang, I suspect because of this. If I were to
profile clang, valgrind would probably stumble on fork as well

Currently crash recovery fork is done by default. And option -cc1 opts out from

My suggestion: make crash recovery opt-in, triggered by CFLAGS, for example
CFLAGS=-crash-recovery. The minority of users who experience crashes would be
able to set this option, and obtain the same crash logs.

On the other note, all unix utilities (grep,awk,etc) potentially have the same
issue: they may crash and may potentially benefit from such forking too. But
this isn't what is normally done. Each program should do one and only one core
thing. And such bells-and-whistles could be made available optionally, but
shouldn't be forced on majority of users.

==== sample crash output ===
clang -c -emit-llvm huge.c
clang: error: unable to execute command: Terminated: 15
clang: error: clang frontend command failed due to signal (use -v to see
clang version 3.5 (trunk 200186)
Target: x86_64-unknown-freebsd9.2
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.

clang: note: diagnostic msg: 

Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/huge-dbd4d7.c
clang: note: diagnostic msg: /tmp/huge-dbd4d7.sh
clang: note: diagnostic msg: 


You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140128/761b7a08/attachment.html>

More information about the llvm-bugs mailing list