https://bugs.llvm.org/show_bug.cgi?id=41501

            Bug ID: 41501
           Summary: scan-build exits successfully if subordinate command
                    is killed by a signal
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: dcough...@apple.com
          Reporter: nbow...@draconx.ca
                CC: dcough...@apple.com, llvm-bugs@lists.llvm.org

If the build command is killed by a signal, scan-build ignores this fact
and returns everythign is A-OK.  For example, to demonstrate:

  % scan-build /bin/sh -c 'kill -TERM $$; sleep 5; exit 42' ; echo status is $?
  [...]
  scan-build: No bugs found.
  exit status is 0

Or alternately since perl ignores SIGINT during the execution of a system()
function, one can typically just ctrl+c the build and this will kill just
the child process.  Then scan-build will (depending on timing) exit
successfully with a status of 0.

This appears to be because whenever scan-build script calls perl's system
function it calls it like this:

    return (system(@$Args) >> 8);

which is explicitly discarding the status of the child process in cases where
it dies due to a signal...

Since the build has failed due to the compiler being killed, I had expected
scan-build to at least return some indication of this failure...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to