Bug 203989 - www/firefox generates clang Assertion and fails to build on head
Summary: www/firefox generates clang Assertion and fails to build on head
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: arm Any
: --- Affects Some People
Assignee: Dimitry Andric
URL:
Keywords:
: 211069 213402 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-10-23 20:53 UTC by Sean Bruno
Modified: 2016-10-14 14:41 UTC (History)
5 users (show)

See Also:
jbeich: maintainer-feedback+


Attachments
Upstream fix for arm assembly failure (1.92 KB, patch)
2016-10-12 14:42 UTC, Dimitry Andric
jbeich: maintainer-approval+
Details | Diff
Fix upstream bug 1278861 for firefox, firefox-esr, libxul, seamonkey and thunderbird (9.71 KB, patch)
2016-10-12 20:17 UTC, Dimitry Andric
jbeich: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Bruno freebsd_committer freebsd_triage 2015-10-23 20:53:03 UTC
Assertion failed: ((PartVT.isInteger() || PartVT == MVT::x86mmx) && ValueVT.isInteger() && "Unknown mismatch!"), function getCopyToParts, file /usr/src/lib/clang/libllvmselectiondag/../../../contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp, line 398.
Stack dump:
0.      Program arguments: /nxb-bin/usr/bin/c++ -cc1 -triple armv6--freebsd11.0-gnueabi -emit-obj -disable-free -main-file-name Unified_cpp_dom_canvas0.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -relaxed-aliasing -masm-verbose -mconstructor-aliases -target-cpu arm1176jzf-s -target-feature +soft-float-abi -target-abi aapcs-linux -mfloat-abi soft -dwarf-column-info -ffunction-sections -fdata-sections -coverage-file /wrkdirs/usr/ports/www/firefox/work/mozilla-release/obj-armv6-portbld-freebsd11.0/dom/canvas/Unified_cpp_dom_canvas0.o -resource-dir /nxb-bin/usr/bin/../lib/clang/3.6.1 -dependency-file .deps/Unified_cpp_dom_canvas0.o.pp -MT Unified_cpp_dom_canvas0.o -sys-header-deps -MP -include /wrkdirs/usr/ports/www/firefox/work/mozilla-release/config/gcc_hidden.h -isystem /usr/local/include -include ../../mozilla-config.h -isystem /usr/local/include -D NOMINMAX -D OS_POSIX=1 -D OS_FREEBSD=1 -D OS_BSD=1 -D STATIC_EXPORTABLE_JS_API -D MOZILLA_INTERNAL_API -D IMPL_LIBXUL -D AB_CD=en-US -D NO_NSPR_10_SUPPORT -D LIBICONV_PLUG -D MOZILLA_CLIENT -D LIBICONV_PLUG -D LIBICONV_PLUG -D LIBICONV_PLUG -D NDEBUG -D TRIMMED -D _THREAD_SAFE -D _THREAD_SAFE -D _THREAD_SAFE -I ../../dist/stl_wrappers -I ../../dist/system_wrappers -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/dom/canvas -I . -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/obj-armv6-portbld-freebsd11.0/ipc/ipdl/_ipdlheaders -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/js/xpconnect/wrappers -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/ipc/chromium/src -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/ipc/glue -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/dom/base -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/dom/html -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/dom/svg -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/dom/xul -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/gfx/gl -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/image -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/js/xpconnect/src -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/layout/generic -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/layout/style -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/layout/xul -I ../../dist/include -I /usr/local/include/nspr -I /usr/local/include/nss -I /usr/local/include/nss/nss -I /usr/local/include -I /usr/local/include -I /usr/local/include/pixman-1 -I /usr/local/include/cairo -I /usr/local/include/glib-2.0 -I /usr/local/lib/glib-2.0/include -I /usr/local/include -I /usr/local/include/pixman-1 -I /usr/local/include/freetype2 -I /usr/local/include/libdrm -I /usr/local/include/libpng16 -I /usr/local/include/cairo -I /usr/local/include/glib-2.0 -I /usr/local/lib/glib-2.0/include -I /usr/local/include -I /usr/local/include/pixman-1 -I /usr/local/include/freetype2 -I /usr/local/include/libdrm -I /usr/local/include/libpng16 -I /wrkdirs/usr/ports/www/firefox/work/mozilla-release/widget/gtk/compat -I /usr/local/include/gtk-2.0 -I /usr/local/include/pango-1.0 -I /usr/local/include/glib-2.0 -I /usr/local/lib/glib-2.0/include -I /usr/local/include -I /usr/local/include/cairo -I /usr/local/include/pixman-1 -I /usr/local/include/freetype2 -I /usr/local/include/libdrm -I /usr/local/include/libpng16 -I /usr/local/include/gdk-pixbuf-2.0 -I /usr/local/include/atk-1.0 -I /usr/local/include/harfbuzz -I /usr/local/include/gtk-unix-print-2.0 -I/usr/local/include -internal-isystem /usr/include/c++/v1 -O3 -Wall -Wempty-body -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Wno-invalid-offsetof -Wno-inline-new-delete -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -std=gnu++0x -fdeprecated-macro -fdebug-compilation-dir /wrkdirs/usr/ports/www/firefox/work/mozilla-release/obj-armv6-portbld-freebsd11.0/dom/canvas -ferror-limit 19 -fmessage-length 0 -pthread -mstackrealign -fno-rtti -fno-signed-char -fobjc-runtime=gnustep -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o Unified_cpp_dom_canvas0.o -x c++ /wrkdirs/usr/ports/www/firefox/work/mozilla-release/obj-armv6-portbld-freebsd11.0/dom/canvas/Unified_cpp_dom_canvas0.cpp 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '/wrkdirs/usr/ports/www/firefox/work/mozilla-release/obj-armv6-portbld-freebsd11.0/dom/canvas/Unified_cpp_dom_canvas0.cpp'.
4.      Running pass 'ARM Instruction Selection' on function '@_ZN7mozilla3dom24CanvasRenderingContext2D12GetImageDataEP9JSContextddddRNS_11ErrorResultE'
gmake[6]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/mozilla-release/obj-armv6-portbld-freebsd11.0/ipc/ipdl'
/nxb-bin/usr/bin/cc -o sctp_input.o -c -I../../../dist/system_wrappers -include /wrkdirs/usr/ports/www/firefox/work/mozilla-release/config/gcc_hidden.h -DOS_POSIX=1 -DOS_FREEBSD=1 -DOS_BSD=1 -DSCTP_SIMPLE_ALLOCATOR=1 -DSCTP_PROCESS_LEVEL_LOCKS=1 -D__Userspace__=1 -DINET=1 -DCALLBACK_API=1 -DSCTP_DEBUG=1 -DINET6=1 -D__Userspace_os_FreeBSD=1 -U__FreeBSD__ -DSTATIC_EXPORTABLE_JS_API -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DAB_CD=en-US -DNO_NSPR_10_SUPPORT -I/wrkdirs/usr/ports/www/firefox/work/mozilla-release/netwerk/sctp/src -I. -I/wrkdirs/usr/ports/www/firefox/work/mozilla-release/obj-armv6-portbld-freebsd11.0/ipc/ipdl/_ipdlheaders -I/wrkdirs/usr/ports/www/firefox/work/mozilla-release/ipc/chromium/src -I/wrkdirs/usr/ports/www/firefox/work/mozilla-release/ipc/glue -I/wrkdirs/usr/ports/www/firefox/work/mozilla-release/dom/base -I/wrkdirs/usr/ports/www/firefox/work/mozilla-release/netwerk/base -I../../../dist/include   -I/usr/local/include/nspr -I/usr/local/include/nss -I/usr/local/include/nss/nss -I/usr/local/include -I/usr/local/include  -I/usr/local/include/pixman-1     -fPIC  -Qunused-arguments -isystem/usr/local/include -DLIBICONV_PLUG  -include ../../../mozilla-config.h -DMOZILLA_CLIENT -MD -MP -MF .deps/sctp_input.o.pp -Qunused-arguments -isystem/usr/local/include -DLIBICONV_PLUG  -Qunused-arguments -Wall -Wdeclaration-after-statement -Wempty-body -Wpointer-to-int-cast -Wsign-compare -Wtype-limits -Wno-unused -O2 -pipe -mfloat-abi=softfp -O3 -DLIBICONV_PLUG -fno-strict-aliasing -std=gnu99 -fgnu89-inline -fno-strict-aliasing -ffunction-sections -fdata-sections -fno-math-errno -pipe  -DNDEBUG -DTRIMMED -O2 -O3 -fomit-frame-pointer -std=gnu99   /wrkdirs/usr/ports/www/firefox/work/mozilla-release/netwerk/sctp/src/netinet/sctp_input.c
sctp_output.o
libtoolkit_profile.a.desc
rm -f libtoolkit_profile.a
/wrkdirs/usr/ports/www/firefox/work/mozilla-release/obj-armv6-portbld-freebsd11.0/_virtualenv/bin/python /wrkdirs/usr/ports/www/firefox/work/mozilla-release/config/expandlibs_gen.py -o libtoolkit_profile.a.desc Unified_cpp_toolkit_profile0.o  
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.6.1 (tags/RELEASE_361/final 237755) 20150525
Target: armv6--freebsd11.0-gnueabi
Thread model: posix
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++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
c++: note: diagnostic msg: /tmp/Unified_cpp_dom_canvas0-1d9ec0.cpp
c++: note: diagnostic msg: /tmp/Unified_cpp_dom_canvas0-1d9ec0.sh
c++: note: diagnostic msg: 

********************
/wrkdirs/usr/ports/www/firefox/work/mozilla-release/config/rules.mk:957: recipe for target 'Unified_cpp_dom_canvas0.o' failed
gmake[6]: *** [Unified_cpp_dom_canvas0.o] Error 254
Comment 1 Sean Bruno freebsd_committer freebsd_triage 2015-10-23 20:54:20 UTC
possibly related?  https://llvm.org/bugs/show_bug.cgi?id=17810
Comment 2 Sean Bruno freebsd_committer freebsd_triage 2015-10-23 20:55:51 UTC
Oh, this might be a similar bug to the reported clang failure in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199450
Comment 3 Sean Bruno freebsd_committer freebsd_triage 2016-02-16 11:56:44 UTC
clang 3.7.1 seems to throw the same Assertion on a different file:

/nxb-bin/usr/bin/c++ -o Unified_cpp_js_src0.o -c  -I../../dist/system_wrappers -include /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/config/gcc_hidden.h -DEXPORT_JS_API -DJS_HAS_CTYPES -DDLL_PREFIX='"lib"' -DDLL_SUFFIX='".so"' -DAB_CD= -DNO_NSPR_10_SUPPORT -I/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/js/src -I. -I/usr/local/lib/libffi-3.2.1/include -I../../dist/include  -I/usr/local/include/nspr        -fPIC  -Qunused-arguments -isystem/usr/local/include -DLIBICONV_PLUG  -DMOZILLA_CLIENT -include ../../js/src/js-confdefs.h -MD -MP -MF .deps/Unified_cpp_js_src0.o.pp -Qunused-arguments -isystem/usr/local/include -DLIBICONV_PLUG  -Qunused-arguments -Wno-inline-new-delete -Wno-unused-local-typedef -Wall -Wsign-compare -Wtype-limits -Wno-invalid-offsetof -Wno-unused-local-typedef -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -O -pipe -mfloat-abi=softfp -O3 -DLIBICONV_PLUG -fno-strict-aliasing -DLIBICONV_PLUG -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -std=gnu++0x -pipe  -DNDEBUG -DTRIMMED -O -O3 -fomit-frame-pointer  -I/usr/local/include   /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/obj-armv6-portbld-freebsd11.0/js/src/Unified_cpp_js_src0.cpp
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/obj-armv6-portbld-freebsd11.0/js/src/Unified_cpp_js_src0.cpp:2:
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/js/src/asmjs/AsmJSCompile.cpp:19:
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/js/src/asmjs/AsmJSCompile.h:22:
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/js/src/jit/CompileWrappers.h:10:
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/js/src/jscntxt.h:16:
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/js/src/vm/Runtime.h:47:
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/js/src/vm/Stack.h:21:
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/js/src/jit/JitFrameIterator.h:15:
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/js/src/jit/Snapshots.h:17:
In file included from /wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/js/src/jit/Registers.h:16:
/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/js/src/jit/arm/Architecture-arm.h:273:44: warning: all paths through this function will call itself [-Winfinite-recursion]
    static const char* GetName(uint32_t i) {
                                           ^
Assertion failed: ((PartVT.isInteger() || PartVT == MVT::x86mmx) && ValueVT.isInteger() && "Unknown mismatch!"), function getCopyToParts, file /usr/local/poudriere/jails/11armv6/usr/src/lib/clang/libllvmselectiondag/../../../contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp, line 406.
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.7.1 (tags/RELEASE_371/final 255217) 20151225
Target: armv6--freebsd11.0-gnueabi
Thread model: posix
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++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
c++: note: diagnostic msg: /tmp/Unified_cpp_js_src0-87ffea.cpp
c++: note: diagnostic msg: /tmp/Unified_cpp_js_src0-87ffea.sh
c++: note: diagnostic msg: 

********************
/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/config/rules.mk:958: recipe for target 'Unified_cpp_js_src0.o' failed
gmake[6]: *** [Unified_cpp_js_src0.o] Error 254
gmake[6]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/obj-armv6-portbld-freebsd11.0/js/src'
/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/config/recurse.mk:71: recipe for target 'js/src/target' failed
gmake[5]: *** [js/src/target] Error 2
gmake[5]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/obj-armv6-portbld-freebsd11.0'
/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/config/recurse.mk:32: recipe for target 'compile' failed
gmake[4]: *** [compile] Error 2
gmake[4]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/obj-armv6-portbld-freebsd11.0'
/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/config/rules.mk:549: recipe for target 'default' failed
gmake[3]: *** [default] Error 2
gmake[3]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/obj-armv6-portbld-freebsd11.0'
/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/client.mk:396: recipe for target 'realbuild' failed
gmake[2]: *** [realbuild] Error 2
gmake[2]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1'
/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1/client.mk:171: recipe for target 'build' failed
gmake[1]: *** [build] Error 2
gmake[1]: Leaving directory '/wrkdirs/usr/ports/www/firefox/work/firefox-44.0.1'
*** Error code 1
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2016-09-25 18:00:19 UTC
(In reply to Sean Bruno from comment #0)
...
> PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
> Preprocessed source(s) and associated run script(s) are located at:
> c++: note: diagnostic msg: /tmp/Unified_cpp_dom_canvas0-1d9ec0.cpp
> c++: note: diagnostic msg: /tmp/Unified_cpp_dom_canvas0-1d9ec0.sh

(In reply to Sean Bruno from comment #3)
> PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
> Preprocessed source(s) and associated run script(s) are located at:
> c++: note: diagnostic msg: /tmp/Unified_cpp_js_src0-87ffea.cpp
> c++: note: diagnostic msg: /tmp/Unified_cpp_js_src0-87ffea.sh

Please create a tarball of these files, and attach it.
Comment 5 Dimitry Andric freebsd_committer freebsd_triage 2016-09-27 11:54:55 UTC
*** Bug 211069 has been marked as a duplicate of this bug. ***
Comment 6 Dimitry Andric freebsd_committer freebsd_triage 2016-09-27 11:57:37 UTC
Never mind about the attachment, this is a case of LLVM PR 23244 [1].  It was also reported in bug 211069, where it dies with the same assertion on the same file.

For some reason, LLVM handles assigning a float value to an integer arm register very badly, and while this has been reported upstream, for ~1.5 years nothing has happened.  So for now this will remain broken, unfortunately.

[1] https://llvm.org/bugs/show_bug.cgi?id=23244
Comment 7 Dimitry Andric freebsd_committer freebsd_triage 2016-10-12 11:40:20 UTC
*** Bug 213402 has been marked as a duplicate of this bug. ***
Comment 8 Dimitry Andric freebsd_committer freebsd_triage 2016-10-12 14:42:56 UTC
Created attachment 175667 [details]
Upstream fix for arm assembly failure

To work around this problem, let's import the fix for upstream bug 1278861 [1].  This disables the arm specific inline assembly for clang in general.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1278861
Comment 9 Jan Beich freebsd_committer freebsd_triage 2016-10-12 17:50:46 UTC
Comment on attachment 175667 [details]
Upstream fix for arm assembly failure

Looks OK but the affected code also exists in

 - mail/thunderbird
 - www/firefox-esr
 - www/libxul
 - www/seamonkey
Comment 10 Dimitry Andric freebsd_committer freebsd_triage 2016-10-12 20:17:27 UTC
Created attachment 175679 [details]
Fix upstream bug 1278861 for firefox, firefox-esr, libxul, seamonkey and thunderbird

Let's try that again, now for:
* mail/thunderbird
* www/firefox
* www/firefox-esr
* www/libxul
* www/seamonkey
Comment 11 commit-hook freebsd_committer freebsd_triage 2016-10-12 20:51:09 UTC
A commit references this bug:

Author: dim
Date: Wed Oct 12 20:50:29 UTC 2016
New revision: 423893
URL: https://svnweb.freebsd.org/changeset/ports/423893

Log:
  Add the upstream fix for Mozilla bug 1278861, which prevents clang
  assertions on a particular piece of arm inline assembly.  This applies
  to:

  * mail/thunderbird
  * www/firefox
  * www/firefox-esr
  * www/libxul
  * www/seamonkey

  Approved by:	jbeich (maintainer)
  PR:		203989
  MFH:		2016Q4

Changes:
  head/mail/thunderbird/files/patch-bug1278861
  head/www/firefox/files/patch-bug1278861
  head/www/firefox-esr/files/patch-bug1278861
  head/www/libxul/files/patch-bug1278861
  head/www/seamonkey/files/patch-bug1278861
Comment 12 commit-hook freebsd_committer freebsd_triage 2016-10-14 14:41:15 UTC
A commit references this bug:

Author: dim
Date: Fri Oct 14 14:40:47 UTC 2016
New revision: 423974
URL: https://svnweb.freebsd.org/changeset/ports/423974

Log:
  MFH: r423893

  Add the upstream fix for Mozilla bug 1278861, which prevents clang
  assertions on a particular piece of arm inline assembly.  This applies
  to:

  * mail/thunderbird
  * www/firefox
  * www/firefox-esr
  * www/libxul
  * www/seamonkey

  Approved by:	portmgr (feld)
  PR:		203989

Changes:
_U  branches/2016Q4/
  branches/2016Q4/mail/thunderbird/files/patch-bug1278861
  branches/2016Q4/www/firefox/files/patch-bug1278861
  branches/2016Q4/www/firefox-esr/files/patch-bug1278861
  branches/2016Q4/www/libxul/files/patch-bug1278861
  branches/2016Q4/www/seamonkey/files/patch-bug1278861