public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* 2 Segfaults in Insights (Latest CVS)
@ 2000-10-11  0:54 Steven Johnson
  2000-10-11  9:16 ` Fernando Nasser
  2000-10-12  8:34 ` Fernando Nasser
  0 siblings, 2 replies; 5+ messages in thread
From: Steven Johnson @ 2000-10-11  0:54 UTC (permalink / raw)
  To: insight

I am experiencing 2 Segfaults in Insight. 1 I have tracked a cause for, the
other I havent. Before I get into details I will spout the preliminaries.

Host: Mandrake Linux 7.0 (Kernel 2.2.14)
Insight Version: CVS as of today.
configuration: ../src/configure --target=powerpc-eabi 
                                --program-prefix=insight-ppc
                                --prefix=/opt/powerpc-gdb

GCC Version: 2.95.2

Details:
Segfault 1: 

Start Insight     : OK
Connect to Target : OK
Download          : Segfault.

I am starting insight with
/opt/powerpc-gdb/bin/insight-ppc-gdb                    
                                    --command=mpc860-gdb-init

The command file defines some hooks so I can operate my target hardware
properly. Especially with regard to loading the program (I am running out of
flash!).

When I connect (using the standard dialog). I am connecting to a server for my
BDM Interface to the PowerPC MPC860 Board. It is running on the same computer
as Insight, and it communicates using the standard GDB Remote protocol. I
Connect to localhost:2345. 

When I choose download Insight almost immediately segfaults in "gdbtypes.c,
line 1060" This is not the problem however, it is the symptom. A Stack trace
gives me a trace through values.c, valops.c, eval.c and eventually to the
function set_command in printcmd.c (line 1041).

This works fine if I start gdb with the --nw option BTW.

What I "think" the problem is:

Insight appears to hook all "set" operations when it is executing a gui command
such as download. It does this, so that any variables that are changed by the
command are updated on the display. My script adds a hook to the load
operation. The hook writes to a register with:

set $ictrl=0x7

I need this because of peculiarities with the way I need to operate my
hardware. Insight executes this command on the target properly. It then
interprets the SET operation. Looks up symbol $ictrl (which doesn't exist, its
a register not a symbol of the program.) tries to set it's local value to 0x7
and segfaults because the pointer to the symbol is invalid crap. GDB without
Insight doesn't do it because it does not post interpret the set operations.

set_command is the culprit that does this. I have tested my hypothesis by
commenting out the expression evaluation in set_command. When I do this,
loading works fine. This is obviously not the correct fix. I can see what
Insight is attempting to achieve and it is valid. Im not sure how to fix the
case where the symbol doesn't exist. Any input would be appreciated as I would
really like to get this fixed.

I think it could be forced on any Insight by creating a hook on load that
updates a register to some arbitrary value. For example:

define hook-load
  set $eax=0x01
  set $eax=0x00
end

I did it twice to defeat the register caching mechanism for the purposes of the
test. (If the first write doesn't do anything, the second will.) I believe this
will segfault Insight everytime (NOTE: I haven't tested this on an intel target
myself)

The second segfault is currently not giving me much information at all:
Program received SIGSEGV,segmentation fault.
0x7d68375 in ?? ()
(gdb) info stack
#0 0x7d68375 in ?? ()
Cannot access memory address 0x6f74746e
(gdb)

This occurs when I set a breakpoint, run to it, and then try and clear it. (I
need to do more testing.) I have mentioned it to see if it is already known, or
unique to me.

Anyway, any comments on this stuff?

Steven Johnson

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-10-12  8:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-11  0:54 2 Segfaults in Insights (Latest CVS) Steven Johnson
2000-10-11  9:16 ` Fernando Nasser
2000-10-11 15:15   ` Steven Johnson
2000-10-11 19:53     ` Fernando Nasser
2000-10-12  8:34 ` Fernando Nasser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).