Bug 225827

Summary: x11/xlockmore: Assertion failed: CLANG 6.0.0 compiler frontend error
Product: Ports & Packages Reporter: O. Hartmann <ohartmann>
Component: Individual Port(s)Assignee: Jason Helfman <jgh>
Status: Closed FIXED    
Severity: Affects Many People CC: jgh, puretone, tobik, w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (jgh)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
xlockmore.diff tobik: maintainer-approval? (jgh)

Description O. Hartmann 2018-02-11 15:41:12 UTC
On recent CURRENT (FreeBSD 12.0-CURRENT #133 r329113: Sat Feb 10 23:54:56 CET 2018 amd64) running poudriere:

Poudriere version: 3.2.4
Host OSVERSION: 1200057
Jail OSVERSION: 1200057

x11/lockmore fails to build due to an clang error reported bewlow:

[...]
--- xglock.o ---
cc -Wnested-externs -Wno-format -c  -DHAVE_CONFIG_H  -DXGLOCKRC_FILE=\"/usr/local/share/xlock/xglockrc\" -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/harfbuzz -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/atk-1.0 -D_THREAD_SAFE -pthread  -I.. -I.. -O2 -pipe  -I/usr/local/include/FTGL -I/usr/local/include/freetype2 -fstack-protector -fno-strict-aliasing -pthread xglock.c
Assertion failed: (SE.DT.dominates(Ret, &*BIP)), function ReuseOrCreateCast, file /pool/sources/CURRENT/src/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp, line 83.
cc: error: unable to execute command: Abort trap
cc: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 6.0.0 (branches/release_60 324090) (based on LLVM 6.0.0)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin
Comment 1 Walter Schwarzenfeld freebsd_triage 2018-03-03 23:59:09 UTC
*** Bug 226108 has been marked as a duplicate of this bug. ***
Comment 2 Walter Schwarzenfeld freebsd_triage 2018-03-04 00:29:16 UTC
The error appears if option GTK2 is set to on.
Comment 3 Walter Schwarzenfeld freebsd_triage 2018-03-04 00:30:54 UTC
Assertion failed: (SE.DT.dominates(Ret, &*BIP)), function ReuseOrCreateCast, file /wrkdirs/usr/ports/devel/llvm60/work/llvm-6.0.0rc3.src/lib/Analysis/ScalarEvolutionExpander.cpp, line 83.
#0 0x0000000802fc3a68 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/local/llvm60/lib/libLLVM-6.0.so+0x9c3a68)
#1 0x0000000802fc1ef6 llvm::sys::RunSignalHandlers(void) (/usr/local/llvm60/lib/libLLVM-6.0.so+0x9c1ef6)
#2 0x0000000802fc4114 (/usr/local/llvm60/lib/libLLVM-6.0.so+0x9c4114)
#3 0x00000008021fca4a (/lib/libthr.so.3+0xda4a)
#4 0x00000008021fc12c (/lib/libthr.so.3+0xd12c)
Stack dump:
0.	Program arguments: /usr/local/llvm60/bin/clang-6.0 -cc1 -triple x86_64-portbld-freebsd10.3 -emit-obj -disable-free -main-file-name xglock.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /ram/usr/ports/x11/xlockmore/work/xlockmore-5.54/xglock/xglock.gcno -resource-dir /usr/local/llvm60/lib/clang/6.0.0 -D HAVE_CONFIG_H -D XGLOCKRC_FILE="/usr/local/share/xlock/xglockrc" -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/harfbuzz -I /usr/local/include/gdk-pixbuf-2.0 -I /usr/local/include/atk-1.0 -D _THREAD_SAFE -I .. -I .. -O2 -Wno-invalid-source-encoding -fdebug-compilation-dir /ram/usr/ports/x11/xlockmore/work/xlockmore-5.54/xglock -ferror-limit 19 -fmessage-length 0 -pthread -stack-protector 1 -fobjc-runtime=gnustep -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o xglock.o -x c xglock.c 
1.	<eof> parser at end of file
2.	Per-module optimization passes
3.	Running pass 'CallGraph Pass Manager' on module 'xglock.c'.
4.	Running pass 'Loop Pass Manager' on function '@create_boolOptions_buttons'
5.	Running pass 'Induction Variable Simplification' on basic block '%for.body'
clang-6.0: error: unable to execute command: Abort trap (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 6.0.0 (tags/RELEASE_600/rc3)
Target: x86_64-portbld-freebsd10.3
Thread model: posix
InstalledDir: /usr/local/llvm60/bin
Comment 4 puretone 2018-06-08 04:22:56 UTC
Hey guys,
I've been having the same issue as well.
First off, the build with GTK2 option causes build failure, which we know of now... At first, without actually sniffling about on the Google machine, I tried to manhandle the build a bit by editing my /etc/make.conf and forcing CLang 6.0 with:

CC=clang
CXX=clang++
CPP=clang-cpp

I did this because I glimpsed the report of an error regarding "cc: <some brouhaha> etc", and without bothering to scroll thru the terminal output, figured I'd just quickly try adjust make.conf.
So the compiling fails with both GTK2 on/off when using a custom make.conf containing the CC=clang etc.
Next when commenting-out the clang stuff in make.conf, the build finishes successfully. I'm a bit miffed by it, but this must be something off with the xlockmore source. Hopefully this might help others.
Comment 5 Tobias Kortkamp freebsd_committer freebsd_triage 2018-07-08 11:51:27 UTC
Created attachment 194950 [details]
xlockmore.diff

Here's a patch to allow it to build with Clang 6. Can someone confirm that 
runtime is ok too?
Comment 6 Jason Helfman freebsd_committer freebsd_triage 2018-07-12 23:02:57 UTC
I can work on confirming this, however how can I confirm that it is with this version of clang?
Comment 7 Jason Helfman freebsd_committer freebsd_triage 2018-07-14 15:56:34 UTC
I have a "working" diff here (untested via pourdiere), however there is an issue that I am looking into that may be an issue before committing, and have ping'd portmgr@ for guidance.

https://people.freebsd.org/~jgh/files/xlockmore.diff
Comment 8 Jason Helfman freebsd_committer freebsd_triage 2018-07-18 18:55:51 UTC
I have an updated patch that resolves previous issues, if anyone would like to verify for me. I will send some of the make patches upstream.
https://people.freebsd.org/~jgh/files/xlockmore.diff
Comment 9 Jason Helfman freebsd_committer freebsd_triage 2018-07-18 20:36:05 UTC
Thanks for the report!
Comment 10 commit-hook freebsd_committer freebsd_triage 2018-07-18 20:36:43 UTC
A commit references this bug:

Author: jgh
Date: Wed Jul 18 20:35:46 UTC 2018
New revision: 474899
URL: https://svnweb.freebsd.org/changeset/ports/474899

Log:
  - update to 5.55
  - fix CLANG 6.0.0 compile issue [1]
  - address DESTDIR and INSTALL_PROGRAM issues

  PR:		225827
  Submitted by:	tobik@ [1 (patch)]
  Reported by:	ohartmann@walstatt.org [1]

Changes:
  head/x11/xlockmore/Makefile
  head/x11/xlockmore/distinfo
  head/x11/xlockmore/files/
  head/x11/xlockmore/files/patch-xglock_xglock.c
  head/x11/xlockmore/pkg-plist
Comment 11 commit-hook freebsd_committer freebsd_triage 2018-07-18 20:42:51 UTC
A commit references this bug:

Author: jgh
Date: Wed Jul 18 20:41:57 UTC 2018
New revision: 474901
URL: https://svnweb.freebsd.org/changeset/ports/474901

Log:
  MFH: r474899

  - update to 5.55
  - fix CLANG 6.0.0 compile issue [1]
  - address DESTDIR and INSTALL_PROGRAM issues

  PR:		225827
  Submitted by:	tobik@ [1 (patch)]
  Reported by:	ohartmann@walstatt.org [1]

  Approved by:	ports-secteam

Changes:
_U  branches/2018Q3/
  branches/2018Q3/x11/xlockmore/Makefile
  branches/2018Q3/x11/xlockmore/distinfo
  branches/2018Q3/x11/xlockmore/files/
  branches/2018Q3/x11/xlockmore/pkg-plist