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

Bug#826906: uid-wrapper: FTBFS[!linux]: only supports libc.so.[0-9] filename



Package: uid-wrapper
Version: 1.2.0+dfsg1-1
Severity: normal
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: kfreebsd

Hi,

uid-wrapper FTBFS on kfreebsd because of segfaults running every test:

| Program terminated with signal 11, Segmentation fault.
| #0  0x00000008006156e1 in _dl_close () from /lib/ld-kfreebsd-x86-64.so.1
| #1  0x000000080060f7d4 in _dl_catch_error () from /lib/ld-kfreebsd-x86-64.so.1
| #2  0x0000000800f99511 in _dlerror_run () from /lib/x86_64-kfreebsd-gnu/libdl.so.2
| #3  0x0000000800f98fef in dlclose () from /lib/x86_64-kfreebsd-gnu/libdl.so.2
| #4  0x0000000800825281 in uwrap_destructor () at
| /home/steven/uid-wrapper-1.2.0+dfsg1/src/uid_wrapper.c:2133
|         u = <optimized out>
| #5  0x000000080060ff17 in _dl_fini () from /lib/ld-kfreebsd-x86-64.so.1
| #6  0x0000000800c69a78 in __run_exit_handlers () from /lib/x86_64-kfreebsd-gnu/libc.so.0.1
| #7  0x0000000800c69ac5 in exit () from /lib/x86_64-kfreebsd-gnu/libc.so.0.1
| #8  0x0000000800c551a7 in __libc_start_main () from /lib/x86_64-kfreebsd-gnu/libc.so.0.1
| #9  0x0000000000400847 in _start ()
https://buildd.debian.org/status/fetch.php?pkg=uid-wrapper&arch=kfreebsd-amd64&ver=1.2.0%2Bdfsg1-1&stamp=1449681825

I found this happens because src/uid_wrapper.c doesn't detect the libc's
filename.  It matches libc.so.[0-9] whereas on kfreebsd it is named
libc.so.0.1 currently.

The same problem will affect hurd too, which has libc.so.0.3 (although
there are other reasons for FTBFS on hurd).

Please consider the attached patch to detect libc.so.0.[0-9] as well.
Unless there is some neater way to do this.  Thanks a lot!

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 10.1-0-amd64
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Date: Fri, 10 Jun 2016 02:06:45 +0100
From: Steven Chamberlain <steven@pyro.eu.org>
Subject: support libc soname 0.x

On some glibc-based platforms, the libc soname is not an integer, such
as 0.1 on kfreebsd and 0.3 on hurd.

--- a/src/uid_wrapper.c
+++ b/src/uid_wrapper.c
@@ -407,6 +407,11 @@
 				if (handle != NULL) {
 					break;
 				}
+				snprintf(soname, sizeof(soname), "libc.so.0.%d", i);
+				handle = dlopen(soname, flags);
+				if (handle != NULL) {
+					break;
+				}
 			}
 
 			uwrap.libc.handle = handle;

Reply to: