Bug 2087786
| Summary: | @ALSA_0.9 symbols from pcm_old.h public header get resolved to 1.0 version causing crashes | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Hans de Goede <hdegoede> |
| Component: | alsa-lib | Assignee: | Jaroslav Kysela <jkysela> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 36 | CC: | andre.maute, jkysela |
| 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: | 2022-05-18 14:02:49 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
Hans de Goede
2022-05-18 13:56:27 UTC
> So something is going wrong with the symbol versioning, either on the alsa-lib side, or for some reason timidity is not honoring the asm .symver statement in pcm_old.h .
So this made me realize that pcm_old.h has the:
asm(".symver snd_pcm_hw_params_set_rate_near,snd_pcm_hw_params_set_rate_near");
Before the:
unsigned int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir);
Prototype and I just realized that with link time optimization (LTO) enabled all .c files essentially become 1 big file, so what if another .c file in timidity does:
#include <alsa/asoundlib.h>
Without doing:
#define ALSA_PCM_OLD_HW_PARAMS_API
#define ALSA_PCM_OLD_SW_PARAMS_API
First, then the (wrong) prototype shows up first without being prefixed by the asm .symver and maybe that is causing timidity to get the wrong version of the function.
So I've tried adding:
%global _lto_cflags %nil
To timidity++.spec and that indeed fixes things.
Sorry for the noise, but hopefully this will be helpful to explain some other similar bugs... ?
Yep, LTO is always a problem. Just for the record: It's easy to verify the referenced symbol: # objdump -t /usr/bin/timidity | grep set_rate_near 0000000000000000 F *UND* 0000000000000000 snd_pcm_hw_params_set_rate_near.0rc4 Note I've filed a gcc bug, where the symbol-ver vs LTO issues are being discussed in more detail, see bug 2087904. It looks like this may be an alsa-lib issue after all, requiring some changes to the pcm_old.h alsa-lib header, but this is still being discussed. |