Bug 225275

Summary: textproc/groonga and www/nginx: clang 6 crashes during build
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: Dimitry Andric <dim>
Status: Closed FIXED    
Severity: Affects Only Me CC: bofh, dim, freebsd-arm, garga, joneum
Priority: --- Keywords: toolchain
Version: Latest   
Hardware: arm   
OS: Any   
Bug Depends on:    
Bug Blocks: 224669    
Description Flags
src/core/ngx_inet.c (compressed, preprocessed)
command line args (for clang 6.0) none

Description Jan Beich freebsd_committer 2018-01-17 18:27:33 UTC
Created attachment 189851 [details]
src/core/ngx_inet.c (compressed, preprocessed)

/usr/bin/cc -c -O2 -pipe  -fno-strict-aliasing -I /usr/local/include -I src/core  -I src/event  -I src/event/modules  -I src/os/unix  -I objs  -o objs/src/core/ngx_inet.o  src/core/ngx_inet.c
Assertion failed: (!NodePtr->isKnownSentinel()), function operator*, file /usr/local/poudriere/jails/head-armv6/usr/src/contrib/llvm/include/llvm/ADT/ilist_iterator.h, line 140.
cc: error: unable to execute command: Abort trap (core dumped)
cc: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0)
Target: armv6-unknown-freebsd12.0-gnueabihf
Thread model: posix
InstalledDir: /nxb-bin/usr/bin

Comment 1 Jan Beich freebsd_committer 2018-01-17 18:29:00 UTC
Created attachment 189852 [details]
command line args (for clang 6.0)
Comment 2 Jan Beich freebsd_committer 2018-01-17 18:30:51 UTC
armv7 and aarch64 are unaffected.
Comment 3 Jochen Neumeister freebsd_committer 2018-01-17 18:32:48 UTC
I have no head-armv6 poudriere jail, but i see, that tcberner today fix this with "+USE_CXXSTD=	gnu++98"
Comment 4 Jan Beich freebsd_committer 2018-01-17 19:09:33 UTC
(In reply to Jochen Neumeister from comment #3)
Did you miss the crash happens on C code, not C++? ;)
Comment 5 Jochen Neumeister freebsd_committer 2018-01-17 19:15:12 UTC
(In reply to Jan Beich from comment #4)
I have not looked at it yet. The problem will be to test it ;)
Comment 6 Dimitry Andric freebsd_committer 2018-01-18 19:10:24 UTC
This seems to have regressed with https://reviews.llvm.org/rL320749, and it still asserts on the latest top-of-trunk as of today.  I will file an upstream PR.
Comment 7 Dimitry Andric freebsd_committer 2018-01-21 16:30:50 UTC
Filed https://bugs.llvm.org/show_bug.cgi?id=36007.
Comment 8 Jochen Neumeister freebsd_committer 2018-04-04 09:31:29 UTC
huh dim, any news here? :)
Comment 9 Dimitry Andric freebsd_committer 2018-04-04 09:56:00 UTC
(In reply to Jochen Neumeister from comment #8)
> huh dim, any news here? :)

No, unfortunately not.  I've bumped the upstream PR again, as I tested with trunk r329000 (as of 2018-04-04), and it still asserted.  I need to figure out who in upstream is knowledgeable enough about the ARM backend to be able to fix this.
Comment 10 Jochen Neumeister freebsd_committer 2018-11-02 16:22:29 UTC
any news about nginx?
Comment 11 Dimitry Andric freebsd_committer 2018-11-02 20:06:31 UTC
(In reply to Jochen Neumeister from comment #10)
> any news about nginx?

Hm, it seems to be fixed in clang 7.0 and also the clang60 port, but I'm unsure of the specific upstream revision that fixed it.  I'll have a look.
Comment 12 Dimitry Andric freebsd_committer 2018-11-02 21:55:14 UTC
(In reply to Dimitry Andric from comment #11)
> (In reply to Jochen Neumeister from comment #10)
> > any news about nginx?
> Hm, it seems to be fixed in clang 7.0 and also the clang60 port, but I'm
> unsure of the specific upstream revision that fixed it.  I'll have a look.

This was fixed by https://reviews.llvm.org/rL330345 ("[if-converter] Handle BBs that terminate in ret during diamond conversion"), which was merged into clang 6.0.1 before it was released.  So this fix is already in head, stable/12 and stable/11.