MOO-cows Mailing List Archive


Re: Panic with 1.7.9p2

Amy Bruckman writes:
> In MOO 1.7.9p2, we got a repeatable panic with an out-of-control, suspending,
> tail-recursive function in an infinite loop.  I suppose "don't do that!"  is
> a reasonable reply...  :-) but I thought it was supposed to bomb out with a
> 'too much recursion' traceback, not a db panic.
>    5 mymalloc ["storage.c":79, 0x12002c90c]
>    6 new_list ["list.c":43, 0x12001cff8]
>    7 sublist ["list.c":194, 0x12001dba8]
>    8 run ["execute.c":890, 0x12001829c]
> Mar  6 16:06:44: *** PANIC: memory allocation (size 8389056) failed!
> Mar  6 16:06:44: #89:recurse_on_sub_expressions, line 22:  server panic

You ran out of memory, not stack space, as Andy pointed out.  From the C stack
trace, it was trying to allocate a sub-list of some rather large list.  This
being an Alpha, each list element is 16 bytes, so you're trying to make a
*sublist* that's 524,315 elements long (for those who are redoing the math,
remember to subtract one element for the list-length pseudo-element).  Judging
from the verb name, my guess is that you've got another copy of (something
slightly larger than) this list at each level of the MOO stack, for a total of
something like 25 * 8 meg = 200 megabytes of memory.

Don't do that.  Either rewrite your code as iterative, overwriting the list at
each stage, figure out why you're trying to manipulate such huge values in a
simple interpreted language, and/or be sure to destroy all references to the
`old', slightly larger value before going on to manipulate the `new' one.


Follow-Ups: References:

Home | Subject Index | Thread Index