This is the mail archive of the insight@sourceware.org mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Crashes when "balloons" enabled


Not sure whether this helps or not as it probably doesn't fix the root
cause, but I ran into this same problem some time ago and "fixed" it
with the following patch (from Insight 6.5):

*** varobj.c	2006/12/03 17:07:37	1.1
--- varobj.c	2006/12/03 17:08:49
***************
*** 1761,1766 ****
--- 1761,1773 ----
    target = get_target_type (type);
    children = 0;
  
+   /*
+    * [++doug] Saw crash here with var->type==NULL.  So check for
+    * that before calling TYPE_CODE on it.
+    */
+   if (type == NULL)
+     return children;
+ 
    switch (TYPE_CODE (type))
      {
      case TYPE_CODE_ARRAY:
***************
*** 1828,1833 ****
--- 1835,1848 ----
    type = get_type (parent);
    target = get_target_type (type);
  
+   /*
+    * [++doug]  Haven't actually run into a NULL type here yet, but we
+    * have in a couple of the other c_* routines, so lets be defensive
+    * here.
+    */
+   if (type == NULL)
+     return (xstrdup("<?null_type?>"));
+ 
    switch (TYPE_CODE (type))
      {
      case TYPE_CODE_ARRAY:
***************
*** 1938,1944 ****
    temp = parent->value;
    value = NULL;
  
!   if (temp != NULL)
      {
        switch (TYPE_CODE (type))
  	{
--- 1953,1964 ----
    temp = parent->value;
    value = NULL;
  
!   /*
!    * [++doug]  Haven't actually run into a NULL type here yet, but we
!    * have in a couple of the other c_* routines, so lets be defensive
!    * here.
!    */
!   if (temp != NULL && type != NULL)
      {
        switch (TYPE_CODE (type))
  	{
***************
*** 2034,2040 ****
  static int
  c_variable_editable (struct varobj *var)
  {
!   switch (TYPE_CODE (get_type (var)))
      {
      case TYPE_CODE_STRUCT:
      case TYPE_CODE_UNION:
--- 2054,2069 ----
  static int
  c_variable_editable (struct varobj *var)
  {
!   /*
!    * [++doug]  Haven't actually run into a NULL type here yet, but we
!    * have in a couple of the other c_* routines, so lets be defensive
!    * here.
!    */
!   struct type *type = get_type(var);
!   if (type == NULL)
!     return 0;
! 
!   switch (TYPE_CODE (type))
      {
      case TYPE_CODE_STRUCT:
      case TYPE_CODE_UNION:
***************
*** 2059,2064 ****
--- 2088,2107 ----
       catch that case explicitly.  */
    struct type *type = get_type (var);
  
+   /*
+    * [++doug] Saw crash here with var->type==NULL.  So check for
+    * that before calling TYPE_CODE on it.  var was:
+    *
+    * (gdb) p *var
+    * $4 = {name = 0xa70dc90 "item", obj_name = 0xa70de40 "var77.code.item",
+    * index = 0, type = 0x0,
+    * value = 0x0, error = 0, num_children = -1, parent = 0x86e2fd0, children = 0x0,
+    * root = 0xa5768e0, format = FORMAT_NATURAL, updated = 0}
+    *
+    */
+   if (type == NULL)
+     return xstrdup("<?null_type?>");
+ 
    /* Strip top-level references. */
    while (TYPE_CODE (type) == TYPE_CODE_REF)
      type = check_typedef (TYPE_TARGET_TYPE (type));

--Doug.

-----Original Message-----
To: insight@sources.redhat.com
From: gds <gds@chartertn.net>
Subject:  Re: Crashes when "balloons" enabled
Date:  Tue, 01 Apr 2008 14:47:50 -0400

Keith Seitz wrote:
>gds wrote:
>
>>Is there a possible work-around for this?
>
>Can you give me a testcase and procedure (hopefully native linux)? The 
>simple test case I've tried here works.
>
>Can you run insight on gdb and get a backtrace of where the thing 
>crashes? That would be very helpful.
>
>Keith
>

Attached is backtrace. Does not fail while accessing a balloon variable 
or during "so gdbinit" command but on first step after "so gdbinit" 
after having accessed balloon vars.

Not sure that I can use it on native linux since compiled for arm. Do I 
need to reconfig/rebuild for native i386 linux?
-gene



[gene@aph1v93kc1nb hello_world_c]$ gdb arm-rtems4.8-insight
GNU gdb Red Hat Linux (6.6-45.fc8rh)
Copyright (C) 2006 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-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) c
The program is not being run.
(gdb) run
Starting program: /opt/rtems-4.8/bin/arm-rtems4.8-insight

Program received signal SIGSEGV, Segmentation fault.
check_typedef (type=0xa4892a4) at ../../insight_sources/gdb/gdbtypes.c:1384
1384      while (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
Missing separate debuginfos, use: debuginfo-install expat.i386 glibc.i686 libX11.i386 libXau.i386 libXcursor.i386 libXdmcp.i386 libXfixes.i386 libXren               der.i386 libxcb.i386 ncurses.i386
(gdb) bt
#0  check_typedef (type=0xa4892a4) at ../../insight_sources/gdb/gdbtypes.c:1384
#1  0x080b4b63 in allocate_value (type=0xa4892a4) at ../../insight_sources/gdb/value.c:217
#2  0x080baa12 in value_zero (type=0xa4892a4, lv=not_lval) at ../../insight_sources/gdb/valops.c:465
#3  0x08147161 in varobj_get_type (var=0xa509520) at ../../insight_sources/gdb/varobj.c:756
#4  0x0814863c in varobj_update (varp=0xbfe5b898, changelist=0xbfe5b890) at ../../insight_sources/gdb/varobj.c:1634
#5  0x0808f00b in variable_obj_command (clientData=0x0, interp=0x9f38de0, objc=2, objv=0x9f3aa54)
    at ../../insight_sources/gdb/gdbtk/generic/gdbtk-varobj.c:450
#6  0x082e98e1 in TclEvalObjvInternal (interp=0x9f38de0, objc=2, objv=0x9f3aa54, command=0x0, length=0, flags=0)
    at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3048
#7  0x08312050 in TclExecuteByteCode (interp=0x9f38de0, codePtr=0xa284a90) at ../../../insight_sources/tcl/unix/../generic/tclExecute.c:1431
#8  0x0831581d in TclCompEvalObj (interp=0x9f38de0, objPtr=0xa2dd2a0) at ../../../insight_sources/tcl/unix/../generic/tclExecute.c:1008
#9  0x082ea9a9 in Tcl_EvalObjEx (interp=0x9f38de0, objPtr=0xa2dd2a0, flags=0) at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3944
#10 0x08239a64 in Itcl_EvalMemberCode (interp=0x9f38de0, mfunc=0xa2ded90, member=0xa2deda8, contextObj=0xa2cef08, objc=1, objv=0xbfe5c480)
    at /home/gene/4.8.0-rtems/archive/insight_sources/itcl/itcl/generic/itcl_methods.c:1003
#11 0x0823a9ad in Itcl_ExecMethod (clientData=0xa2ded90, interp=0x9f38de0, objc=1, objv=0xbfe5c480)
    at /home/gene/4.8.0-rtems/archive/insight_sources/itcl/itcl/generic/itcl_methods.c:1516
#12 0x08240805 in Itcl_EvalArgs (interp=0x9f38de0, objc=1, objv=0xbfe5c480)
    at /home/gene/4.8.0-rtems/archive/insight_sources/itcl/itcl/generic/itcl_util.c:1347
#13 0x0823bd1c in Itcl_HandleInstance (clientData=0xa2cef08, interp=0x9f38de0, objc=2, objv=0xbfe5c47c)
    at /home/gene/4.8.0-rtems/archive/insight_sources/itcl/itcl/generic/itcl_objects.c:685
#14 0x082e98e1 in TclEvalObjvInternal (interp=0x9f38de0, objc=2, objv=0xbfe5c47c,
    command=0xa465870 "::.srcwin0.srcwin.container.pane2.childsite.con updateBalloon", length=61, flags=0)
    at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3048
#15 0x082e9eaf in Tcl_EvalEx (interp=0x9f38de0, script=0xa465870 "::.srcwin0.srcwin.container.pane2.childsite.con updateBalloon", numBytes=61,
    flags=262144) at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3646
#16 0x082eaaae in Tcl_EvalObjEx (interp=0x9f38de0, objPtr=0xa4459b8, flags=262144) at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3932
#17 0x0833de22 in Tcl_UplevelObjCmd (dummy=0x0, interp=0x9f38de0, objc=<value optimized out>, objv=<value optimized out>)
    at ../../../insight_sources/tcl/unix/../generic/tclProc.c:684
#18 0x082e98e1 in TclEvalObjvInternal (interp=0x9f38de0, objc=4, objv=0x9f3aa44, command=0x0, length=0, flags=0)
    at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3048
#19 0x08312050 in TclExecuteByteCode (interp=0x9f38de0, codePtr=0xa0a66d8) at ../../../insight_sources/tcl/unix/../generic/tclExecute.c:1431
#20 0x0831581d in TclCompEvalObj (interp=0x9f38de0, objPtr=0x9fd2910) at ../../../insight_sources/tcl/unix/../generic/tclExecute.c:1008
#21 0x0833d6ed in TclObjInterpProc (clientData=0xa05d608, interp=0x9f38de0, objc=2, objv=0x9f3aa3c)
    at ../../../insight_sources/tcl/unix/../generic/tclProc.c:1082
#22 0x082e98e1 in TclEvalObjvInternal (interp=0x9f38de0, objc=2, objv=0x9f3aa3c, command=0x0, length=0, flags=0)
    at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3048
---Type <return> to continue, or q <return> to quit---
#23 0x08312050 in TclExecuteByteCode (interp=0x9f38de0, codePtr=0xa14c058) at ../../../insight_sources/tcl/unix/../generic/tclExecute.c:1431
#24 0x0831581d in TclCompEvalObj (interp=0x9f38de0, objPtr=0xa0a9088) at ../../../insight_sources/tcl/unix/../generic/tclExecute.c:1008
#25 0x0833d6ed in TclObjInterpProc (clientData=0x9f5d7a0, interp=0x9f38de0, objc=1, objv=0x9f3aa38)
    at ../../../insight_sources/tcl/unix/../generic/tclProc.c:1082
#26 0x082e98e1 in TclEvalObjvInternal (interp=0x9f38de0, objc=1, objv=0x9f3aa38, command=0x0, length=0, flags=0)
    at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3048
#27 0x08312050 in TclExecuteByteCode (interp=0x9f38de0, codePtr=0xa0b5cf8) at ../../../insight_sources/tcl/unix/../generic/tclExecute.c:1431
#28 0x0831581d in TclCompEvalObj (interp=0x9f38de0, objPtr=0xa0b5c08) at ../../../insight_sources/tcl/unix/../generic/tclExecute.c:1008
#29 0x0833d6ed in TclObjInterpProc (clientData=0xa0d7de8, interp=0x9f38de0, objc=1, objv=0xbfe5db6c)
    at ../../../insight_sources/tcl/unix/../generic/tclProc.c:1082
#30 0x082e98e1 in TclEvalObjvInternal (interp=0x9f38de0, objc=1, objv=0xbfe5db6c, command=0x8373409 "gdbtk_tcl_idle", length=14, flags=0)
    at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3048
#31 0x082e9eaf in Tcl_EvalEx (interp=0x9f38de0, script=0x8373409 "gdbtk_tcl_idle", numBytes=14, flags=0)
    at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3646
#32 0x082ea1ec in Tcl_Eval (interp=0x9f38de0, string=0x8373409 "gdbtk_tcl_idle") at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3811
#33 0x0808cf9c in gdbtk_call_command (cmdblk=0x9f19670, arg=0x0, from_tty=1) at ../../insight_sources/gdb/gdbtk/generic/gdbtk-hooks.c:542
#34 0x08056dd9 in execute_command (p=0xa4b8ec9 "", from_tty=1) at ../../insight_sources/gdb/top.c:453
#35 0x0808be28 in gdb_immediate_command (clientData=0x808bd80, interp=0x9f38de0, objc=3, objv=0x9f3aa2c)
    at ../../insight_sources/gdb/gdbtk/generic/gdbtk-cmds.c:749
#36 0x08087da6 in wrapped_call (opaque_args=0xbfe5dd04) at ../../insight_sources/gdb/gdbtk/generic/gdbtk-cmds.c:420
#37 0x080e8823 in catch_errors (func=0x8087d80 <wrapped_call>, func_args=0xbfe5dd04, errstring=0x8367830 "", mask=6)
    at ../../insight_sources/gdb/exceptions.c:515
#38 0x08087fcc in gdbtk_call_wrapper (clientData=0x808bd80, interp=0x9f38de0, objc=3, objv=0x9f3aa2c)
    at ../../insight_sources/gdb/gdbtk/generic/gdbtk-cmds.c:351
#39 0x082e98e1 in TclEvalObjvInternal (interp=0x9f38de0, objc=3, objv=0x9f3aa2c, command=0x0, length=0, flags=0)
    at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3048
#40 0x08312050 in TclExecuteByteCode (interp=0x9f38de0, codePtr=0xa35c530) at ../../../insight_sources/tcl/unix/../generic/tclExecute.c:1431
#41 0x0831581d in TclCompEvalObj (interp=0x9f38de0, objPtr=0xa14ca40) at ../../../insight_sources/tcl/unix/../generic/tclExecute.c:1008
#42 0x082ea9a9 in Tcl_EvalObjEx (interp=0x9f38de0, objPtr=0xa14ca40, flags=0) at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3944
#43 0x08239a64 in Itcl_EvalMemberCode (interp=0x9f38de0, mfunc=0xa153568, member=0xa153488, contextObj=0x9fd4550, objc=1, objv=0xbfe5e900)
    at /home/gene/4.8.0-rtems/archive/insight_sources/itcl/itcl/generic/itcl_methods.c:1003
#44 0x0823a9ad in Itcl_ExecMethod (clientData=0xa153568, interp=0x9f38de0, objc=1, objv=0xbfe5e900)
    at /home/gene/4.8.0-rtems/archive/insight_sources/itcl/itcl/generic/itcl_methods.c:1516
#45 0x08240805 in Itcl_EvalArgs (interp=0x9f38de0, objc=1, objv=0xbfe5e900)
    at /home/gene/4.8.0-rtems/archive/insight_sources/itcl/itcl/generic/itcl_util.c:1347
#46 0x0823bd1c in Itcl_HandleInstance (clientData=0x9fd4550, interp=0x9f38de0, objc=2, objv=0xbfe5e8fc)
---Type <return> to continue, or q <return> to quit---
    at /home/gene/4.8.0-rtems/archive/insight_sources/itcl/itcl/generic/itcl_objects.c:685
#47 0x082e98e1 in TclEvalObjvInternal (interp=0x9f38de0, objc=2, objv=0xbfe5e8fc, command=0xa507cf0 "::.console0.console invoke; break", length=27,
    flags=0) at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3048
#48 0x082e9eaf in Tcl_EvalEx (interp=0x9f38de0, script=0xa507cf0 "::.console0.console invoke; break", numBytes=33, flags=0)
    at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3646
#49 0x082ea1ec in Tcl_Eval (interp=0x9f38de0, string=0xa507cf0 "::.console0.console invoke; break")
    at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:3811
#50 0x082ea286 in Tcl_GlobalEval (interp=0x9f38de0, command=0xa507cf0 "::.console0.console invoke; break")
    at ../../../insight_sources/tcl/unix/../generic/tclBasic.c:5261
#51 0x082ce6f7 in Tk_BindEvent (bindingTable=0x9f622e0, eventPtr=0xa5122f0, tkwin=0xa186f88, numObjects=0, objectPtr=0xbfe5ed7c)
    at /home/gene/4.8.0-rtems/archive/insight_sources/tk/unix/../generic/tkBind.c:1805
#52 0x082d2784 in TkBindEventProc (winPtr=0xa186f88, eventPtr=0xa5122f0)
    at /home/gene/4.8.0-rtems/archive/insight_sources/tk/unix/../generic/tkCmds.c:287
#53 0x0824f3bd in Tk_HandleEvent (eventPtr=0xa5122f0) at /home/gene/4.8.0-rtems/archive/insight_sources/tk/unix/../generic/tkEvent.c:1017
#54 0x0824f9a2 in WindowEventProc (evPtr=0xa5122e8, flags=<value optimized out>)
    at /home/gene/4.8.0-rtems/archive/insight_sources/tk/unix/../generic/tkEvent.c:1399
#55 0x083339c0 in Tcl_ServiceEvent (flags=-3) at ../../../insight_sources/tcl/unix/../generic/tclNotify.c:622
#56 0x08333c67 in Tcl_DoOneEvent (flags=-3) at ../../../insight_sources/tcl/unix/../generic/tclNotify.c:861
#57 0x0824e990 in Tk_MainLoop () at /home/gene/4.8.0-rtems/archive/insight_sources/tk/unix/../generic/tkEvent.c:1457
#58 0x0805024b in captured_command_loop (data=0x0) at ../../insight_sources/gdb/main.c:101
#59 0x080e8823 in catch_errors (func=0x8050240 <captured_command_loop>, func_args=0x0, errstring=0x8367830 "", mask=6)
    at ../../insight_sources/gdb/exceptions.c:515
#60 0x080509e4 in captured_main (data=0xbfe5f0b4) at ../../insight_sources/gdb/main.c:826
#61 0x080e8823 in catch_errors (func=0x8050280 <captured_main>, func_args=0xbfe5f0b4, errstring=0x8367830 "", mask=6)
    at ../../insight_sources/gdb/exceptions.c:515
#62 0x08050231 in gdb_main (args=0xbfe5f0b4) at ../../insight_sources/gdb/main.c:835
#63 0x080501f5 in main (argc=Cannot access memory at address 0x1c
) at ../../insight_sources/gdb/gdbtk/generic/gdbtk-main.c:36
(gdb)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]