On Tue, Mar 10, 2009 at 02:19:56PM +0100, felix winkelmann wrote:
> On Mon, Mar 9, 2009 at 3:43 PM, Taylor Venable <tay...@metasyntax.net> wrote:
> >
> > The bug becomes more and more phantasmagorical!
> >
> > When initially compiling chicken-boot with "make PLATFORM=linux
> > DEBUGBUILD=yes bootstrap" the bug does not appear.
> >
> > When using -:d OR -:s500k OR -:s1m the bug does not appear.
> >
> > When run inside GDB (even without debugging symbols) the bug does not
> > appear.
> 
> When invalid data leaks into the garbage collector (and GC's happen
> very frequently in chicken), the effects are always interesting and 
> effectively
> non-deterministic. Giving an extra command-line option will allocate storage,
> which will slightly shift the moment GC happens, which will lead to another
> interesting effect. Debugging these bugs is very instructive.
> 
> Try to trigger a crash or loop inside gdb by using different -:s settings.

Well I was able to trigger a hang in my build with the debugging
symbols by setting the nursery stack size to 10k.  Debug log from GDB
is attached.  The three entries here were taken from allowing the
program to run for varying periods of time.  The behaviour I got
spiked the CPU but the memory usage did not increase visibly.  Hope
this sheds a little more light; if not let me know and I can go back
at it.  (I notice here that the proc parameter to C_reclaim is the
null pointer, don't know if that's meaningful or not...)

-- 
Taylor Christopher Venable
http://real.metasyntax.net:2357/
(gdb) run utils.scm -quiet -no-trace -optimize-level 2 -include-path . 
-include-path ./ -explicit-use -output-file utils.c -:s10k
Starting program: /home/taylor/Desktop/chicken-3.4.7-DEBUG/chicken-boot 
utils.scm -quiet -no-trace -optimize-level 2 -include-path . -include-path ./ 
-explicit-use -output-file utils.c -:s10k
^C
Program received signal SIGINT, Interrupt.
0x00000000008411a2 in mark (x=0xeb05e8) at runtime.c:3044
3044      val = *x;
(gdb) bt
#0  0x00000000008411a2 in mark (x=0xeb05e8) at runtime.c:3044
#1  0x000000000084054a in C_reclaim (trampoline=0x5b3699, proc=0x0)
    at runtime.c:2806
#2  0x00000000005b378c in C_library_toplevel (c=2, t0=30, t1=139900129233496)
    at library.c:6618
#3  0x00000000005b36c9 in toplevel_trampoline (dummy=0x0) at library.c:6242
#4  0x000000000083d0be in CHICKEN_run (toplevel=0x0) at runtime.c:1362
#5  0x000000000083b1a5 in CHICKEN_main (argc=14, argv=0x7fff1186fae8, 
    toplevel=0x403faa) at runtime.c:577
#6  0x0000000000403f78 in main (argc=14, argv=0x7fff1186fae8) at chicken.c:1945
(gdb) run utils.scm -quiet -no-trace -optimize-level 2 -include-path . 
-include-path ./ -explicit-use -output-file utils.c -:s10k
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /home/taylor/Desktop/chicken-3.4.7-DEBUG/chicken-boot 
utils.scm -quiet -no-trace -optimize-level 2 -include-path . -include-path ./ 
-explicit-use -output-file utils.c -:s10k
^C
Program received signal SIGINT, Interrupt.
0x00000000008411aa in mark (x=0x1ef15f0) at runtime.c:3046
3046      if(C_immediatep(val)) return;
(gdb) bt
#0  0x00000000008411aa in mark (x=0x1ef15f0) at runtime.c:3046
#1  0x000000000084055a in C_reclaim (trampoline=0x5b3699, proc=0x0)
    at runtime.c:2807
#2  0x00000000005b378c in C_library_toplevel (c=2, t0=30, t1=140380082637400)
    at library.c:6618
#3  0x00000000005b36c9 in toplevel_trampoline (dummy=0x0) at library.c:6242
#4  0x000000000083d0be in CHICKEN_run (toplevel=0x0) at runtime.c:1362
#5  0x000000000083b1a5 in CHICKEN_main (argc=14, argv=0x7fffd0faa228, 
    toplevel=0x403faa) at runtime.c:577
#6  0x0000000000403f78 in main (argc=14, argv=0x7fffd0faa228) at chicken.c:1945
(gdb) run utils.scm -quiet -no-trace -optimize-level 2 -include-path . 
-include-path ./ -explicit-use -output-file utils.c -:s10k
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program: /home/taylor/Desktop/chicken-3.4.7-DEBUG/chicken-boot 
utils.scm -quiet -no-trace -optimize-level 2 -include-path . -include-path ./ 
-explicit-use -output-file utils.c -:s10k
^C
Program received signal SIGINT, Interrupt.
0x0000000000840580 in C_reclaim (trampoline=0x5b3699, proc=0x0)
    at runtime.c:2805
2805      for(tinfo = trace_buffer; tinfo < trace_buffer_limit; ++tinfo) {
(gdb) bt
#0  0x0000000000840580 in C_reclaim (trampoline=0x5b3699, proc=0x0)
    at runtime.c:2805
#1  0x00000000005b378c in C_library_toplevel (c=2, t0=30, t1=140472330148440)
    at library.c:6618
#2  0x00000000005b36c9 in toplevel_trampoline (dummy=0x0) at library.c:6242
#3  0x000000000083d0be in CHICKEN_run (toplevel=0x0) at runtime.c:1362
#4  0x000000000083b1a5 in CHICKEN_main (argc=14, argv=0x7fff4b5c0838, 
    toplevel=0x403faa) at runtime.c:577
#5  0x0000000000403f78 in main (argc=14, argv=0x7fff4b5c0838) at chicken.c:1945

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to