swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swarm-Support] I have the strangest seg fault (ever)!


From: Paul Johnson
Subject: [Swarm-Support] I have the strangest seg fault (ever)!
Date: Fri, 15 Apr 2005 11:05:33 -0500
User-agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324)

In Fedora Core 3, the tcl/tk has been a little unpredictable for me. The problem of saving screen shots when the widget is set to nil made me think it was just bogus. But now I have a different problem and I don't think it is tcl/tk, but rather I think I've make a memory allocation error. I need some program to help me diagnose it. Is there some thing like "gdb" where I can compile with stronger range checking or something?

The segfault happens when I add new agents through the GUI.

I get the seg fault while using the Swarm tck/tk gui to type in a value for a starting position and push the button to add an agent into a simulation, but if I schedule that same action inside the code and create agents every now and then, then there is no seg fault. That is why I suspected something wrong in tcl/tk. But, the segfault does not always happen on the very first use of the button. When the parameters are different, the segfault appears differently. If I start the model with 5 agents, it crashes every time, but if I start with 13, it does not crash until I use the GUI to add 3 or 4 agents. But, without using the GUI, I can add an infinite number.

It reminds me of when I had a C program in which I allocated a character array of size 10 and then used sprintf to write 20 characters into that array. It would seg fault in completely unpredictable places, and the backtrace did not point at the place where I had the mistake, but rather at the command that was trying to get memory and precipitated the crash because it conflicted with the out-of-range access.

Here's the bt.

(gdb) bt
#0  0x464bdca3 in strlen () from /lib/tls/libc.so.6
#1  0x46492155 in vfprintf () from /lib/tls/libc.so.6
#2  0x464a9fbb in vsprintf () from /lib/tls/libc.so.6
#3  0xb7edcb97 in fix_tcl_path () from /usr/lib/swarm/libswarm.so.0
#4  0xb7ecdd20 in stringIsFalse () from /usr/lib/swarm/libswarm.so.0
#5 0xb7e8b348 in swarm_force_references () from /usr/lib/swarm/libswarm.so.0 #6 0xb7e8b88b in swarm_force_references () from /usr/lib/swarm/libswarm.so.0 #7 0x08055e90 in -[Output createSequencesParty:] (self=0x82b4160, _cmd=0x805e3a0, i=5)
    at Output.m:980
#8 0x080563a1 in -[Output addNewPartyAt:] (self=0x82b4160, _cmd=0x80812f0, x=0)
    at Output.m:1047
#9  0xb7f18acb in __builtin_avcall () from /usr/lib/swarm/libswarm.so.0
#10 0xb7f1748c in objc_call () from /usr/lib/swarm/libswarm.so.0
#11 0xb7f10968 in updateTarget () from /usr/lib/swarm/libswarm.so.0
#12 0xb7ee3027 in TclObjc_Init () from /usr/lib/swarm/libswarm.so.0
#13 0xb7e92b04 in swarm_force_references () from /usr/lib/swarm/libswarm.so.0
#14 0xb7f18acb in __builtin_avcall () from /usr/lib/swarm/libswarm.so.0
#15 0xb7f1748c in objc_call () from /usr/lib/swarm/libswarm.so.0
#16 0xb7f10968 in updateTarget () from /usr/lib/swarm/libswarm.so.0
#17 0xb7ede1eb in tclObjc_msgSendToClientData () from /usr/lib/swarm/libswarm.so.0 #18 0xb7ede88b in tclObjc_msgSendToArgv1 () from /usr/lib/swarm/libswarm.so.0
#19 0x467b0e3c in TclInvokeStringCommand () from /usr/lib/libtcl8.4.so
#20 0x467b2708 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so
#21 0x467b3d50 in Tcl_EvalEx () from /usr/lib/libtcl8.4.so
#22 0x467b4870 in Tcl_EvalObjEx () from /usr/lib/libtcl8.4.so
---Type <return> to continue, or q <return> to quit---
#23 0x4680a5c6 in Tcl_UplevelObjCmd () from /usr/lib/libtcl8.4.so
#24 0x467b2708 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so
#25 0x467dd2ff in TclExprFloatError () from /usr/lib/libtcl8.4.so
#26 0x467e0bb5 in TclCompEvalObj () from /usr/lib/libtcl8.4.so
#27 0x4680ada7 in TclObjInterpProc () from /usr/lib/libtcl8.4.so
#28 0x467b2708 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so
#29 0x467b2564 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so
#30 0x467dd2ff in TclExprFloatError () from /usr/lib/libtcl8.4.so
#31 0x467e0bb5 in TclCompEvalObj () from /usr/lib/libtcl8.4.so
#32 0x467b48a8 in Tcl_EvalObjEx () from /usr/lib/libtcl8.4.so
#33 0x466d0612 in TkInvokeButton () from /usr/lib/libtk8.4.so
#34 0x466d174a in Tk_ButtonObjCmd () from /usr/lib/libtk8.4.so
#35 0x467b2708 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so
#36 0x467b4672 in Tcl_EvalObjv () from /usr/lib/libtcl8.4.so
#37 0x467b496d in Tcl_EvalObjEx () from /usr/lib/libtcl8.4.so
#38 0x4680a5c6 in Tcl_UplevelObjCmd () from /usr/lib/libtcl8.4.so
#39 0x467b2708 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so
#40 0x467dd2ff in TclExprFloatError () from /usr/lib/libtcl8.4.so
#41 0x467e0bb5 in TclCompEvalObj () from /usr/lib/libtcl8.4.so
#42 0x4680ada7 in TclObjInterpProc () from /usr/lib/libtcl8.4.so
#43 0x467b2708 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so
#44 0x467b3d50 in Tcl_EvalEx () from /usr/lib/libtcl8.4.so
#45 0x467b41c0 in Tcl_Eval () from /usr/lib/libtcl8.4.so
#46 0x467b4b07 in Tcl_GlobalEval () from /usr/lib/libtcl8.4.so
#47 0x46691627 in Tk_BindEvent () from /usr/lib/libtk8.4.so

--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
1541 Lilac Lane, Rm 504
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700


reply via email to

[Prev in Thread] Current Thread [Next in Thread]