Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 860351

Summary: app-emulation/qemu: net-libs/webkit-gtk-2.36.4 build fails on riscv64 (fails at end of build, Signals.SIGSEGV: 11)
Product: Gentoo Linux Reporter: Christian Charon <christian.charon>
Component: Current packagesAssignee: John Helmert III <ajak>
Status: UNCONFIRMED ---    
Severity: normal CC: gnome, matoro_bugzilla_gentoo, riscv, sam, tamiko, virtualization, zlogene
Priority: Normal    
Version: unspecified   
Hardware: riscv   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge-info.txt
complete build.log
environment
end of build.log

Description Christian Charon 2022-07-23 21:19:49 UTC
When building webkit-qtk on a qemu riscv system webkit-gtk fails in the last stages of the build.

Reproducible: Always

Steps to Reproduce:
1. "emerge gnome", wait until webkit gtk gets build, build stops with Signals.SIGSEGV: 11 after almost all is done
Actual Results:  
this Command fails  '['/var/tmp/portage/net-libs/webkit-gtk-2.36.4/work/webkit-gtk-2.36.4_build/Source/WebKit/tmp-introspectj5fh_ors/WebKit2-4.0', '--introspect-dump=/var/tmp/portage/net-libs/webkit-gtk-2.36.4/work/webkit-gtk-2.36.4_build/Source/WebKit/tmp-introspectj5fh_ors/functions.txt,/var/tmp/portage/net-libs/webkit-gtk-2.36.4/work/webkit-gtk-2.36.4_build/Source/WebKit/tmp-introspectj5fh_ors/dump.xml']' died with <Signals.SIGSEGV: 11>.

Expected Results:  
the command should work and webkit-gtk should finish its build

Up to this package the vm behaved perfectly fine, so I do not think its a problem of the vm, but a problem of this package for the riscv64 architecture.

Emerge Info: https://raw.githubusercontent.com/ccharon/docs/master/riscv-gentoo/webkit-gtk-fail/info.txt


Build.log
only the end: https://raw.githubusercontent.com/ccharon/docs/master/riscv-gentoo/webkit-gtk-fail/end_of_build.log

compressed complete build log: https://github.com/ccharon/docs/blob/master/riscv-gentoo/webkit-gtk-fail/build.log.tar.xz?raw=true

Environemnt: https://github.com/ccharon/docs/blob/master/riscv-gentoo/webkit-gtk-fail/environment

Qemu Command:
qemu-system-riscv64 -machine virt -smp 12 -m 24G \
-kernel ./u-boot-qemu/uboot.elf \
-device virtio-mouse \
-device virtio-keyboard \
-device AC97,audiodev=pa1 -audiodev driver=pa,id=pa1 \
-device virtio-gpu-pci,id=video0 \
-serial mon:stdio \
-device virtio-rng-pci,rng=rng -object rng-random,filename=/dev/urandom,id=rng \
-device qemu-xhci \
-device virtio-net-device,netdev=eth0 -netdev bridge,br=virbr0,id=eth0 \
-drive file=gentoo.qcow2,if=virtio,id=gentoo,index=0
Comment 1 Matt Turner gentoo-dev 2022-07-24 00:02:13 UTC
I suspect the VM ran out of memory. Check dmesg.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-24 00:08:39 UTC
Also, please attach logs (compressed if necessary) rather than using external sites.
Comment 3 Christian Charon 2022-07-24 06:48:06 UTC
Created attachment 793640 [details]
emerge-info.txt
Comment 4 Christian Charon 2022-07-24 06:48:29 UTC
Created attachment 793643 [details]
complete build.log
Comment 5 Christian Charon 2022-07-24 06:48:45 UTC
Created attachment 793646 [details]
environment
Comment 6 Christian Charon 2022-07-24 06:49:08 UTC
Created attachment 793649 [details]
end of build.log
Comment 7 Christian Charon 2022-07-24 06:50:27 UTC
added the files directly.

and just in case restartet the build with -j4 .. initially I used -j12 and after the build stopped i used -j8 always with 24gb ram. I'll see what happens in 8-10h :)
Comment 8 Christian Charon 2022-07-24 21:00:38 UTC
ok, the build with -j4 aborted with the same error (<Signals.SIGSEGV: 11>)


this time i watched the logs closely (journalctl -f ) and found this:

Jul 24 21:30:09 riscvm kernel: WebKit2-4.0[20227]: unhandled signal 11 code 0x1 at 0x0000ffff7e5f901c in libjavascriptcoregtk-4.0.so.18.20.8[ffffff83200000+842000]
Jul 24 21:30:09 riscvm kernel: CPU: 3 PID: 20227 Comm: WebKit2-4.0 Not tainted 5.18.12-gentoo #10
Jul 24 21:30:09 riscvm kernel: Hardware name: riscv-virtio,qemu (DT)
Jul 24 21:30:09 riscvm kernel: epc : 00ffffff83953258 ra : 00ffffff8394da0e sp : 00ffffffe1e3df20
Jul 24 21:30:09 riscvm kernel:  gp : 00aaaaaab99e6800 tp : 00ffffff7eee0ec0 t0 : 00ffffff866f6b80
Jul 24 21:30:09 riscvm kernel:  t1 : 00ffffff83953254 t2 : 000000000398d9f8 s0 : 00ffffff7e5fa02e
Jul 24 21:30:09 riscvm kernel:  s1 : 00ffffffe1e3df38 a0 : 0000ffff7e5f9018 a1 : 00ffffff83a3ff70
Jul 24 21:30:09 riscvm kernel:  a2 : 0000000000000005 a3 : 000000000000007e a4 : 00000000000000ff
Jul 24 21:30:09 riscvm kernel:  a5 : 00000000000000ff a6 : 00000000007e5f90 a7 : 0000000000000007
Jul 24 21:30:09 riscvm kernel:  s2 : 0000000000000005 s3 : ffffffff8f63b103 s4 : 00ffffffe1e3dfe0
Jul 24 21:30:09 riscvm kernel:  s5 : 0000000000000001 s6 : 0000000000029e4d s7 : 00ffffffe1e3dfd0
Jul 24 21:30:09 riscvm kernel:  s8 : 0000000000000000 s9 : 00ffffff7e5fa010 s10: 0000000000000007
Jul 24 21:30:09 riscvm kernel:  s11: 0000000000000000 t3 : 00ffffff8320f3f8 t4 : 00000000e6367e39
Jul 24 21:30:09 riscvm kernel:  t5 : 0000000000000039 t6 : 0000000000000000
Jul 24 21:30:09 riscvm kernel: status: 8000000200006020 badaddr: 0000ffff7e5f901c cause: 000000000000000d


so it seems that something is wrong in this lib libjavascriptcoregtk-4.0.so.18.20.8 would signal 11 be something like an illegal memory access?
Comment 9 Yixun Lan archtester gentoo-dev 2022-07-25 06:30:16 UTC
I have webkit-gtk built on umatched board (using the native compiling way)

And, here it is, built successfully with USE="X egl gstreamer introspection jpeg2k jumbo-build lcms libnotify seccomp spell systemd" enabled

     Mon Jul 11 12:09:51 2022 >>> net-libs/webkit-gtk-2.36.4
       merge time: 19 hours, 48 minutes and 3 seconds.
Comment 10 Christian Charon 2022-07-25 08:47:55 UTC
hmm, maybe its a qemu thing, strange.

which gcc did you use?

my version is sys-devel/gcc: 12.1.1_p20220625::gentoo
Comment 11 Yixun Lan archtester gentoo-dev 2022-07-25 09:02:28 UTC
> which gcc did you use?


yes, I'm using gcc-12

     Wed Jun 29 14:46:01 2022 >>> sys-devel/gcc-12.1.1_p20220625
       merge time: 9 hours, 44 minutes and 1 second.
Comment 12 Christian Charon 2022-07-25 22:47:28 UTC
2 more failed compiles one with -mcpu=sifive_u74 and another one with -misa-spec=2.2 (which helped to get grub compiled)

 
Yixun Lan, said it is no problem on real hardware, well I'll accept that :)

For now I simply try to compile mate desktop. Hopefully sometime there will be some affordable hardware available that contains a JH7110 CPU.

What to do with this bug, can I simply resolve it or discard it somehow?
Comment 13 Yixun Lan archtester gentoo-dev 2022-07-25 23:05:17 UTC
(In reply to Christian Charon from comment #12)
> 2 more failed compiles one with -mcpu=sifive_u74 and another one with
> -misa-spec=2.2 (which helped to get grub compiled)
> 
there is might no problem with these cflags, but here I'm just using common setting - just "-O2 -pipe -mabi=lp64d"

>  
> Yixun Lan, said it is no problem on real hardware, well I'll accept that :)
> 
> For now I simply try to compile mate desktop. Hopefully sometime there will
> be some affordable hardware available that contains a JH7110 CPU.
> 
> What to do with this bug, can I simply resolve it or discard it somehow?

I would just leave it open (which doesn't really hurt), if anyone encounter same problem or want to investigate further? 


so report back, build successfully here on unmatched board

# genlop -t webkit-gtk
     Tue Jul 26 04:26:04 2022 >>> net-libs/webkit-gtk-2.36.4
       merge time: 13 hours, 13 minutes and 12 seconds.

# eix -e webkit-gtk
[I] net-libs/webkit-gtk
     Available versions:  (4) (~)2.36.3(4/37)^t{xpak} (~)2.36.4(4/37)^t{xpak:2}
       {X aqua avif +egl examples gamepad +geolocation gles2-only gnome-keyring +gstreamer gtk-doc +introspection +jpeg2k +jumbo-build lcms libnotify seccomp spell systemd test wayland}
     Installed versions:  2.36.4(4/37)^t{xpak:2}(04:22:47 07/26/22)(X egl gnome-keyring gstreamer introspection jpeg2k jumbo-build lcms libnotify seccomp spell systemd wayland -aqua -avif -examples -gamepad -gles2-only -gtk-doc -test)
     Homepage:            https://www.webkitgtk.org
     Description:         Open source web browser engine
Comment 14 Christian Charon 2022-07-25 23:13:52 UTC
I think the problem is a little out of my league. What could be possible next steps? 

systemd saved coredumps, but even if i could interpret them it could be anything, even a qemu problem.

I really am curious trying out things around riscv, so if i could get a hint which information to find or what to try i am open to suggestions :)
Comment 15 matoro archtester 2022-07-26 04:37:53 UTC
I also just built this fine on read hardware.  I use even more aggressive CFLAGS "-O3 -pipe -march=rv64imafdc -mcpu=sifive-u74 -mtune=sifive-7-series", so that doesn't seem to matter.

Based on this, I think this is a qemu bug, and should be reassigned appropriately.

For the reporter, it would probably be most helpful to enable coredumps to file, redo the build with debug flags (-O0 -pipe -ggdb3) and provide a backtrace to qemu upstream.
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-26 04:48:23 UTC
FWIW, this will have to go upstream.
Comment 17 Christian Charon 2022-07-26 22:20:50 UTC
I compiled again with:

"-O0 -pipe -ggdb3 -DRELEASE_WITHOUT_OPTIMIZATIONS -Wall"
FEATURES="nostrip" emerge -1 webkit-gtk

This time no SIGSGEV: 11 but this:

...

[6133/6141] : && /usr/bin/riscv64-unknown-linux-gnu-g++ -fPIC -fdiagnostics-color=always -Wextra -Wall -pipe -Wno-expansion-to-defined -Wno-odr -Wno-stringop-overread -Wno-nonnull -Wno-array-bounds -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-tautological-compare -O0 -pipe -ggdb3 -DRELEASE_WITHOUT_OPTIMIZATIONS -Wall -fno-strict-aliasing -fno-exceptions -fno-rtti  -Wl,--no-undefined -Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--disable-new-dtags   -Wl,--version-script,/var/tmp/portage/net-libs/webkit-gtk-2.36.4/work/webkitgtk-2.36.4/Source/WebKit/webkitglib-symbols.map -shared -Wl,-soname,libwebkit2gtk-4.0.so.37 -o lib/libwebkit2gtk-4.0.so.37.56.8 @CMakeFiles/WebKit.rsp  && :
FAILED: lib/libwebkit2gtk-4.0.so.37.56.8 
: && /usr/bin/riscv64-unknown-linux-gnu-g++ -fPIC -fdiagnostics-color=always -Wextra -Wall -pipe -Wno-expansion-to-defined -Wno-odr -Wno-stringop-overread -Wno-nonnull -Wno-array-bounds -Wno-noexcept-type -Wno-psabi -Wno-misleading-indentation -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-tautological-compare -O0 -pipe -ggdb3 -DRELEASE_WITHOUT_OPTIMIZATIONS -Wall -fno-strict-aliasing -fno-exceptions -fno-rtti  -Wl,--no-undefined -Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--disable-new-dtags   -Wl,--version-script,/var/tmp/portage/net-libs/webkit-gtk-2.36.4/work/webkitgtk-2.36.4/Source/WebKit/webkitglib-symbols.map -shared -Wl,-soname,libwebkit2gtk-4.0.so.37 -o lib/libwebkit2gtk-4.0.so.37.56.8 @CMakeFiles/WebKit.rsp  && :
Source/WebCore/CMakeFiles/WebCore.dir/./platform/graphics/FormatConverter.cpp.o: in function `WebCore::FormatConverter::convert(WebCore::GraphicsContextGL::DataFormat, WebCore::GraphicsContextGL::DataFormat, WebCore::GraphicsContextGL::AlphaOp)':
/var/tmp/portage/net-libs/webkit-gtk-2.36.4/work/webkitgtk-2.36.4/Source/WebCore/platform/graphics/FormatConverter.cpp:1596:(.text+0x108): relocation truncated to fit: R_RISCV_JAL against `.L27'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
 * ERROR: net-libs/webkit-gtk-2.36.4::gentoo failed (compile phase):
 *   ninja -v -j12 -l0 failed
 
...
Comment 18 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-27 00:49:35 UTC
I would not expect -O0 to work and while it might be a valid bug, it's separate to this one. It's probably something like there's various relocations which don't even get emitted with higher optimisations levels and then it overflows some maximum because it can't fit them all in. Dunno much about riscv though.