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

Bug#68510: segfault in getopt (glibc)



Package: glibc
Version: 2.1.3-10
Severity: Important

all fortran programs that i've compiled (w/ Portland Group's pgf77)
segfault in the initial libc setup.  same program compiled exactly the
same way on a redhat 6.1 box works, even on the Debian potato box.  and
conversely, the Debian compiled version does not work on the RH box.
(though the breakage is different, but close...)

the only differences of note are:
1) Kernel Rev [2.2.14 (RH) v. 2.2.16 (D)] 
2) Libc Rev [2.1.2 (RH) v. 2.1.3 (D)]

the problem seems ot be in getopt_long_only or
__getopt_clean_environment from glibc.  i guess i'd have to be a borked
header or something??

job


Debian-2.2 >  ./g98
Segmentation fault (core dumped)

Debian-2.2 > gdb g98 core
GNU gdb 19990928
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(no debugging symbols found)...
Core was generated by `./g98'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /opt/pkgs/bonk/g98-A6/./util.so...done.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /usr/lib/libc.so.6...done.
Reading symbols from /usr/lib/ld-linux.so.2...done.
Reading symbols from /lib/ld-linux.so.1...done.
#0  0x2e52e8c4 in getopt_long_only () from /usr/lib/libc.so.6
(gdb) bt
#0  0x2e52e8c4 in getopt_long_only () from /usr/lib/libc.so.6
#1  0x2e4bd895 in signgam () from /usr/lib/libc.so.6
#2  0x2e4bd904 in signgam () from /usr/lib/libc.so.6
#3  0x2aaad355 in _dl_boot () from /lib/ld-linux.so.1
(gdb) quit

Debian-2.2 > strace ./g98 |& tail -20
open("./ld-linux.so.2", O_RDONLY)       = -1 ENOENT (No such file or directory)
open("/usr/lib/ld-linux.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/ld-linux.so.2", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220\31"..., 4096) = 4096
old_mmap(NULL, 81920, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2e582000
old_mmap(0x2e582000, 72256, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2e582000
old_mmap(0x2e594000, 3160, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x11000) = 0x2e594000
old_mmap(0x2e595000, 208, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2e595000
close(3)                                = 0
mprotect(0x2e582000, 72256, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
munmap(0x2aab3000, 16124)               = 0
mprotect(0x8048000, 83708, PROT_READ|PROT_EXEC) = 0
mprotect(0x2aab7000, 7412688, PROT_READ|PROT_EXEC) = 0
mprotect(0x2e488000, 113231, PROT_READ|PROT_EXEC) = 0
mprotect(0x2e4a5000, 870481, PROT_READ|PROT_EXEC) = 0
mprotect(0x2e582000, 72256, PROT_READ|PROT_EXEC) = 0
mprotect(0x2aaab000, 21377, PROT_READ|PROT_EXEC) = 0
getpid()                                = 12773
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
Debian-2.2 > 


And, that same, bad program on Redhat.

RedHat-6.1 $ ./g98.debian 
Segmentation fault (core dumped)

RedHat-6.1 $ gdb g98.debian core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `./g98.debian'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
Reading symbols from /lib/ld-linux.so.1...done.
#0  0x400c6a8b in __getopt_clean_environment (env=0x0) at getopt_init.c:60
60      getopt_init.c: No such file or directory.
(gdb) bt
#0  0x400c6a8b in __getopt_clean_environment (env=0x0) at getopt_init.c:60
#1  0x40040ffa in _init (arg=0x0) at ../sysdeps/unix/sysv/linux/init-first.c:87
#2  0x4000234b in _dl_boot () from /lib/ld-linux.so.1
(gdb) quit
RedHat-6.1 $ 

RedHat-6.1 $ strace ./g98.debian |& tail -20
open("/lib/ld-linux.so.2", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\27"..., 4096) = 4096
mmap(0, 77824, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4011c000
mmap(0x4011c000, 73728, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x4011c000
mmap(0x4012e000, 532, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12000) = 0x4012e000
close(3)                                = 0
mprotect(0x4011c000, 73728, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
munmap(0x40008000, 20023)               = 0
mprotect(0x8048000, 130296, PROT_READ|PROT_EXEC) = 0
mprotect(0x4000d000, 110159, PROT_READ|PROT_EXEC) = 0
mprotect(0x40029000, 961713, PROT_READ|PROT_EXEC) = 0
mprotect(0x4011c000, 73728, PROT_READ|PROT_EXEC) = 0
mprotect(0x40000000, 21420, PROT_READ|PROT_EXEC) = 0
brk(0)                                  = 0x8206ed4
brk(0x8207074)                          = 0x8207074
brk(0)                                  = 0x8207074
brk(0x8208000)                          = 0x8208000
getpid()                                = 13155
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
RedHat-6.1 $



Reply to: