[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swarm-Support] SWARM;SantaFE Stock Market
From: |
Paul Johnson |
Subject: |
Re: [Swarm-Support] SWARM;SantaFE Stock Market |
Date: |
Sun, 01 Apr 2007 20:59:28 -0500 |
User-agent: |
Thunderbird 1.5.0.10 (X11/20070302) |
Marcus G. Daniels wrote:
Steve Railsback wrote:
(The code compiled in Fedora, but it immediately crashed with an
obscure buffer overflow.)
Toward the end of the method -createTimePlots in Output.m on line 318
the character array `name[10]' is defined.
Make it `name[20]' and this crash should go away. It does for me.
It's a stack overflow problem that corrupts the variable asmModelParams
on line 150 of ASMObserverSwarm.m.
OK, this banter caused my brain to engage. I think I saw these problems
before sometime, and thought I had fixed them back then, but must have
forgotten.
Marcis is certainly right about the overflow. I notice the new-ish gcc
gives much better warnings than it did in 2003 when I worked on this the
last time. Check this out, where it points exactly at the offender:
gcc -c -g -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386
-mtune=generic -fasynchronous-unwind-tables -fgnu-runtime
-fno-strict-aliasing -Wall -Wno-import -Wno-protocol -Wno-long-long
-D_GNU_SOURCE -DAPPNAME=asm -DAPPVERSION=2.1.1
address@hidden -I/usr/include/swarm Output.m
Output.m: In function ‘-[Output createTimePlots]’:
Output.m:319: warning: call to __builtin___sprintf_chk will always
overflow destination buffer
Output.m:320: warning: call to __builtin___sprintf_chk will always
overflow destination buffer
Output.m:321: warning: call to __builtin___sprintf_chk will always
overflow destination buffer
Output.m:322: warning: call to __builtin___sprintf_chk will always
overflow destination buffer
I'll fix up this one and the other thing that was mentioned concerning
random and make a new post on Sourceforge. I am going to try to re-learn
how to put an updated ASM on Sourceforge.
Until I figure that out, the new one is posted here:
http://pj.freefaculty.org/Swarm/MySwarmCode/ASM-2.4.1.tar.gz
Funny how time flies. I notice now that my CVS from that program is all
hacked up with something I was working on during the week when the US
invaded Iraq the second time, so you imagine it might take me a while to
figure it out. I'm sure I was doing some updates to comply with gcc
warnings, but most of those annoying spurious warnings seem to have gone
away.
I hasten to mention that this does not address the original author's
question about AgentManager, because that is in the Objective C version
of ASM that was written for NeXT, and I think in that one it is really
necessary to rename, rather than comment out the random usage. But that
one never was my primary interest, I only posted it because I knew some
people were trying to understand lots of subtle parameter changes.
--
Paul E. Johnson email: address@hidden
Professor, Political Science http://pj.freefaculty.org
1541 Lilac Lane, Rm 504
University of Kansas Office: (785) 864-9086
Lawrence, Kansas 66044-3177 FAX: (785) 864-5700
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Swarm-Support] SWARM;SantaFE Stock Market,
Paul Johnson <=