glib problem with glibc 2.1 ?
Hi,
I wonder if I've done something wrong, but I'm not able to make work
a simple program like this one :-)
#include <stdio.h>
#include <glib.h>
int main (int argc, char *argv[], char *env[])
{
g_print ("Hello world !\n");
exit(0);
}
$ gcc -Wall -o test test.c -lglib -I/usr/lib/glib/include
$ ./test
Erreur de segmentation (core dumped)
$ strace ./test
execve("./test", ["./test"], [/* 29 vars */]) = 0
brk(0) = 0x80496ec
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=0, ...}) = 0
mmap(0, 19767, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40014000
close(3) = 0
open("/usr/lib/libglib-1.2.so.0", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=0, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40019000
mmap(0, 137004, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4001a000
mprotect(0x4003a000, 5932, PROT_NONE) = 0
mmap(0x4003a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x1f000) = 0x4003a000
close(3) = 0
open("/lib/libc.so.6", O_RDONLY) = 3
fstat(3, {st_mode=0, st_size=0, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 978616, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4003c000
mprotect(0x40123000, 32440, PROT_NONE) = 0
mmap(0x40123000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xe6000) = 0x40123000
mmap(0x40128000, 11960, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40128000
close(3) = 0
munmap(0x40014000, 19767) = 0
personality(PER_LINUX) = 0
getpid() = 5347
brk(0) = 0x80496ec
brk(0x8049714) = 0x8049714
brk(0x804a000) = 0x804a000
--- SIGSEGV (Erreur de segmentation) ---
+++ killed by SIGSEGV +++
I'm pretty sure it did work before the installation of glibc 2.1 but I may
be wrong and the problem may come from me or from somewhere else... :-)
Any idea ?
FYI :
/rack/perso/travaux/gt/src@k6$ ldd ./test
libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x4001a000)
libc.so.6 => /lib/libc.so.6 (0x4003c000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
/rack/perso/travaux/gt/src@k6$ dpkg -l *glib* | grep ^ii
ii libglib1.1 1.1.3-2 The GLib library of C routines
ii libglib1.1.12 1.1.12-1 Developers' release of the GLib library of C
ii libglib1.1.13 1.1.15-1 Developers' release of the GLib library of C
ii libglib1.1.16 1.1.16-1 Developers' release of the GLib library of C
ii libglib1.1.9 1.1.9-1 Developers' release of the GLib library of C
ii libglib1.2 1.2.0-1 The GLib library of C routines
ii libglib1.2-dev 1.2.0-1 Development files for GLib library
ii libstdc++2.9-gl 2.91.63-1.1 The GNU stdc++ library (egcs version)
ii libstdc++2.9-gl 2.91.63-1.1 The GNU stdc++ library (development files)
Cheers,
--
Raphaël Hertzog >> 0C4CABF1 >> http://prope.insa-lyon.fr/~rhertzog/
Reply to: