bug-guile
[Top][All Lists]
Advanced

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

object->string can lead to scm_mallocated underflow


From: Bill Schottstaedt
Subject: object->string can lead to scm_mallocated underflow
Date: Thu, 10 May 2001 04:19:12 -0700

I think there is an "scm_mallocated leak" in association with object->string.
I ran into this while running a long debugging pass that was calling 
scm_object_to_string
millions of times; eventually the program exited at line 1023 in gc.c (where
it thinks scm_mallocated has underflowed). In fact, nm (an unsigned long in
scm_must_malloc) had gone over 2^31, turning on the sign bit in scm_mallocated.

The following will (eventually) get this bug in the standard CVS guile:

/home/bil/cl/ gdb ../test/bin/guile
GNU gdb 5.0rh-5 Red Hat Linux 7.1
(gdb) run
Starting program: /home/bil/cl/../test/bin/guile
guile> (version)
"1.5.0"
guile> (do ((i 0 (1+ i))) ((= i 30000000)) (object->string (list 1 2)))

Program received signal SIGABRT, Aborted.
0x40136801 in __kill () from /lib/i686/libc.so.6
(gdb) where
#0  0x40136801 in __kill () from /lib/i686/libc.so.6
#1  0x401365da in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x40137d82 in abort () at ../sysdeps/generic/abort.c:88
#3  0x40049c93 in scm_igc (what=0x4009675d "cells") at gc.c:1023
#4  0x40049bc9 in scm_gc_for_newcell (master=0x4009dc60, freelist=0x4009dc58)
    at gc.c:939
#5  0x40031a38 in scm_acons (key=1076308232, value=1076703048,
    alist=1076309056) at alist.c:70
#6  0x4004349c in scm_deval (x=1076308200, env=1076703272) at eval.c:2077
#7  0x400420b3 in scm_i_eval (exp=1076310088, env=1076309056) at eval.c:3921
#8  0x40042166 in scm_primitive_eval (exp=1076310088) at eval.c:3946
#9  0x40045831 in scm_deval (x=10612, env=1076309504) at eval.c:2775
#10 0x400420b3 in scm_i_eval (exp=1076145792, env=1076309504) at eval.c:3921
#11 0x400357d4 in scm_start_stack (id=134744128, exp=1076145792,
    env=1076309504) at debug.c:535
#12 0x40035877 in scm_m_start_stack (exp=1076145824, env=1076309504)
    at debug.c:551
#13 0x40046aed in scm_dapply (proc=134664096, arg1=1076145824, args=1076309080)
    at eval.c:3389
...
(gdb)
(gdb) up 3
#3  0x40049c93 in scm_igc (what=0x4009675d "cells") at gc.c:1023
1023        abort ();
(gdb) info locals
j = 1074388032
(gdb) p scm_mallocated
$1 = -2147191230
(gdb) p scm_mtrigger
$2 = 2993537278

(It's not a memory leak -- I didn't see any increase in the core size).



reply via email to

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