Bug#626379: libc6: Static binaries fail with __getpagesize: Assertion `_rtld_global_ro._dl_pagesize != 0'
Package: libc6
Version: 2.13-2
Severity: normal
Tags: sid
Hi,
static binaries that trigger loading of shared objects (libnss) fail
with the following assertion.
/tmp> cat a.c
#include <pty.h>
#include <stdlib.h>
int main()
{
int a, b;
openpty(&a, &b, 0, 0, 0);
return (int)malloc(123);
}
/tmp> gcc -static a.c -lutil
/tmp> ./a.out
a.out: ../sysdeps/unix/sysv/linux/getpagesize.c:32: __getpagesize: Assertion `_rtld_global_ro._dl_pagesize != 0' failed.
/tmp>
Other example:
/tmp> cat b.c
#include <pwd.h>
int main()
{
getpwnam("root");
return 0;
}
/tmp> gcc -static b.c
/tmp/ccZB6Ooy.o: In function `main':
b.c:(.text+0x11): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp> ./a.out
a.out: ../sysdeps/unix/sysv/linux/getpagesize.c:32: __getpagesize: Assertion `_rtld_global_ro._dl_pagesize != 0' failed.
/tmp>
Thanks,
Adam
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.38.2 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages libc6 depends on:
ii libc-bin 2.13-2 Embedded GNU C Library: Binaries
ii libgcc1 1:4.6.0-7 GCC support library
Versions of packages libc6 recommends:
ii libc6-i686 2.13-2 Embedded GNU C Library: Shared lib
Versions of packages libc6 suggests:
ii debconf [debconf-2.0] 1.5.39 Debian configuration management sy
ii glibc-doc 2.13-2 Embedded GNU C Library: Documentat
ii locales 2.13-2 Embedded GNU C Library: National L
-- debconf information excluded
Reply to: