swarm-support
[Top][All Lists]
Advanced

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

Why can't I create a zero length array


From: Kevin Crowston
Subject: Why can't I create a zero length array
Date: Mon, 16 Jun 1997 16:15:26 -0500

Creating a zero-length array appears to be illegal.  This appears to be a
bug, as the documentation says of count that "Any non-negative value
including zero is valid." (from
http://www.santafe.edu/projects/swarm/swarmdocs/src/collections/Array.html).
I'm using 1.0.0, but the release notes for later versions don't seem to
mention this problem.  (I'll download 1.0.2 anyway.)

Here's the backtrace:

*** event raised for error: InvalidAllocSize
*** function: _i_Zone_c__allocBlock_(), file: Zone.m, line: 296
> Requested allocation size must be at least one byte.
> (Requested allocation size was zero.)
*** execution terminating due to error

Program received signal SIGABRT, Aborted.
0xef5b40d8 in kill ()w
(gdb) where
#0  0xef5b40d8 in kill ()
#1  0xef57a584 in abort ()
#2  0x5a668 in -[Error(c) _raiseEvent:] (self=0x13c698, _cmd=0x17ea64,
    eventData=0x0) at Symbol.m:167
#3  0x59ba4 in -[Zone(c) _allocBlock:] (self=0x208520, _cmd=0x17b430,
    size=0) at Zone.m:296
#4  0x4f33c in initArray (self=0x231f78) at Array.m:104
#5  0x4fcc4 in +[Array(c) _create:setCount:] (self=0x231f78,
    _cmd=0x16d768, aZone=0x208520, memberCount=0) at Array.m:66
#6  0x27aec in -[Subproblem setAllNodes] (self=0x231f28, _cmd=0x16d6e8)
    at Hint.m:85
#7  0x29240 in +[Subproblem create:fromProblem:] (self=0x16d6a8,
    _cmd=0x16d0cc, aZone=0x208520, aProblem=0x229288) at Hint.m:32
#8  0x26448 in -[TSPModelSwarm buildObjects] (self=0x208558,
    _cmd=0x16d0a4) at TSPModelSwarm.m:300
#9  0x247f0 in -[TSPObserverSwarm buildObjects] (self=0x1ebb30,
    _cmd=0x16c6a4) at TSPObserverSwarm.m:134
#10 0x24108 in main (argc=3, argv=0xeffff0d4) at main.m:59

Kevin



                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

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