Article View: gnu.gdb.bug
Article #8844problem with shared libraries and core files
From: Peggy Fieland
Date: Wed, 16 Sep 1992 19:07
Date: Wed, 16 Sep 1992 19:07
71 lines
2989 bytes
2989 bytes
I am running gdb-4.6 on a stratus i860 under SVR4.
I am having a problem with backtraces from core files where the program
got a segmentation fault in the shared library. Gdb cannot backtrace
correctly in this case. On the other hand, when either the program
is linked statically (-dn on our system) or the program is running
from within gdb, the backtrace is correct. As the following two
debugging sessions indicate, the problem appears to be with reading
the shared library symbols from the core file (note that in
the incorrect case, gdb can`t find any functions named "strlen",
while it can in the correct case.)
I do not have this problem on our Sun4.
Here is the test program (it generates a segfault):
main()
{
char arr[11];
int xtemp;
for (xtemp=0;xtemp<10; xtemp++)
{
arr[xtemp]='X';
}
arr[11]='\0';
printf("arr[] = %s\n",arr[0]); /* this is where it fails */
}
0maestro-tests% trace
Segmentation fault (core dumped)
maestro-tests% gdb trace core
GDB is free software and you are welcome to 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.
GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
Core was generated by `trace'.
Program terminated with signal 11, Segmentation fault.
#0 0x8102624c in environ ()
(gdb) info functions strlen
All functions matching regular expression "strlen":
(gdb) bt
#0 0x8102624c in environ ()
Cannot access memory at address 0x3004.
(gdb) q
gdb trace
GDB is free software and you are welcome to 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.
GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
(gdb) r
Starting program: /tmp_mnt/net/citron/home/citron/pfieland/tests/trace
Program received signal 11, Segmentation fault
0x8102624c in strlen ()
(gdb) bt
#0 0x8102624c in strlen ()
#1 0x8101b5a0 in _doprnt ()
#2 0x8101cca8 in printf ()
#3 0x1498 in main () at trace.c:10
#4 0x1414 in _start ()
(gdb) info functions strlen
All functions matching regular expression "strlen":
Non-debugging symbols:
8100ebb0 _rtstrlen
81026240 strlen
(gdb) q
Technical Details
Message-ID:
<9209161907.AA06706@citron.sw.stratus.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!citron.sw.stratus.com!pfielandShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,8483b18a8017507f,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 1992-09-16 06:54:28 PST Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!citron.sw.stratus.com!pfieland From: pfieland@citron.sw.stratus.com (Peggy Fieland) Subject: problem with shared libraries and core files Message-ID: <9209161907.AA06706@citron.sw.stratus.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Wed, 16 Sep 1992 19:07:50 GMT Approved: bug-gdb@prep.ai.mit.edu Lines: 72