hw-display-qxl.so: undefined symbol: qemu_qxl_io_log_semaphore
Hi Gerd,
I'm trying to build qemu 5.1.0-rc0 in Fedora. I'm hitting some issues.
Using this configure line:
./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/libexec --interp-prefix=/usr/qemu-%M --with-pkgversion=qemu-5.1.0-0.1.rc0.fc33 '--extra-ldflags=-Wl,--build-id -Wl,-z,relro -Wl,-z,now' '--extra-cflags=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --enable-trace-backend=dtrace --audio-drv-list=pa,sdl,alsa,oss --enable-kvm --target-list=x86_64-softmmu --enable-pie --enable-modules --enable-spice
Build and then run:
$ ./x86_64-softmmu/qemu-system-x86_64 -device \? | grep qxl Failed to open module: /home/crobinso/src/qemu/x86_64-softmmu/../hw-display-qxl.so: undefined symbol: qemu_qxl_io_log_semaphore
That error breaks iotests 127:
--- /home/crobinso/src/qemu/tests/qemu-iotests/127.out 2020-07-15
04:00:10.589138586 -0400
+++ /home/crobinso/src/qemu/tests/qemu-iotests/127.out.bad 2020-07-16
16:44:37.717248172 -0400
@@ -1,4 +1,5 @@
QA output created by 127
+Failed to open module:/home/crobinso/src/qemu/x86_64-softmmu/../hw-display-qxl.so: undefined
symbol: qemu_qxl_io_log_semaphore
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=65536 Formatting 'TEST_DIR/t.IMGFMT.overlay0', fmt=IMGFMT size=65536
backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
Formatting 'TEST_DIR/t.IMGFMT.overlay1', fmt=IMGFMT size=65536
backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
Doing a build with every target and running 'make check' will show undefined symbol errors for other targets with hw-display-qxl too. Most reference the qxl_io_log call but some are like:
Failed to open module:/home/crobinso/src/qemu/microblaze-softmmu/../hw-display-qxl.so:
undefined symbol: vga_ioport_read
Also as a side note though I think it's pre-existing: running the test suite with --enable-modules while there are host installed modules is very noisy with lots of repetitive warnings like:
Failed to initialize module: /usr/lib64/qemu/audio-oss.so
Note: only modules from the same build can be loaded. Failed to initialize module: /usr/lib64/qemu/audio-pa.so
Note: only modules from the same build can be loaded. Failed to initialize module: /usr/lib64/qemu/audio-sdl.so
Note: only modules from the same build can be loaded. Failed to initialize module: /usr/lib64/qemu/ui-curses.so
Note: only modules from the same build can be loaded. Failed to initialize module: /usr/lib64/qemu/ui-gtk.so
Note: only modules from the same build can be loaded.
It would be nice if those could be avoided somehow. Maybe QEMU_MODULE_DIR can help?
Thanks,
Cole
Quoted 1 line · Cole Robinson
I'm trying to build qemu 5.1.0-rc0 in Fedora. I'm hitting some issues.
For anyone else reading this email thread, this was fixed in QEMU 5.1.0-rc1:
commit d97df4b84bc42613cf9a03619de453ebd0be30b7
Author: Gerd Hoffmann <[email protected]>
Date: Mon Jul 20 12:03:50 2020 +0200
qxl: fix modular builds with dtrace
Stefan
Quoted 12 lines · Stefan Hajnoczi
Quoted 1 line · Cole Robinson
I'm trying to build qemu 5.1.0-rc0 in Fedora. I'm hitting some issues.
For anyone else reading this email thread, this was fixed in QEMU 5.1.0-rc1:
commit
d97df4b84bc42613cf9a03619de453ebd0be30b7
Author: Gerd Hoffmann <[email protected]>
Date: Mon Jul 20 12:03:50 2020 +0200qxl: fix modular builds with dtrace
FWIW I'm still hitting issues with qemu-5.1.0 GA but maybe it's unrelated to that specific fix. Issues reproduce on fedora 33+, not fedora 32.
Here's a build log for 5.1.0 GA on Fedora 33 x86_64:
https://kojipkgs.fedoraproject.org//work/tasks/6937/49136937/build.log
grep for 'undefined symbol' and you'll see qemu-iotest failures, for example:
--- /builddir/build/BUILD/qemu-5.1.0-rc3/tests/qemu-iotests/127.out
2020-08-05 16:41:09.000000000 +0000 +++ /builddir/build/BUILD/qemu-5.1.0-rc3/build-dynamic/tests/qemu-iotests/127.out.bad 2020-08-11 19:50:39.245897057 +0000
@@ -1,4 +1,5 @@
QA output created by 127
+Failed to open module:
/builddir/build/BUILD/qemu-5.1.0-rc3/build-dynamic/x86_64-softmmu/../hw-display-qxl.so:
undefined symbol: qemu_qxl_client_monitors_config_crc_semaphore
On s390x where spice+qxl aren't compiled, we see different symbol errors in the logs here:
https://kojipkgs.fedoraproject.org//work/tasks/6091/49136091/build.log
--- /builddir/build/BUILD/qemu-5.1.0/tests/qemu-iotests/127.out
2020-08-11 19:17:15.000000000 +0000 +++ /builddir/build/BUILD/qemu-5.1.0/build-dynamic/tests/qemu-iotests/127.out.bad 2020-08-12 12:16:20.472179636 +0000
@@ -1,4 +1,5 @@
QA output created by 127
+Failed to open module:
/builddir/build/BUILD/qemu-5.1.0/build-dynamic/s390x-softmmu/../hw-usb-smartcard.so:
undefined symbol: ccid_card_send_apdu_to_guest
So maybe there's a more general problem. FWIW Fedora 33 started using LTO by default, but it was disabled for the qemu package.
- Cole
Hi,
Quoted 8 lines
FWIW I'm still hitting issues with qemu-5.1.0 GA but maybe it's unrelated to that specific fix. Issues reproduce on fedora 33+, not fedora 32.
+Failed to open module:
/builddir/build/BUILD/qemu-5.1.0-rc3/build-dynamic/x86_64-softmmu/../hw-display-qxl.so:
undefined symbol:qemu_qxl_client_monitors_config_crc_semaphore
Quoted 5 lines
/builddir/build/BUILD/qemu-5.1.0/build-dynamic/s390x-softmmu/../hw-usb-smartcard.so:
undefined symbol:ccid_card_send_apdu_to_guestSo maybe there's a more general problem. FWIW Fedora 33 started using LTO by default, but it was disabled for the qemu package.
Hmm, the first looks like a problem. I'm wondering why it happens on f33 only, not f32. LTO could explain that (optimizing away symbols used by modules but not main qemu), but with that already turned off I have no clue offhand.
The second is sort-of expected, this comes from s390x not supporting usb. I have a pending patch to silence those warnings when qemu tries to load all available modules (for introspection, to make sure the qom object list is complete).
take care,
Gerd
Quoted 13 lines · Gerd Hoffmann
Hi,
Quoted 10 lines
FWIW I'm still hitting issues with qemu-5.1.0 GA but maybe it's unrelated to that specific fix. Issues reproduce on fedora 33+, not fedora 32.
+Failed to open module:
/builddir/build/BUILD/qemu-5.1.0-rc3/build-dynamic/x86_64-softmmu/../hw-display-qxl.so:
undefined symbol:qemu_qxl_client_monitors_config_crc_semaphore/builddir/build/BUILD/qemu-5.1.0/build-dynamic/s390x-softmmu/../hw-usb-smartcard.so:
undefined symbol:ccid_card_send_apdu_to_guest
Quoted 8 lines
Quoted 2 lines
So maybe there's a more general problem. FWIW Fedora 33 started using LTO by default, but it was disabled for the qemu package.
Hmm, the first looks like a problem. I'm wondering why it happens on f33 only, not f32. LTO could explain that (optimizing away symbols used by modules but not main qemu), but with that already turned off I have no clue offhand.
I stripped down the reproducer. Dropping --enable-trace-backend=dtrace makes things work AFAICT. This is on f33
dnf builddep -y qemu # to get all the fedora package build deps cd qemu.git
git checkout v5.1.0
./configure --target-list=x86_64-softmmu --disable-werror --enable-modules --enable-trace-backend=dtrace
make
./x86_64-softmmu/qemu-system-x86_64 -vga qxl
# ./x86_64-softmmu/qemu-system-x86_64 -vga qxl Failed to open module: /root/qemu.git/x86_64-softmmu/../ui-gtk.so: undefined symbol: qemu_xkeymap_keymap_semaphore Failed to open module: /root/qemu.git/x86_64-softmmu/../ui-sdl.so: undefined symbol: qemu_sdl2_process_key_semaphore Failed to open module: /root/qemu.git/x86_64-softmmu/../hw-display-qxl.so: undefined symbol: qemu_qxl_render_blit_semaphore qemu-system-x86_64: QXL VGA not available
So nothing specific to qxl, seems all modules are busted.
I tried downgrading gcc to f32 versions, no difference. Same after downgrading binutils. Downgrading glibc downgrades the whole distro so I didn't attempt it
Output of this looks similar on f33 and f32:
nm {hw-display-qxl.so,x86_64-softmmu/qemu-system-x86_64} | grep qemu_qxl_spice_destroy_surfaces_complete_semaphore
Any suggestions?
Thanks,
Cole
Hi,
Quoted 6 lines
So nothing specific to qxl, seems all modules are busted.
I tried downgrading gcc to f32 versions, no difference. Same after downgrading binutils. Downgrading glibc downgrades the whole distro so I didn't attempt itAny suggestions?
Try downgrade rpm macros?
take care,
Gerd
Quoted 11 lines · Cole Robinson
Quoted 10 lines · Stefan Hajnoczi
Quoted 1 line · Cole Robinson
I'm trying to build qemu 5.1.0-rc0 in Fedora. I'm hitting some issues.
For anyone else reading this email thread, this was fixed in QEMU 5.1.0-rc1:
commit
d97df4b84bc42613cf9a03619de453ebd0be30b7
Author: Gerd Hoffmann <[email protected]>
Date: Mon Jul 20 12:03:50 2020 +0200
Quoted 6 lines
Quoted 2 lines
qxl: fix modular builds with dtrace
FWIW I'm still hitting issues with qemu-5.1.0 GA but maybe it's unrelated to that specific fix. Issues reproduce on fedora 33+, not fedora 32.
Gerd's fix here was to remove the reference to the conditional trace_event_get_state_backends() checks.
This avoids referencing the systemtap semaphore symbol.
This works..... with systemtap 4.3 or earlier.
In systemtap 4.4 they attempted to support LTO, by changing the _SDT_PROBE macro so that it *always* references the semaphore symbol as a hint for LTO.
This broke QEMU again.
While this is obviously a regression in behaviour in systemtap, I think its possible to argue that QEMU's use of probes is itself broken.
We have tracepoints in the qxl.so module, but the probes are all linked into the qemu-system-x86_64 binary, and not exported for use by the modules. AFAICT, we've merely been lucky not to hit this previously, as none of the modules we had upto now used trace_event_get_state_backends() checks. Any such use would always have been broken with all systemtap versions.
IOW, new systemtap 4.4 is exposing a long standing design flaw in QEMU's probe.
I'm gong to ask the systemtap maintainers for an opinion on this behaviour change none the less.
If systemtap won't change, then to fix this, for any foo.c that will be in a module, we need a separate 'foo.trace' file that generates a .o that is directly linked to the foo.so, not the qemu-system-x86_64 binary.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 5 lines · Daniel P. Berrangé
IOW, new systemtap 4.4 is exposing a long standing design flaw in QEMU's probe.
I'm gong to ask the systemtap maintainers for an opinion on this behaviour change none the less.
Reported to systemtap maintainers here:
https://bugzilla.redhat.com/show_bug.cgi?id=1869642
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Hi,
Quoted 4 lines
If systemtap won't change, then to fix this, for any
foo.cthat will be in a module, we need a separate 'foo.trace' file that generates a .o that is directly linked to the foo.so, not the qemu-system-x86_64 binary.
I think that is the plan anyway.
take care,
Gerd
Quoted 8 lines · Gerd Hoffmann
Hi,
Quoted 4 lines
If systemtap won't change, then to fix this, for any
foo.cthat will be in a module, we need a separate 'foo.trace' file that generates a .o that is directly linked to the foo.so, not the qemu-system-x86_64 binary.I think that is the plan anyway.
It looks like we have no choice. The systemtap maintainers don't want to change to make the semaphore symbols in the binary visible to modules.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|