Bug 215609 - clang: crash on amd64 when compiling graphics/osg
Summary: clang: crash on amd64 when compiling graphics/osg
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-27 11:51 UTC by Dmitry Marakasov
Modified: 2016-12-28 18:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Marakasov freebsd_committer freebsd_triage 2016-12-27 11:51:24 UTC
When compiling graphics/osg with GSTREAMER options enabled and TRYBROKEN set (as the option is broken, it cannot find the header), clang dies with:

cd /wrkdirs/usr/ports/graphics/osg/work/.build/src/osgPlugins/gstreamer && /usr/local/libexec/ccache/c++   -Dosgdb_gstreamer_EXPORTS -I/wrkdirs/usr/ports/graphics/osg/work/OpenSceneGraph-3.4.0/include -I/usr/local/include -I/wrkdirs/usr/ports/graphics/osg/work/.build/include -I/usr/local/include/gstreamer-1.0 -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -O2 -pipe -fstack-protector -fno-strict-aliasing -Wall -Wparentheses -Wno-long-long -Wno-import  -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -Wno-overloaded-virtual -Wno-variadic-macros -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -o CMakeFiles/osgdb_gstreamer.dir/ReaderWriterGStreamer.o -c /wrkdirs/usr/ports/graphics/osg/work/OpenSceneGraph-3.4.0/src/osgPlugins/gstreamer/ReaderWriterGStreamer.cpp
In file included from /wrkdirs/usr/ports/graphics/osg/work/OpenSceneGraph-3.4.0/src/osgPlugins/gstreamer/ReaderWriterGStreamer.cpp:14:
In file included from /wrkdirs/usr/ports/graphics/osg/work/OpenSceneGraph-3.4.0/src/osgPlugins/gstreamer/GStreamerImageStream.hpp:4:
In file included from /usr/local/include/gstreamer-1.0/gst/app/gstappsink.h:23:
In file included from /usr/local/include/gstreamer-1.0/gst/gst.h:35:
In file included from /usr/local/include/gstreamer-1.0/gst/gstbin.h:27:
/usr/local/include/gstreamer-1.0/gst/gstelement.h:55:10: fatal error: 'gst/gstconfig.h' file not found
#include <gst/gstconfig.h>
         ^
Assertion failed: (IdealIndex < NumIdealInits && "initializer not found in initializer list"), function DiagnoseBaseOrMemInitializerOrder, file /usr/src/lib/clang/libclangsema/../../../contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp, line 4160.
c++: error: unable to execute command: Abort trap (core dumped)
c++: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on LLVM 3.8.0)
Target: x86_64-unknown-freebsd11.0
Thread model: posix
InstalledDir: /usr/bin
c++: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
c++: error: unable to execute command: Abort trap (core dumped)
c++: note: diagnostic msg: Error generating preprocessed source(s).
*** [src/osgPlugins/gstreamer/CMakeFiles/osgdb_gstreamer.dir/ReaderWriterGStreamer.o] Error code 254

Note c++: note: diagnostic msg: Error generating preprocessed source(s), seems like preprocessor-related issue.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2016-12-27 12:38:35 UTC
Can you please disable ccache and try again?  This might allow to get a preprocessed test case and shell script.
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2016-12-27 18:53:43 UTC
Hm, interesting, I've tried this with clang 3.8.0 and 3.9.1, but without ccache, and in both cases I just get "file not found" and the build quits.
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2016-12-27 19:08:23 UTC
Ah and with cccache it indeed gives an assertion.  This also happens with 3.9.1.
Comment 4 Dmitry Marakasov freebsd_committer freebsd_triage 2016-12-28 18:55:36 UTC
So is ccache the problem?
Comment 5 Dmitry Marakasov freebsd_committer freebsd_triage 2016-12-28 18:56:39 UTC
Though no, it's still assert from llvm.
Comment 6 Dimitry Andric freebsd_committer freebsd_triage 2016-12-28 18:58:47 UTC
It is an assertion somewhere in clang, so it must be something in the arguments that ccache is passing to it.  But I'm unsure now, I can't reproduce it consistently anymore.  Clearing the cache doesn't seem to help, it doesn't crash for me at the moment. :(

I would need the CCACHE_LOGFILE from a 'bad' invocation, to be able to invoke the clang executable with exactly the right arguments.