[PATCH] expose install_fatal_error_handler() through the C API

G M gmisocpp at gmail.com
Wed Oct 16 18:16:28 PDT 2013


Hi Filip

On Thu, Oct 17, 2013 at 12:46 PM, Filip Pizlo <fpizlo at apple.com> wrote:

> Hi!
>
> If LLVM encounters badness it may call report_fatal_error().  The default
> behavior of this function is to call exit(1).  That doesn’t work out so
> great if LLVM is being used as a library in pretty much anything other than
> a command-line tool.  For example, if LLVM is in a daemon or in a UI app,
> calling exit(1) will bypass any stack trace or error reporting that the
> system would normally do for “fatal” conditions.
>

I don't know if this is related or not, but on Windows when applications in
the libcxx test suite abort through the various means, they tend to through
up a dialog about that which totally halts the script that is running and
all of the tests until it gets a confirmation. This isn't always wanted and
doesn't actually often include any useful message. It can be disabled
through the registry but doing that then makes any application that crashes
fail to report errors so doing it that way possibly isn't viable

What is desirable is to be able to have applications that terminate in a
script log the exception to the output file / console window if there is
one and continue and not stop. In other circumstances a message box might
be the right thing ideally if it had the actual message of any problem
where possible. I don't know what applications in a script do on Apple
machines in these circumstances.

The topic seems related so forgive me for mentioning it here if it isn't.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131017/5e73c567/attachment.html>


More information about the llvm-commits mailing list