[Fwd: LIBC5 vs LIBC6. One first works, the second SEGFAULTS]

Barry Treahy (treahy@mmaz.com)
Wed, 21 Oct 1998 09:25:02 -0700


This is a multi-part message in MIME format.
--------------0C0FD6A563C208BE380D8C85
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I didn't receive any suggestions from the LINUX-ADMIN list, perhaps this
would be a better location for the problem below:

--------------0C0FD6A563C208BE380D8C85
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Message-ID: <362CBC2B.BA7E4151@mmaz.com>
Date: Tue, 20 Oct 1998 09:36:59 -0700
From: Barry Treahy <treahy@mmaz.com>
X-Mailer: Mozilla 4.04 [en] (WinNT; U)
MIME-Version: 1.0
To: Linux Admin List <linux-admin@vger.rutgers.edu>
Subject: LIBC5 vs LIBC6. One first works, the second SEGFAULTS
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I recently upgrading my libc to libc.so.5.4.46 and glib to 2.0.6, ld to
1.9.9, and gcc to 2.8.1 on my SW 3.4 with a 2.0.35 Kernel. I'm trying
to remake an app I have in development and I'm having problems since the
previously mentioned upgrade.

I've boiled it down to this, the following code segement with built
against libc5 works, when built against libc6, boom! The details
follow...

Here is the plain piece of code:

mml1:# cat aa.c
#line 619 "configure"
#include "confdefs.h"
main(){return(0);}

A vanilla compile, run, and strace:

mml1:/u2/ftp.roxen.com/roxen_1.2.36/extern# gcc -g aa.c -o aa
mml1:/u2/ftp.roxen.com/roxen_1.2.36/extern# file aa
aa: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically
linked, not stripped
mml1:/u2/ftp.roxen.com/roxen_1.2.36/extern# ./aa
mml1:/u2/ftp.roxen.com/roxen_1.2.36/extern# strace ./aa
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|0x20, 4294967295, 0) =
0x40007000
mprotect(0x40000000, 21025, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mprotect(0x8048000, 4412, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
stat("", {st_mode=S_IFREG|0644, st_size=4715, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
mmap(0, 4715, PROT_READ, MAP_SHARED, 3, 0) = 0x40008000
close(3) = 0
stat("/etc/ld.so.preload", 0xbffffc48) = -1 ENOENT (No such file or
directory)
open("/lib/libc.so.5", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 786432, PROT_NONE, MAP_PRIVATE|0x20, 4294967295, 0) = 0x4000a000

mmap(0x4000a000, 555135, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
3,0) = 0x4000a000
mmap(0x40092000, 21344, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3,0x87000) = 0x40092000
mmap(0x40098000, 204364,
PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_FIXED|0x20, 4294967295, 0) =
0x40098000
close(3) = 0
mprotect(0x4000a000, 555135, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
munmap(0x40008000, 4715) = 0
mprotect(0x8048000, 4412, PROT_READ|PROT_EXEC) = 0
mprotect(0x4000a000, 555135, PROT_READ|PROT_EXEC) = 0
mprotect(0x40000000, 21025, PROT_READ|PROT_EXEC) = 0
SYS_136(0, 0x1, 0x4, 0x40006394, 0x8048460) = 0
geteuid() = 0
getuid() = 0
getgid() = 0
getegid() = 0
_exit(0) = ?

The same source but build against libc6:

mml1:# gcc -g -L/usr/local/lib/ -o aa aa.c -Wl,-rpath,/usr/local/lib/
mml1:# file aa
aa: ELF 32-bit LSB executable, Intel 80386, version 1, dynamically
linked, not stripped
mml1:# ./aa
Segmentation fault (core dumped)
mml1:# strace aa
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|0x20, 4294967295, 0) =
0x40007000
mprotect(0x40000000, 21025, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
mprotect(0x8048000, 4476, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
stat("", {st_mode=S_IFREG|0644, st_size=4715, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
mmap(0, 4715, PROT_READ, MAP_SHARED, 3, 0) = 0x40008000
close(3) = 0
stat("/etc/ld.so.preload", 0xbffffb08) = -1 ENOENT (No such file or
directory)
open("/usr/local/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 679936, PROT_NONE, MAP_PRIVATE|0x20, 4294967295, 0) = 0x4000a000

mmap(0x4000a000, 597453, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3,
0) = 0x4000a000
mmap(0x4009c000, 27448, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x91000) = 0x4009c000
mmap(0x400a3000, 49680, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|0x20, 4294967295, 0) = 0x400a3000
close(3) = 0
mprotect(0x4000a000, 597453, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
open("/usr/local/lib/ld-linux.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 49152, PROT_NONE, MAP_PRIVATE|0x20, 4294967295, 0) = 0x400b0000
mmap(0x400b0000, 39324, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3,
0) = 0x400b0000
mmap(0x400ba000, 3484, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x9000) = 0x400ba000
mmap(0x400bb000, 872, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|0x20,
4294967295, 0) = 0x400bb000
close(3) = 0
mprotect(0x400b0000, 39324, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
munmap(0x40008000, 4715) = 0
mprotect(0x8048000, 4476, PROT_READ|PROT_EXEC) = 0
mprotect(0x4000a000, 597453, PROT_READ|PROT_EXEC) = 0
mprotect(0x400b0000, 39324, PROT_READ|PROT_EXEC) = 0
mprotect(0x40000000, 21025, PROT_READ|PROT_EXEC) = 0
getpid() = 22182
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

I'm in the dark on this, please let me know what your thoughts are...

Barry

--------------0C0FD6A563C208BE380D8C85--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/