-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang 17.0.6 and 18.1.2 fail to build libwebp-1.3.2 and harfbuzz-8.3.0 on ppc32/musl: "clang: error: clang frontend command failed with exit code 139" #86460
Comments
It doesn't reproduce for me using assertion builds of 17.0.1, 18.1.0, 18.1.2, and 19.0 (trunk). |
@Endilll Did you perhaps try to reproduce on a 64bit ppc system? I don't get this on ppc64 musl either, only on 32bit ppc musl. Just re-tried with clang 18.1.5 and still get the issue. Logs attached. Building is done on my 64bit Talos II but on a ppc 32bit partition. Some data about the system:
For building a package with clang I use these settings on a per package basis:
|
What I tried was basically a cross-compilation from x86-64 with glibc, using the triple from your reproducer script. |
Had some spare time, made myself familiar with cvise and got a reduced test case out of it:
The script I used with cvise was:
Also found out when I build the (non-reduced) pre-processed binary without Building was done with llvm/clang 18.1.6. |
Thank you! I'm tried to make a CE reproducer out of it, but it doesn't reproduce: https://godbolt.org/z/49s15bx1b |
Probably you forgot Without it you only get the whole bunch of errors regarding the obviously missing ;, ] and int type specifiers. Fixing the obvious errors I get:
Which still provokes the issue on my ppc32 musl system:
Without -Wall Hopefully this is helpful to you in some way. I am new at this cvise/godbolt stuff. 😳 |
Got a hint on gentoo-powerpc IRC to check out specific diagnostic flags. Found out the specific diagnostic flag triggering the issue is |
I added
Thank you for your cooperation! To be clear, I'm pushing for CE reproducer, because that eliminates aspects of it that are related to your particular setup. Otherwise we can't reproduce it on our machines and fix it. If that's not possible, you should do a debug build of Clang, and post here how it crashes. It should contain more helpful information. I think at the moment we don't have neither a failed assertion nor a stack trace, so we can only guess what went wrong. |
Hey, I was able to reproduce this upon request. I'm having trouble doing a native debug build of LLVM due to exhausting the 32-bit virtual address space. From what I saw in the trace without debug symbols, it's entirely contained in LLVM, so I doubt the libc has anything to do with it (will check glibc to confirm). In the meantime I will try and get a cross-compiled build with debug symbols going to provide a proper stack trace. |
Okay, the least-optimized build I was able to get where the debug symbols would still fit inside the 4G virtual memory limit was Shockingly, this actually indeed does not reproduce under ppc glibc. Musl does seem to be required to trigger it. Additionally it does not seem to trip any assertions (this is with checking enabled for both LLVM & clang). Here is the traceback summary:
I also happened to notice my
Finally, here is a complete backtrace with code snippets and locals, which I generated from the following gdb script:
|
@matoro Thank you! Stack trace is helpful to have. |
@llvm/issue-subscribers-clang-frontend Author: None (ernsteiswuerfel)
I get this at building libwebp-1.3.2 on my Talos II (ppc32 chroot, musl) with clang 17.0.6 or 18.1.2:
```
[...]
libtool: compile: clang -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc -I../../src/webp -DNDEBUG -I../.. -I/var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2 -fvisibility=hidden -Wall -Wconstant-conversion -Wdeclaration-after-statement -Wextra -Wfloat-conversion -Wformat -Wformat-nonliteral -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wparentheses-equality -Wshadow -Wshorten-64-to-32 -Wundef -Wunreachable-code-aggressive -Wunreachable-code -Wunused-but-set-variable -Wunused -Wvla -O2 -mcpu=7450 -mtune=7450 -pipe -c /var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc/backward_references_cost_enc.c -fPIC -DPIC -o .libs/libwebpencode_la-backward_references_cost_enc.o
/bin/sh ../../libtool --tag=CC --mode=compile clang -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc -I../../src/webp -DNDEBUG -I../.. -I/var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2 -fvisibility=hidden -Wall -Wconstant-conversion -Wdeclaration-after-statement -Wextra -Wfloat-conversion -Wformat -Wformat-nonliteral -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wparentheses-equality -Wshadow -Wshorten-64-to-32 -Wundef -Wunreachable-code-aggressive -Wunreachable-code -Wunused-but-set-variable -Wunused -Wvla -O2 -mcpu=7450 -mtune=7450 -pipe -c -o libwebpencode_la-backward_references_enc.lo `test -f 'backward_references_enc.c' || echo '/var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc/'`backward_references_enc.c
libtool: compile: clang -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc -I../../src/webp -DNDEBUG -I../.. -I/var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2 -fvisibility=hidden -Wall -Wconstant-conversion -Wdeclaration-after-statement -Wextra -Wfloat-conversion -Wformat -Wformat-nonliteral -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wparentheses-equality -Wshadow -Wshorten-64-to-32 -Wundef -Wunreachable-code-aggressive -Wunreachable-code -Wunused-but-set-variable -Wunused -Wvla -O2 -mcpu=7450 -mtune=7450 -pipe -c /var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc/backward_references_enc.c -fPIC -DPIC -o .libs/libwebpencode_la-backward_references_enc.o
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc -I../../src/webp -DNDEBUG -I../.. -I/var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2 -fvisibility=hidden -Wall -Wconstant-conversion -Wdeclaration-after-statement -Wextra -Wfloat-conversion -Wformat -Wformat-nonliteral -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wparentheses-equality -Wshadow -Wshorten-64-to-32 -Wundef -Wunreachable-code-aggressive -Wunreachable-code -Wunused-but-set-variable -Wunused -Wvla -O2 -mcpu=7450 -mtune=7450 -pipe -c /var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc/backward_references_enc.c -fPIC -DPIC -o .libs/libwebpencode_la-backward_references_enc.o
1. /var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc/backward_references_enc.c:345:3: current parser token 'chain'
2. /var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc/backward_references_enc.c:262:62: parsing function body 'VP8LHashChainFill'
3. /var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc/backward_references_enc.c:262:62: in compound statement ('{}')
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 18.1.2
Target: powerpc-gentoo-linux-musl
Thread model: posix
InstalledDir: /usr/lib/llvm/18/bin
Configuration file: /etc/clang/powerpc-gentoo-linux-musl-clang.cfg
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: make[2]: *** [Makefile:546: libwebpencode_la-backward_references_enc.lo] Error 1
gdb --args clang "-DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc -I../../src/webp -DNDEBUG -I../.. -I/var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2 -fvisibility=hidden -Wall -Wconstant-conversion -Wdeclaration-after-statement -Wextra -Wfloat-conversion -Wformat -Wformat-nonliteral -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wold-style-definition -Wparentheses-equality -Wshadow -Wshorten-64-to-32 -Wundef -Wunreachable-code-aggressive -Wunreachable-code -Wunused-but-set-variable -Wunused -Wvla -O2 -mcpu=7450 -mtune=7450 -pipe -c /var/tmp/portage/media-libs/libwebp-1.3.2/work/libwebp-1.3.2/src/enc/backward_references_enc.c -fPIC -DPIC -o .libs/libwebpencode_la-backward_references_enc.o"GNU gdb (Gentoo 14.1 vanilla) 14.1 For help, type "help".
|
I get this at building libwebp-1.3.2 on my Talos II (ppc32 chroot, musl) with clang 17.0.6 or 18.1.2:
I get a similar error (
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation)
) when building harfbuzz-8.3.0.I tried to run the relevant command in gdb but that wasn't very conclusive (for me):
If I use binutils bfd as linker I get the same "undefined symbol: main".
I don't think there is a general problem of clang/lld not working on musl/ppc32 as other packages like lz4 or pigz build just fine with clang and run fine.
Build.log and the 2 files mentioned in the backtrace attached.
libwebp-1.3.2:20240324-224754.log
backward_references.zip
harfbuzz-8.3.0:20240324-230857.log
hb-static.zip
The text was updated successfully, but these errors were encountered: