Bug 1869642
Summary: | Probes always reference the semaphore even if caller doesn't use it, breaking QEMU modules. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Daniel Berrangé <berrange> |
Component: | systemtap | Assignee: | Frank Ch. Eigler <fche> |
Status: | CLOSED CANTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 33 | CC: | amerey, brolley, crobinso, dsmith, fche, lberk, mjw, scox, serhei, wcohen |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-11-17 19:48:47 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Daniel Berrangé
2020-08-18 12:30:43 UTC
For reference, our original QEMU bug report was https://bugzilla.redhat.com/show_bug.cgi?id=1869216 Each semaphore variable definition has a hidden attribute. According to https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Function-Attributes.html that allows different objects in the same shared object to be linked together, but not be visible outside the shared object. The way that the reproducer (and Qemu) is linking the trace.o outside the shared object looks like it violates that. The probe infrastructure is trying to keep those things hidden, so don't want to make them globally visible. I verified that moving the trace.o linking to the shared mod.so generation the reproducer works. However, I am not sure if everything is going to work if the same trace.o is linked into multiple shared libraries. Can you please confirm that the 4.4-1 build in -testing or -stable corrects this for you? I don't see any difference in behaviour from the demo program above with 4.4-1 I just tried to reproducer on x86_64 fc33 with systemtap-4.4-1 rpms installed. The one from koji built Mon 09 Nov 2020 10:29:24 PM EST. It ran without the "dlopen(mod.so): ./mod.so: undefined symbol: main_mod_event_semaphore" error: $ ./main Hello world In mod Out mod Goodbye Comparing the old copies of mod.so which had the problem and the mod.so generated by the current systemtap-4.4-1 func the current (working one) doesn't have a reference to main_mod_event_semaphore reference in func. Does the mod.so generated on your machine still have that reference in the "objdump -dl mod.so"? Could you provide more details about the environment? -Will Yeah, the objdump output still shows the semaphore reference. What was the commit in systemtap upstream that's supposed to fix it ? I dont't see any updates in systemtap.git upstream for include/sys/sdt.h since the original commit that introduced the problem (82b8e1a07a31bf37ed05d6ebc5162b054c0be9fd) and the generated trace.h seems unchanged too. I'm on a F33 host with following present binutils-2.35-14.fc33.x86_64 gcc-10.2.1-6.fc33.x86_64 systemtap-4.4-1.fc33.x86_64 systemtap-client-4.4-1.fc33.x86_64 systemtap-devel-4.4-1.fc33.x86_64 systemtap-runtime-4.4-1.fc33.x86_64 systemtap-sdt-devel-4.4-1.fc33.x86_64 Okay, found that the reason things were suceeding on the one f33 machine was due to sdt.h and sdt-config.h in /usr/local/include/sys/ being used. As mentioned in comment #2 QEMU is violating the visibility rules by linking in the .o with the actual semaphore variables outside of the shared library. This isn't fixable in systemtap. QEMU needs to change how it is doing the linking so that the semaphore variables are in the shared libraries. |