[cfe-users] My compiler crashes .... but the online godbolt one doesn't ?!

David Blaikie via cfe-users cfe-users at lists.llvm.org
Wed Dec 12 07:55:50 PST 2018


On Wed, Dec 12, 2018 at 1:30 AM Andy Gibbs <andyg1001 at hotmail.co.uk> wrote:

> On 10 December 2018 18:17, David Blaikie wrote:
>
> Possible that the online one isn't built with assertions enabled (you
> could test this with other known crashers to see if they reproduce on
> godbolt with assertion crash dumps or only with raw segfaults)? If that's
> the case,t hen it's possible that the codepath that should assert continues
> on and perhaps either has unexpected or even undefined behavior but not a
> crash.
>
> Yes, it seems this is right.  I have done a number of further tests and it
> seems that the godbolt compilers are built without asserts.
>
> This, however, is a possible problem generally, isn't it?  I build my
> compilers always with release-asserts but I would guess it common that
> compiler builds are simply release builds.  And this means, if there is a
> bug in the compiler, it may generate invalid code with no warning at all
> (my bug report gives an example of this) where in fact, if it were built
> with asserts then the bug would have been made visible (and maybe fixed!).
>
> I know there can always be bugs which still act invisibly, but given that
> clang is good at sticking asserts everywhere in its code :o) isn't it worth
> ensuring asserts are always enabled?  i.e. build 'release-asserts' even
> when asked to do a release build?
>

Assertions are expensive (at one point the LLVM build system had a warning
about builds with assertions enabled, that they may be 10x slower than
without assertions) - so it's not practical for most folks to run with them
enabled for all their builds.

- Dave


>
> Cheers,
> Andy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20181212/23d19afc/attachment.html>


More information about the cfe-users mailing list