🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #8842

"Program received signal 5, Trace/BPT trap"

#8842
From: Urs Hoelzle
Date: Fri, 16 Oct 1992 17:40
55 lines
2883 bytes
Here's another problem I encounter quite frequently (but unfortunately
not reproducibly) when evaluating exporessions in gdb 4.6 (SPARC,
SunOS 4.1.2).  Here's an example (using a program compiled with g++
2.2.2):

[program suspended]
(gdb) p nm->scopes->root()

Program received signal 5, Trace/BPT trap
0xf7ffeefc in cg12_height ()
1: x/i $pc  0xf7ffeefc <cg12_height+8365892>:	t 1
The program being debugged stopped while in a function called from GDB.
The expression which contained the function call has been discarded.
Unable to restore previously selected frame.
(gdb) bt
#0  0xf7ffeefc in cg12_height ()
#1  0xf7ffeef8 in cg12_height ()
#2  0x24b134 in toascii ()
#3  0x9 in ?? ()
(gdb) 

I.e. the evaluation breaks and the stack is completely messed up (for 
example, in the case above the program was nowhere near toascii before
the expression was evaluated).

#0 is clearly in code synthesized by gdb to evaluate the expression:

(gdb) x/20i 0xf7ffeefc-40
0xf7ffeed4 <cg12_height+8365852>:   rd %y, %o0
0xf7ffeed8 <cg12_height+8365856>:   st %o0, [%fp+-188]
0xf7ffeedc <cg12_height+8365860>:   ld [%sp+0x58], %o5
0xf7ffeee0 <cg12_height+8365864>:   ld [%sp+0x54], %o4
0xf7ffeee4 <cg12_height+8365868>:   ld [%sp+0x50], %o3
0xf7ffeee8 <cg12_height+8365872>:   ld [%sp+0x4c], %o2
0xf7ffeeec <cg12_height+8365876>:   ld [%sp+0x48], %o1
0xf7ffeef0 <cg12_height+8365880>:   call 0x11d690 <root__13nmethodScopes>
0xf7ffeef4 <cg12_height+8365884>:   ld [%sp+0x44], %o0
0xf7ffeef8 <cg12_height+8365888>:   nop 
0xf7ffeefc <cg12_height+8365892>:   t 1
0xf7ffef00 <cg12_height+8365896>:   nop 
0xf7ffef04 <cg12_height+8365900>:   nop 
0xf7ffef08 <cg12_height+8365904>:   sethi %hi(0x420800), %o0
0xf7ffef0c <cg12_height+8365908>:   0xf7fff02c
0xf7ffef10 <cg12_height+8365912>:   0xf7fff030
0xf7ffef14 <cg12_height+8365916>:   unimp n
0xf7ffef18 <cg12_height+8365920>:   unimp n
0xf7ffef1c <cg12_height+8365924>:   unimp n
0xf7ffef20 <cg12_height+8365928>:   unimp n
(gdb) 

-Urs

----------------------------------------------------------------------------
Urs Hoelzle                                              urs@cs.stanford.EDU
Computer Systems Laboratory, CIS 57, Stanford University, Stanford, CA 94305
Technical Details
Message-ID: <hoelzle.719257255@Xenon.Stanford.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!xenon.stanford.edu!hoelzle

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,6485ad9578dd37e0,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1992-10-16 19:06:30 PST
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!xenon.stanford.edu!hoelzle
From: hoelzle@xenon.stanford.edu (Urs Hoelzle)
Subject: "Program received signal 5, Trace/BPT trap"
Message-ID: <hoelzle.719257255@Xenon.Stanford.EDU>
Sender: gnulists@ai.mit.edu
Organization: CS Department, Stanford University, California, USA
Distribution: gnu
Date: Fri, 16 Oct 1992 17:40:55 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 56