swarm-support
[Top][All Lists]
Advanced

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

Re: [Swarm-Support] Re:Cannot access memory 0x2000000


From: Paul Johnson
Subject: Re: [Swarm-Support] Re:Cannot access memory 0x2000000
Date: Mon, 15 Nov 2004 10:37:42 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922

THe last time I tried really hard to make this work nicely in windows, I found the performance of gdb to be a bit spotty. Sometimes the crash does not return a valid backtrace.

As a result, I stopped trying to use Windows, but before I gave up, I did write down this info:

http://www.ku.edu/~pauljohn/SwarmFaq/Memos/GDBUsage01.txt
http://www.ku.edu/~pauljohn/SwarmFaq/Memos/GDBUsage02.txt

This one has other examples.

http://www.ku.edu/~pauljohn/SwarmFaq/Memos/GDBusageExamples.txt

Apologies in advance that this is not more up to date. Honestly, I've just learned to be a better proof-reader of code so I can spot the usualy memory related problems more easily. Most likely culprits are:


1. You read "off the edge" of a grid or array (below offset 0 or above N-1)
2. You grab a nil object and try to tell it to do something (as in getObject ... in a grid)

Because of memory problems, I gave up on the idea of having the Swarm itself run experiments over and over. It is much more manageable to run the model one time, then re-start. Command line parameters and some scripting tools combine to make that a very effective strategy.

pj


Bill Northcott wrote:
Hi Xiaojun

If you are properly running the code under gdb (see the GDB manual) then when it breaks you will get the error message followed by a gdb prompt. Typing bt at that prompt will give you a dump of the call frame stack. It does not make sense to get nothing. You need a version of gdb that understands Objective-C. With other versions you will get a back trace but it is harder to understand.

Your gdb session should look something like this:
[PBG4-BN:apps/objc/heatbugs] billn% gdb yourprogram
GNU gdb 5.3-20030128 (Apple version gdb-330.1) (Fri Jul 16 21:42:28 GMT 2004)
Copyright 2003 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 "powerpc-apple-darwin".
Reading symbols for shared libraries ........... done
(gdb) run
Starting program: /Somepath/yourprograms
Reading symbols for shared libraries +++......................................................... done
error: cannot access memory 0x2000000

Program received signal SIGABRT, Aborted.
0x900429ac in kill ()
(gdb) bt
#0  0x900429ac in kill ()
#1  0x9009eb1c in abort ()
#2 0x01837004 in objc_verror (object=0x115d340, code=0, fmt=0xbffff570 "error: TkExtra (instance)\n\n", ap=0xbffff5f4 "\001\206\212T") at ../../../libobjc/misc.c:66 #3 0x0182de14 in -[Object error:] (self=0x115d340, _cmd=0x187f9c4, aString=0xa089d0c "") at ../../../libobjc/Object.m:345 #4 0x01765c90 in -[TkInterp preInitWithArgc:argv:] (self=0x115d340, _cmd=0x187f194, argc=1, argv=0x113bc38) at ../../../../src/tclobjc/TkInterp.m:177 #5 0x01752338 in -[TkExtra preInitWithArgc:argv:] (self=0x115d340, _cmd=0x187f6e4, argc=1, argv=0x113bc38) at ../../../../src/tkobjc/TkExtra.m:99 #6 0x017617e8 in -[TclInterp initWithArgc:argv:] (self=0x115d340, _cmd=0x187f9cc, argc=1, argv=0x113bc38) at ../../../../src/tclobjc/TclInterp.m:301 #7 0x01765e4c in -[TkInterp initWithArgc:argv:] (self=0x115d340, _cmd=0x187f568, argc=1, argv=0x113bc38) at ../../../../src/tclobjc/TkInterp.m:197 #8 0x01759afc in tkobjc_initTkInterp (arguments=0x113b648) at ../../../../src/tkobjc/internal.m:154 #9 0x01758d84 in initTkObjc (arguments=0x113b648) at ../../../../src/tkobjc/tkobjc.m:50 #10 0x016b5d4c in initSimtoolsGUI () at ../../../../src/simtoolsgui/simtoolsgui.m:31 #11 0x01697c5c in -[SwarmEnvironment createEnd] (self=0x113b1d8, _cmd=0x187b0d0) at ../../../src/SwarmEnvironment.m:151 #12 0x01698bb8 in _initSwarm_ (argc=1, argv=0xbffffbdc, appName=0x947c "heatbugs", version=0x9488 "2.1.1", bugAddress=0x9490 "address@hidden", argumentsClass=0x0, options=0x0, optionFunc=0, forceBatchMode=0 '\000', inhibitExecutableSearchFlag=0 '\000') at ../../../src/SwarmEnvironment.m:339
#13 0x0000456c in main (argc=1, argv=0xbffffbdc) at main.m:22
(gdb)

What you need to look at is that call frame stack.

Bill

On 13/11/2004, at 2:22 PM, ºúС¾ü wrote:

hi,Bill

Thanks for your answer.
I run the experiment model under gdb and after the programe crash, I did a
backtrace through bt and the only information i got was:
cannot access memory 0x2000000,nothing else.
I could not find the pointer which got the wrong value through (gdb) bt.
I am not sure if I need to add some parameters for example -d(?) to allow gdb to
debug the process.
I'd have a try.

 Best regards!

 HU Xiaojun
 Tsinghua University
 Beijing, China


_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support



_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support


--
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]