dante-server using the wrong libc.so

Bug #816153 reported by Alejandro Mery on 2011-07-25
162
This bug affects 39 people
Affects Status Importance Assigned to Milestone
dante (Ubuntu)
Undecided
Louis Bouchard
Precise
Medium
Louis Bouchard

Bug Description

SRU justification :

Without this correction, the danted daemon fails to start

Impact :
Without a manual workaround, danted is unusable

Fix :

Correct the search logic to find & use the proper library path

Test Case :

- Install dante-server
- Configure /etc/danted.conf
- start danted with
$ invoke-rc.d danted start

Regression :

Should be minimal as only one more search path is added to the lookup

Original description of the problem :

in natty/amd_64 /etc/init.d/danted start ends with a
Failed to open "libc.so": /usr/lib/x86_64-linux-gnu/libc.so: invalid ELF header

The file is plain text, not ELF
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily. */
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libc_nonshared.a AS_NEEDED ( /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 ) )

and so danted dies.

work around is:
sudo ln -sf /lib/x86_64-linux-gnu/libc-2.13.so /usr/lib/x86_64-linux-gnu/libc.so

$ uname -a
Linux LTSP 2.6.38-10-generic #46-Ubuntu SMP Tue Jun 28 15:07:17 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04

$ apt-cache policy dante-server
dante-server:
  Instalados: 1.1.19.dfsg-3ubuntu4.1
  Candidato: 1.1.19.dfsg-3ubuntu4.1
  Tabla de versión:
 *** 1.1.19.dfsg-3ubuntu4.1 0
        500 http://cl.archive.ubuntu.com/ubuntu/ natty-updates/universe amd64 Packages
        100 /var/lib/dpkg/status
     1.1.19.dfsg-3ubuntu4 0
        500 http://cl.archive.ubuntu.com/ubuntu/ natty/universe amd64 Packages

Changed in dante (Ubuntu):
status: New → Confirmed
Emmanuel Tychon (etychon) wrote :

As reported by Alejandro, this works as a workaround:

sudo rm /usr/lib/x86_64-linux-gnu/libc.so
sudo ln -sf /lib/x86_64-linux-gnu/libc-2.13.so /usr/lib/x86_64-linux-gnu/libc.so

$ uname -a
Linux squeezepro 2.6.38-10-server #46-Ubuntu SMP Tue Jun 28 16:31:00 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04

$ apt-cache policy dante-server
dante-server:
  Installed: 1.1.19.dfsg-3ubuntu4.1
  Candidate: 1.1.19.dfsg-3ubuntu4.1
  Version table:
 *** 1.1.19.dfsg-3ubuntu4.1 0
        500 http://be.archive.ubuntu.com/ubuntu/ natty-updates/universe amd64 Packages
        100 /var/lib/dpkg/status
     1.1.19.dfsg-3ubuntu4 0
        500 http://be.archive.ubuntu.com/ubuntu/ natty/universe amd64 Packages

Guillaume Perréal (gperreal) wrote :

Also happens in oneiric x86. However I suppose an issue in libc6-dev (to which libc.so belongs) :

$ uname -a
Linux darnassus 3.0.0-13-generic-pae #21-Ubuntu SMP Mon Oct 17 20:36:56 UTC 2011 i686 i686 i386 GNU/Linux

$ lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

$ locate libc.so
/lib/i386-linux-gnu/libc.so.6
/usr/lib/i386-linux-gnu/libc.so

$ dpkg -S "/usr/lib/i386-linux-gnu/libc.so"
libc6-dev: /usr/lib/i386-linux-gnu/libc.so

$ apt-cache policy libc6-dev
libc6-dev:
  Installed: 2.13-20ubuntu5
  Candidate: 2.13-20ubuntu5
 Version table:
 *** 2.13-20ubuntu5 0
        500 http://ubuntu-archive.mirrors.proxad.net/ubuntu/ oneiric/main i386 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy dante-server
dante-server:
  Installed: 1.1.19.dfsg-3ubuntu5
  Candidate: 1.1.19.dfsg-3ubuntu5
 Version table:
 *** 1.1.19.dfsg-3ubuntu5 0
        500 http://ubuntu-archive.mirrors.proxad.net/ubuntu/ oneiric/universe i386 Packages
        100 /var/lib/dpkg/status

VladV (vlad-volkov) wrote :

The workarounds proposed here suggest to overwrite /usr/lib/i386-linux-gnu/libc.so proided by libc6-dev.
This might cause problems - specifically, building applications from source will fail.

A better solution is:
sudo ln -s /lib/i386-linux-gnu/libc.so.6 /lib/i386-linux-gnu/libc.so

It fixes issues with danted, but leaves libc-dev files intact.

Rorzik (rorzik) wrote :

It should also be noted that the package fails to install because of this same bug. Following is the result of "apt-get install dante-server" on 64-bit oneiric, trying to install dante-server version "1.1.19.dfsg-3ubuntu5":

Feb 4 23:33:45 (1328427225) danted[21015]: socks_seteuid(): old: 0, new: 65534
Feb 4 23:33:45 (1328427225) danted[21015]: socks_reseteuid(): current: 65534, new: 0
Feb 4 23:33:45 (1328427225) danted[21015]: symbolfunction(): compiletime configuration error? Failed to open "libc.so": /usr/lib/x86_64-linux-gnu/libc.so: invalid ELF header
Feb 4 23:33:45 (1328427225) danted[21015]: sockdexit()
Feb 4 23:33:45 (1328427225) danted[21015]: sockdexit(): terminating
invoke-rc.d: initscript danted, action "start" failed.
dpkg: error processing dante-server (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 dante-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

I was able to resolve this with the 64-bit version of the work around mentioned above: "cd /lib/x86_64-linux-gnu; ln -s libc.so.6 libc.so", after which the apt-get install worked, and dante-server is running fine.

luca (llucax) wrote :

This is still happening in Ubuntu 12.10!

Confirmed still a bug in 12.10

Mar 8 08:40:15 (1362750015) danted[2240]: symbolfunction(): compiletime configuration error? Failed to open "libc.so": /usr/lib/x86_64-linux-gnu/libc.so: invalid ELF header
Mar 8 08:40:15 (1362750015) danted[2240]: sockdexit()
Mar 8 08:40:15 (1362750015) danted[2240]: sockdexit(): terminating

robert@robert-VirtualBox:/etc$ uname -a
Linux robert-VirtualBox 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
robert@robert-VirtualBox:/etc$ lsb_release -rd
Description: Ubuntu 12.10
Release: 12.10
robert@robert-VirtualBox:/etc$ locate libc.so
/lib/x86_64-linux-gnu/libc.so.6
/usr/lib/x86_64-linux-gnu/libc.so
robert@robert-VirtualBox:/etc$ apt-cache policy dante-server
dante-server:
  Installed: 1.1.19.dfsg-3ubuntu6
  Candidate: 1.1.19.dfsg-3ubuntu6
  Version table:
 *** 1.1.19.dfsg-3ubuntu6 0
        500 http://us.archive.ubuntu.com/ubuntu/ quantal/universe amd64 Packages
        100 /var/lib/dpkg/status
robert@robert-VirtualBox:/etc$

Eduardo Damato (edamato) wrote :

My understanding is that the problem is that a dlopen() is attempted against libc.so, which is a text file.

$ file /usr/lib/x86_64-linux-gnu/libc.so
/usr/lib/x86_64-linux-gnu/libc.so: ASCII English text

Changing it to libc.so.6 did fix the problem:

$ file /lib/x86_64-linux-gnu/libc.so.6
/lib/x86_64-linux-gnu/libc.so.6: symbolic link to `libc-2.15.so'

therefore I tried the following patch which seems to fix the issue:

--- dante-1.1.19.dfsg.orig/configure
+++ dante-1.1.19.dfsg/configure
@@ -29690,7 +29690,7 @@
   LIBC_NAME=`ls /usr/lib/libc.so* /lib/libc.so* | sed -e 's/.*\///' | sort -nr | head -n 1`
   if test "x${LIBC_NAME}" = x; then
    #nothing found, set libc.so anyway
- LIBC_NAME="${base_library_path}libc.so"
+ LIBC_NAME="${base_library_path}libc.so.6"
   fi
  ;;

Providing the debdiff for precise.

The attachment "debdiff.danted" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Changed in dante (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Medium
Martin Pitt (pitti) wrote :

Wouldn't it be better to find the real libc in the condition before?

        case $host in
                *-*-linux-*)
                #XXX attempt to find latest c library
                #can't set it to libc.so directly, might be ld script
                LIBC_NAME=`ls /usr/lib/libc.so* /lib/libc.so* | sed -e 's/.*\///' | sort -nr | head -n 1`

IMHO this should also look in /lib/*/libc.so.*. Also, this needs to be patched in configure.ac, not in configure. Can you please forward this upstream/Debian as well? Thank you!

Louis Bouchard (louis) on 2013-07-05
Changed in dante (Ubuntu):
assignee: nobody → Louis Bouchard (louis-bouchard)
Changed in dante (Ubuntu Precise):
assignee: nobody → Louis Bouchard (louis-bouchard)
Louis Bouchard (louis) on 2013-07-10
Changed in dante (Ubuntu Precise):
status: Triaged → In Progress
Louis Bouchard (louis) wrote :

debdiff for the Saucy fix

Louis Bouchard (louis) wrote :

debdiff for the Precise fix

Louis Bouchard (louis) wrote :

Please note that those debdiff contain correction for this other bug :

https://bugs.launchpad.net/ubuntu/+source/dante/+bug/857598

Changed in dante (Ubuntu):
status: Confirmed → In Progress
Louis Bouchard (louis) on 2013-07-12
description: updated
aanno (thomas-pasch) wrote :

This also affects raring (13.04):

ug 6 20:04:09 (1375819449) danted[2051]: socks_seteuid(): old: 0, new: 13
Aug 6 20:04:09 (1375819449) danted[2051]: socks_reseteuid(): current: 13, new: 0
Aug 6 20:04:09 (1375819449) danted[2051]: socks_seteuid(): old: 0, new: 65534
Aug 6 20:04:09 (1375819449) danted[2051]: socks_reseteuid(): current: 65534, new: 0
Aug 6 20:04:09 (1375819449) danted[2051]: socks_seteuid(): old: 0, new: 65534
Aug 6 20:04:09 (1375819449) danted[2051]: socks_reseteuid(): current: 65534, new: 0
Aug 6 20:04:09 (1375819449) danted[2051]: fixsettings(): no methods enabled (total block)
Aug 6 20:04:09 (1375819449) danted[2051]: symbolfunction(): compiletime configuration error? Failed to open "libc.so": libc.so: cannot open shared object file: No such file or directory

Marc Deslauriers (mdeslaur) wrote :

Thanks for the debdiffs!

Could you please fix a couple of small details:

1- The debian/changelog refers to the 03-configure.patch changes twice. Please remove one of them.
2- Please add the name of the 16-fix-dlopen.patch patch to the appropriate section in debian/changelog
3- The 16-fix-dlopen.patch patch contains the comment "#nothing found, set libc.so anyway", which is wrong. Please adjust.
4- On my system, LIBRARY_DLOPEN gives two results: /lib/i386-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so.2. Please fix so it only gets set to a single result. Actually, this probably needs to be fixed better. In a buildd, you most likely won't have multiarch packages, so it probably isn't an issue, but if you try to build on a system with multiarch packages, you may end up with the wrong library paths. Perhaps we should be using DEB_HOST_ARCH or something?

Louis Bouchard (louis) wrote :

updated debdiff with mdeslaur's comments applied

Louis Bouchard (louis) wrote :

updated debdiff with mdeslaur's comments applied

Marc Deslauriers (mdeslaur) wrote :

ACK on the debdiffs.

- I've uploaded the saucy package, with a slight whitespace change to the changelog.
- I've uploaded the precise package for processing by the SRU team, with a slight version and whitespace change in the changelog.

Thanks!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dante - 1.1.19.dfsg-3ubuntu9

---------------
dante (1.1.19.dfsg-3ubuntu9) saucy; urgency=low

  * debian/patches/03-configure.patch
    - Revert hardcoded libdl.so path
  * debian/patches/15-fixlibc-search.patch
    - Fix dante-server using the wrong libc.so (LP: #816153)
      by changing the search patch for the libc.so
  * debian/patches/16-fix-dlopen.patch
    - Fix socksify fails to run (LP: #857598)
      by adding search logic to locate the proper libdl.so
 -- Louis Bouchard <email address hidden> Wed, 12 Jul 2013 14:39:18 +0200

Changed in dante (Ubuntu):
status: In Progress → Fix Released
ADFH (adfh) wrote :

Thanks for finally getting a working fix folks! I grabbed packages from saucy repo and popped them into my now raring install and socksify works again!

Hello Alejandro, or anyone else affected,

Accepted dante into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/dante/1.1.19.dfsg-3ubuntu6.12.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in dante (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Louis Bouchard (louis) wrote :

package in -proposed tested with described reproduction steps. Now starts as expected

tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package dante - 1.1.19.dfsg-3ubuntu6.12.04.1

---------------
dante (1.1.19.dfsg-3ubuntu6.12.04.1) precise; urgency=low

  * debian/patches/03-configure.patch
    - Revert hardcoded libdl.so path
  * debian/patches/15-fixlibc-search.patch
    - Fix dante-server using the wrong libc.so (LP: #816153)
      by changing the search patch for the libc.so
  * debian/patches/16-fix-dlopen.patch
    - Fix socksify fails to run (LP: #857598)
      by adding search logic to locate the proper libdl.so
 -- Louis Bouchard <email address hidden> Wed, 12 Jul 2013 14:39:18 +0200

Changed in dante (Ubuntu Precise):
status: Fix Committed → Fix Released
Vin Shankar (v-shankar) wrote :

There seems to have been a regression in Raring. I'm experiencing the same problem, but with dante-server version 1.1.19.dfsg-3ubuntu8, when the fix was supposed to be applied back in Precise!

Vin Shankar (v-shankar) wrote :

Hmm. Possibly not exactly, but a manual symbolic link is still necessary. dante will now find /lib/x86_64-linux-gnu/libc.so if it exists... but no package contains such a file. It must be linked from /lib/x86_64-linux-gnu/libc.so.6 as provided by the package libc6.

DaveQB (david-dward) wrote :

Yes me too on Precise. I fixed it manually too.

Also the init script fails to restart. I patched that by simply making it call itself with a stop and then start argument.

Louis Bouchard (louis) wrote :

@david & Vin:

I have just checked and the updated package with the fix is indeed in the -updates archive :

# apt-cache policy dante-server
dante-server:
  Installed: 1.1.19.dfsg-3ubuntu6.12.04.1
  Candidate: 1.1.19.dfsg-3ubuntu6.12.04.1
  Version table:
 *** 1.1.19.dfsg-3ubuntu6.12.04.1 0
        500 http://fr.archive.ubuntu.com/ubuntu/ precise-updates/universe amd64 Packages
        100 /var/lib/dpkg/status
     1.1.19.dfsg-3ubuntu6 0
        500 http://fr.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages

There seems to be some side effect by the previously failing package that is causing the update not to install. I just tested the following that works correctly :

$ sudo apt-get -y remove dante-server && sudo apt-get -y install dante-server

This should install version 1.1.19.dfsg-3ubuntu6.12.04.1

DaveQB (david-dward) wrote :

It looks like I was using 1.1.19.dfsg-3ubuntu6 on my server (frozen local repo)
Tested on my laptop (1.1.19.dfsg-3ubuntu6.12.04.1) and danted started without complaining.

Thanks for the response and info @louis-bouchard

Hugo Duncan (6ugo) wrote :

I'm seeing this issue in raring, with 1.1.19.dfsg-3ubuntu8.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers