[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#530377: libarts1c2a: Error with 32-bit binaries on x86-64 arch



Package: libarts1c2a
Version: 1.5.9-3
Severity: normal
Tags: patch

On x86-64 architecture, the script /usr/bin/artsdsp tries
to preload some libraries in /usr/lib when the executable is
32-bit. The problem lies when /usr/lib contains 64-bit libraries
(which is the case most of the time with x86-64 architecture).
I suggest to add a check for the 32-bit case, along the lines of
the attached patch.

The patch should not introduce regressions: if binary is 32-bit
and /usr/lib/libarsdsp.so.0 is 64-bit then it won't load. In that
case, the fact that /usr/lib32 exists or not is not really relevant.
The only case in which the patched script could fail while the
original would not is (I think) the following:

* 32-bit executable
* single_thread is 1
* /usr/lib/libartsdsp.so.0 is 64-bit
* /usr/lib/libartsdsp_st.so.0 is 32-bit

Since the last two lines are rather silly, I think it is not
relevant (otherwise I can patch the script further, but it will
look even worse).

The test can probably made better. In particular awk is probably
overkill (cut -f3 -d\  is another solution, other exist,
including using set `file -L ...` as above).

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (50, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29.3 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libarts1c2a depends on:
ii  libartsc0                   1.5.9-3      aRts sound system C support librar
ii  libasound2                  1.0.19-1     shared library for ALSA applicatio
ii  libaudio2                   1.9.1-5      Network Audio System - shared libr
ii  libaudiofile0               0.2.6-7      Open-source version of SGI's audio
ii  libc6                       2.9-4        GNU C Library: Shared libraries
ii  libesd0                     0.2.41-3     Enlightened Sound Daemon - Shared 
ii  libgcc1                     1:4.4.0-5    GCC support library
ii  libglib2.0-0                2.20.0-2     The GLib library of C routines
ii  libjack0                    0.116.1-4    JACK Audio Connection Kit (librari
ii  libmad0                     0.15.1b-4    MPEG audio decoder library
ii  libqt3-mt                   3:3.3.8b-5   Qt GUI Library (Threaded runtime v
ii  libstdc++6                  4.4.0-5      The GNU Standard C++ Library v3
ii  libvorbis0a                 1.2.0.dfsg-4 The Vorbis General Audio Compressi
ii  libvorbisfile3              1.2.0.dfsg-4 The Vorbis General Audio Compressi
ii  libx11-6                    2:1.2.1-1    X11 client-side library
ii  oss-compat                  0.0.4+nmu3   OSS compatibility package

libarts1c2a recommends no packages.

libarts1c2a suggests no packages.

-- no debconf information
--- artsdsp.orig	2009-05-03 16:16:14.000000000 +0200
+++ artsdsp	2009-05-24 15:48:14.000000000 +0200
@@ -96,6 +96,9 @@
 
 set `file -L $binary`
 
+prefix=/usr
+exec_prefix=${prefix}
+
 case $2 in
     ELF)
        ;;
@@ -106,7 +109,11 @@
 
 case $3 in
     32-bit)
-       arch_libdir=lib
+       if [ "`file -L ${exec_prefix}/lib/libartsdsp.so.0 | awk '{ print($3) }'`" = 64-bit ]; then
+	   arch_libdir=lib32
+       else
+	   arch_libdir=lib
+       fi
        ;;
     64-bit)
        arch_libdir=lib64
@@ -117,8 +124,6 @@
 
 set $origargs
 
-prefix=/usr
-exec_prefix=${prefix}
 libdir=${prefix}/${arch_libdir}
 
 if test "$single_thread" = 1; then

Reply to: