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

Netscape Bus error : a track ?



Hello,

I have installed Navigator 4.6 ( libc5 version) on two slink boxes, with exactly the same core system, but not exactly the same packages. And I had the surprise to see Navigator on one of the two boxes crashes with the delicious " Bus error" message.
So I have strace[d] the two versions and found what was different : I had installed the plugger package on the box where Navigator crashes, and in order to load "/usr/lib/netscape/plugins/pluger.so", Navigator opens "libc.so.6" which is, actually, a *libc6* library ( found with ldconfig -p), opens the file of the dynamic loader "ld-linux.so.2" ( is the .2 the sign that's the libc6 ELF version ?), maps it and finally crashes when trying to access the memory, with a segmentation fault traduced in a "bus error".

Here is the interesting part of the strace file :

======================BEGINNING OF [LAST PART OF] STRACE==================

stat("/usr/lib/netscape/plugins", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
open("/usr/lib/netscape/plugins", O_RDONLY) = 16
fcntl(16, F_SETFD, FD_CLOEXEC)          = 0
brk(0x8971000)                          = 0x8971000
brk(0x8972000)                          = 0x8972000
getdents(16, /* 6 entries */, 4096)     = 140
stat("/usr/lib/netscape/plugins/libnullplugin.so", {st_mode=S_IFREG|0755, st_size=922407, ...}) = 0
stat("/usr/lib/netscape/plugins/plugger.so", {st_mode=S_IFREG|0644, st_size=23148, ...}) = 0
stat("/usr/lib/netscape/plugins/cpPack1.jar", {st_mode=S_IFREG|0755, st_size=57089, ...}) = 0
stat("/usr/lib/netscape/plugins/plugger-2.2-linux-elf.so", {st_mode=S_IFREG|0755, st_size=18820, ...}) = 0
getdents(16, /* 0 entries */, 4096)     = 0
close(16)                               = 0
stat("/usr/lib/netscape/plugins", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
open("/usr/lib/netscape/plugins", O_RDONLY) = 16
fcntl(16, F_SETFD, FD_CLOEXEC)          = 0
getdents(16, /* 6 entries */, 4096)     = 140
stat("/usr/lib/netscape/plugins/libnullplugin.so", {st_mode=S_IFREG|0755, st_size=922407, ...}) = 0
stat("/usr/lib/netscape/plugins/libnullplugin.so", {st_mode=S_IFREG|0755, st_size=922407, ...}) = 0
stat("/etc/ld.so.cache", {st_mode=S_IFREG|0644, st_size=9345, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY)      = 17
mmap(0, 9345, PROT_READ, MAP_SHARED, 17, 0) = 0x40008000
close(17)                               = 0
open("/usr/lib/netscape/plugins/libnullplugin.so", O_RDONLY) = 17
read(17, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 819200, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40284000
mmap(0x40284000, 743270, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 17, 0) = 0x40284000
mmap(0x4033a000, 69784, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 17, 0xb5000) = 0x4033a000
close(17)                               = 0
mprotect(0x40284000, 743270, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
--- SIGALRM (Alarm clock) ---
gettimeofday({936287843, 33361}, NULL)  = 0
sigreturn()                             = ? (mask now [])
--- SIGALRM (Alarm clock) ---
gettimeofday({936287843, 83315}, NULL)  = 0
sigreturn()                             = ? (mask now [])
--- SIGALRM (Alarm clock) ---
gettimeofday({936287843, 133317}, NULL) = 0
sigreturn()                             = ? (mask now [])
munmap(0x40008000, 9345)                = 0
munmap(0x40284000, 817772)              = 0
stat("/usr/lib/netscape/plugins/plugger.so", {st_mode=S_IFREG|0644, st_size=23148, ...}) = 0
stat("/usr/lib/netscape/plugins/plugger.so", {st_mode=S_IFREG|0644, st_size=23148, ...}) = 0
stat("/etc/ld.so.cache", {st_mode=S_IFREG|0644, st_size=9345, ...}) = 0
--- SIGALRM (Alarm clock) ---
gettimeofday({936287843, 183582}, NULL) = 0
sigreturn()                             = ? (mask now [])
open("/etc/ld.so.cache", O_RDONLY)      = 17
mmap(0, 9345, PROT_READ, MAP_SHARED, 17, 0) = 0x40008000
close(17)                               = 0
open("/usr/lib/netscape/plugins/plugger.so", O_RDONLY) = 17
read(17, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 24576, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40284000
mmap(0x40284000, 21872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 17, 0) = 0x40284000
mmap(0x40289000, 1808, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 17, 0x5000) = 0x40289000
close(17)                               = 0
mprotect(0x40284000, 21872, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
open("/usr/lib/libc.so.6", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY)        = 17
read(17, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 675840, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4028a000
mmap(0x4028a000, 594445, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 17, 0) = 0x4028a000
mmap(0x4031c000, 26240, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 17, 0x91000) = 0x4031c000
mmap(0x40323000, 46532, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40323000
close(17)                               = 0
mprotect(0x4028a000, 594445, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
open("/lib/ld-linux.so.2", O_RDONLY)    = 17
read(17, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3"..., 4096) = 4096
mmap(0, 49152, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4032f000
mmap(0x4032f000, 41020, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 17, 0) = 0x4032f000
mmap(0x4033a000, 1524, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 17, 0xa000) = 0x4033a000
close(17)                               = 0
mprotect(0x4032f000, 41020, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
--- SIGSEGV (Segmentation fault) ---
getpid()                                = 2327
kill(2327, SIGBUS)                      = 0
--- SIGBUS (Bus error) ---
+++ killed by SIGBUS +++
=============================END OF FILE====================================

My questions are the following :

a) Who is responsible for the verification of the type of the libraries ( libc5 or libc6) : the program, or the dynamic loader ?

b) What's the difference between the load of the "main" libraries ( I mean the libraries directly needed by the program) and the load of the "second hand" libraries ( libraries needed by a plugin ) : in the former, if the libc5 versions are not found, the program exists correctly. In the latter, there is no verification and the whole core dump...

I hope the strace can help, for the other cases, to find what's going wrong.

TIA.
-- 
Thierry LARONDE
thierry.laronde@polynum.com
website : http://www.polynum.com

"unctuous : used about somebody who pretends to put balm on your wounds, when,
at the very time, by way of preliminaries, he's just oiling your arse."
	Adrien Herryolt, "Le glossaire des Précieuses"


Reply to: