[Openal] Null Pointer crash in Linux openal
Sven Panne
sven.panne at aedion.de
Tue Oct 31 06:14:15 PST 2006
Am Dienstag, 31. Oktober 2006 12:21 schrieb Ludwig Nussel:
> Sven Panne wrote:
> > One minor point: The default dynamic OpenAL library ioquake3 tries to
> > load is "libopenal.so.0", but the trunk has a major version of 1
> > nowadays. For ioquake3's purposes these are compatible, and in general I
> > propose to drop the major version number from the filename when
> > dlopening OpenAL.
>
> No, that would be wrong. You always use the SONAME exactly because
> an SONAME change means the library changed in an incompatible way.
That's only a very limited view of library versioning, and in general the
usual major/minor versioning scheme is far too primitive to get things right.
In the case of dlopening a dynamic library (which is the case here), there is
no real point in specifying a given version, because dlsym is manually used
to look for needed API entries, anyway (hopefully with error checks). The
only time when the actual library version would be interesting in this
scenario would be the case when API entries have semantically changed or have
a different signature. But this should *never* happen for a given API and
should be avoided like hell, as this will definitely lead to problems later.
One prominent example which comes to my mind here is ALSA, which did exactly
this, but I think this was a very bad decision. There is fancy stuff like
versioned symbols etc., but they are not portable and have quite a few
problems of their own. Just invent new API entry names and let the old
incompatible ones die in peace...
In our case an SONAME of 0 or 1 is OK, because the OpenAL API differences are
irrelevant for ioquake3.
> The libopenal.so link is only used by the linker at compile time.
> Therefore it's not availabe on a typical non-development
> installation.
OK, that's a good reason to use the major version when dlopening. Forcing
people to install *-devel packages just to frag their enemies is not nice.
Sometimes I simply forget that there are non-developer boxes out there. ;-)
> > I know that the exact name can be changed via a
> > configuration file, but running out-of-the-box with a recent OpenAL
> > version would be nice.
>
> In this specific case ioquake3 can try libopenal.so.1 and fall back
> to libopenal.so.0. Bad luck for versions that do not dlopen
> libopenal but link directly, they will only work with one version of
> openal.
Given the fact above, this looks like the best solution.
One related question: Will openSUSE 10.2 ship the "split" OpenAL/ALUT or will
it still use the ancient OpenAL version including parts of ALUT? Currently I
don't have enough time to track this.
Cheers,
S.
More information about the Openal
mailing list