From: Takashi Iwai <tiwai@suse.de>
To: Jaroslav Kysela <perex@perex.cz>
Cc: ALSA development <alsa-devel@alsa-project.org>,
Takashi Sakamoto <o-takashi@sakamocchi.jp>
Subject: Re: ["PATCH alsa-lib"] Change snd_dlopen() function to return the error string
Date: Mon, 27 Nov 2017 22:24:28 +0100 [thread overview]
Message-ID: <s5hwp2bl8j7.wl-tiwai@suse.de> (raw)
In-Reply-To: <00263979-4138-4e63-62a0-c5683a352102@perex.cz>
On Mon, 27 Nov 2017 21:49:06 +0100,
Jaroslav Kysela wrote:
>
> Dne 27.11.2017 v 21:24 Takashi Iwai napsal(a):
> > On Mon, 27 Nov 2017 19:19:51 +0100,
> > Takashi Sakamoto wrote:
> >>
> >> Hi Jaroslav,
> >>
> >> On Nov 27 2017 17:50, Jaroslav Kysela wrote:
> >>> The dlopen() function might fail also for another reason than
> >>> a missing file, thus return the error string from dlerror().
> >>>
> >>> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
> >>> ---
> >>> include/global.h | 2 +-
> >>> src/Versions.in | 5 +++++
> >>> src/conf.c | 13 ++++++-----
> >>> src/dlmisc.c | 60 +++++++++++++++++++++++++++++++++++++++----------
> >>> src/hwdep/hwdep.c | 6 ++---
> >>> src/mixer/simple_abst.c | 10 ++++-----
> >>> src/pcm/pcm_hooks.c | 8 +++----
> >>> src/pcm/pcm_meter.c | 6 ++---
> >>> src/rawmidi/rawmidi.c | 6 ++---
> >>> src/seq/seq.c | 6 ++---
> >>> src/timer/timer.c | 6 ++---
> >>> src/timer/timer_query.c | 6 ++---
> >>> 12 files changed, 88 insertions(+), 46 deletions(-)
> >>
> >> Unfortunately, this patch brings build error in my environment (Ubuntu
> >> 17.10 amd64, gcc7.2.0 from gcc-7 7.2.0-8ubuntu3).
> >>
> >> $ ./gitcompile
> >> $ make
> >> make[2]: Entering directory '/tmp/alsa-lib/src'
> >> CCLD libasound.la
> >> /usr/bin/ld: unable to find version dependency `ALSA_1.1.6'
> >> pcm/.libs/libpcm.a(pcm_generic.o): In function `snd1_pcm_generic_hwsync':
> >> /tmp/alsa-lib/src/pcm/pcm_generic.c:142: warning:
> >> collect2: error: ld returned 1 exit status
> >> Makefile:491: recipe for target 'libasound.la' failed
> >> make[2]: *** [libasound.la] Error 1
> >>
> >> At present, I don't know exactly the reason, but I'll start
> >> investigating it in next morning (I'd like to have sleep...).
> >
> > It's likely a bogus definition in version symbols.
> > It has to be a form like:
> >
> > ALSA_1.1.6 {
> > global:
> > @SYMBOL_PREFIX@snd_dlopen;
> > } ALSA_1.1.5;
> >
> > while the patch put "ALSA_1.1.6" to both places.
>
> Yes, I forgot to modify src/Versions.in (I modified only src/Versions
> for my local build).
>
> > Besides that, I'm scared by the versioned symbols, of which I have
> > only a bad memory.
>
> I know, but the major issue that we forgot to apply old symbol versions
> to some functions in the past, right ? I don't see any drawback.
IIRC, some apps didn't compile the stuff properly with the versioned
symbols, thus fall back to bind with the old symbols without error,
which leads to a crash at runtime.
Another case is when an app or a library does symbol resolution by
itself via dlopen and dlsym. libao does it, for example.
The snd_dlopen() isn't supposed to be used widely in external apps, so
maybe the influence is limited. But I still feel bad with the usage
of versioned symbols unless really needed. In this case, we can avoid
the issue just by adding another better function. And, the purpose is
only for a better debuggability, so the change in caller side isn't
mandatory.
thanks,
Takashi
next prev parent reply other threads:[~2017-11-27 21:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-27 8:50 ["PATCH alsa-lib"] Change snd_dlopen() function to return the error string Jaroslav Kysela
2017-11-27 18:19 ` Takashi Sakamoto
2017-11-27 20:24 ` Takashi Iwai
2017-11-27 20:49 ` Jaroslav Kysela
2017-11-27 21:24 ` Takashi Iwai [this message]
2017-11-28 7:26 ` Jaroslav Kysela
2017-11-28 8:02 ` Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hwp2bl8j7.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=o-takashi@sakamocchi.jp \
--cc=perex@perex.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.