[llvm-dev] Need help with code generation

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 21 14:32:10 PDT 2016


On Mon, Mar 21, 2016 at 2:27 PM, Mehdi Amini via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

>
> On Mar 21, 2016, at 2:20 PM, James Molloy via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
> Rafael,
>
> How can a high quality product crash by design? I understand the lack of
> structured error handling, and I understand asserting (which in release
> mode would be silent) on internal errors. But on an input? How can an
> application be taken seriously when crashes are design features?
>
> And I certainly didn't see consensus or in fact the suggestion of this in
> the other thread, unless I glazed over an important part.
>
>
> My understanding is that clang and llvm themselves are designed this way
> (crash when the unexpected happens). For example the fact that clang forks
> itself to be able to report diagnostics is a good indication that this is
> assumed, and llvm is full of report_fatal_error() (or worse, assertions
> that can fire on unexpected user input).
>

So far as I know, any place where LLVM asserts on user input is a bug -
maybe not a high priority bug in some cases, maybe a difficult bug in some
cases, but a bug.

report_fatal_error is a bit of a wart, to be sure (but that's more along
the lines of the previous LLD design thread - API level error handling V
exit(1) from deep in the library*)

* I didn't understand the previous LLD therad to include the possibility of
crash/assert by design, but exit(1) by design V return error codes up the
stack - the latter is what I thought that thread was about.


> I complained on the list at some point that "by design" LLVM as a library
> requires you to fork and run in a separate process, but the tradeoff in the
> ease of implementation seems to be the current consensus.
>

The forking in a separate process is, so far as I understand, simply a
necessary defensive measure for certain products - we accept that LLVM has
bugs that may lead it to crash, so we want crash reports when that happens.
The fact that we report the crashes and fix them seems to indicate that
they're not by design. If the fork was simply to swallow (rather than
report) the crashes, then it would seem to indicate crash-by-design, but it
isn't.

- David


>
> --
> Mehdi
>
>
>
>
>
>
> James
> On Mon, 21 Mar 2016 at 21:16, Rui Ueyama <ruiu at google.com> wrote:
>
>> Of course I'm not happy. And I hope that you understood that that is
>> unusual. Having said that, I'd say it's however reasonable.
>>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160321/1ea398eb/attachment-0001.html>


More information about the llvm-dev mailing list