Article View: gnu.gdb.bug
Article #2751Execution continues after a "Cannot access memory at address 0x......" message
From: Marcelo Spohn
Date: Thu, 31 Jan 2002 22:38
Date: Thu, 31 Jan 2002 22:38
135 lines
5985 bytes
5985 bytes
--------------7FB0332D31829322BD7DE28D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello,
I've spent quite a good number of hours trying to figure this one out
unsuccessfully.
I need your help! I'm running GNU gdb 4.18C under a Solaris/SPARC
arquitecture for
debugging of a C-program.
This is the trace of gdb's execution:
(gdb) run
Starting program: bubbles
Cannot access memory at address 0x2f6c6962.
(gdb) bt
#0 0x7fbbaa48 in ?? ()
#1 0x7fbb4310 in ?? ()
#2 0x7fbbedc4 in ?? ()
#3 0x7fbbee5c in ?? ()
#4 0x7fbbefa4 in ?? ()
#5 0x7f6c9844 in SO_per_src_lookup () from /usr/lib/libc.so.1
#6 0x7f6c8108 in nss_get_backend_u () from /usr/lib/libc.so.1
#7 0x7f6c8bd0 in nss_search () from /usr/lib/libc.so.1
#8 0x7f665740 in getprotobyname_r () from /usr/lib/libsocket.so.1
#9 0x4fbac in task_get_proto (tf=0x0, name=0x112530 "icmp",
default_proto=1724904) at task.c:6298
#10 0xd7ba0 in icmp_init () at icmp.c:723
#11 0x49480 in task_proto_inits () at task.c:3103
#12 0x5142c in main (argc=2, argv=0xffbefd84) at task.c:7301
(gdb) info frame
Stack level 0, frame at 0xffbeedb8:
pc = 0xff3baa48; saved pc 0xff3b4310
called by frame at 0xffbef258
Arglist at 0xffbeedb8, args:
Locals at 0xffbeedb8,
(gdb) list
7059 }
7060
7061
7062 /*
7063 * Initialization processing
7064 */
7065 int
7066 main(int argc, char **argv)
7067 {
7068 char *name = argv[0];
(gdb) continue
Continuing.
Two weird things are happening here:
1) GDB complains that the user process is trying to access an invalid
address,
but allows the process to continue its execution (normally) when I
type in the bgp command continue.
2) The output of the list command is showing part of the code that is
around the main function (program
counter 0x5142c), which does not correspond to the current stack
frame.
I suppose this is a bug in GDB, isn't it?
Many thanks,
Marcelo
--------------7FB0332D31829322BD7DE28D
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<pre>Hello,</pre>
I've spent quite a good number of hours trying to figure this one out unsuccessfully.
<br>I need your help! I'm running GNU gdb 4.18C under a Solaris/SPARC arquitecture
for
<br>debugging of a C-program.
<p>This is the trace of gdb's execution:
<p><tt>(gdb) run</tt>
<br><tt>Starting program: bubbles</tt>
<br><b><tt><font color="#000000">Cannot access memory at address 0x2f6c6962.</font></tt></b>
<br><tt>(gdb) bt</tt>
<br><tt>#0 0x7fbbaa48 in ?? ()</tt>
<br><tt>#1 0x7fbb4310 in ?? ()</tt>
<br><tt>#2 0x7fbbedc4 in ?? ()</tt>
<br><tt>#3 0x7fbbee5c in ?? ()</tt>
<br><tt>#4 0x7fbbefa4 in ?? ()</tt>
<br><tt>#5 0x7f6c9844 in SO_per_src_lookup () from /usr/lib/libc.so.1</tt>
<br><tt>#6 0x7f6c8108 in nss_get_backend_u () from /usr/lib/libc.so.1</tt>
<br><tt>#7 0x7f6c8bd0 in nss_search () from /usr/lib/libc.so.1</tt>
<br><tt>#8 0x7f665740 in getprotobyname_r () from /usr/lib/libsocket.so.1</tt>
<br><tt>#9 0x4fbac in task_get_proto (tf=0x0, name=0x112530 "icmp",
default_proto=1724904) at task.c:6298</tt>
<br><tt>#10 0xd7ba0 in icmp_init () at icmp.c:723</tt>
<br><tt>#11 0x49480 in task_proto_inits () at task.c:3103</tt>
<br><tt>#12 0x5142c in main (argc=2, argv=0xffbefd84) at task.c:7301</tt>
<br><tt>(gdb) info frame</tt>
<br><tt>Stack level 0, frame at 0xffbeedb8:</tt>
<br><tt> pc = 0xff3baa48; saved pc 0xff3b4310</tt>
<br><tt> called by frame at 0xffbef258</tt>
<br><tt> Arglist at 0xffbeedb8, args:</tt>
<br><tt> Locals at 0xffbeedb8,</tt>
<br><tt>(gdb) list</tt>
<br><tt>7059 }</tt>
<br><tt>7060</tt>
<br><tt>7061</tt>
<br><tt>7062 /*</tt>
<br><tt>7063 * Initialization
processing</tt>
<br><tt>7064 */</tt>
<br><tt>7065 int</tt>
<br><tt>7066 main(int argc, char **argv)</tt>
<br><tt>7067 {</tt>
<br><tt>7068 char *name = argv[0];</tt>
<br><tt>(gdb) continue</tt>
<br><tt>Continuing.</tt>
<p>Two weird things are happening here:
<br>1) GDB complains that the user process is trying to access an invalid
address,
<br> but allows the process to continue its execution
(normally) when I type in the bgp command <i>continue.</i>
<br>2) The output of the <i>list </i>command is showing part of the code
that is around the <i>main</i> function (program
<br> counter <tt>0x5142c</tt>), which does not
correspond to the current stack frame.
<p>I suppose this is a bug in GDB, isn't it?
<p>Many thanks,
<br>Marcelo
<br> </html>
--------------7FB0332D31829322BD7DE28D--
Technical Details
Message-ID:
<3C59C778.28326E69@ig.com.br>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdbShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,924e4b91fc3bc8e5,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 2002-01-31 14:39:34 PST x-uunet-gateway: dfw7sosrv11.alter.net from bug-gdb to gnu.gdb.bug; Thu, 31 Jan 2002 22:39:32 GMT Sender: mspohn@uunet.uu.net Message-ID: <3C59C778.28326E69@ig.com.br> Date: Thu, 31 Jan 2002 20:38:48 -0200 From: marcelo.spohn@ig.com.br (Marcelo Spohn) X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 4.3-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 Subject: Execution continues after a "Cannot access memory at address 0x......" message Content-Type: multipart/alternative; boundary="------------7FB0332D31829322BD7DE28D" Approved: bug-gdb-request@mail.gnu.org Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb Lines: 136