[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Really weird things happening in Guile/GDB
From: |
Mikael Djurfeldt |
Subject: |
Really weird things happening in Guile/GDB |
Date: |
Wed, 19 Sep 2001 22:10:33 +0200 |
Hi Jim,
I've experienced something really weird while running and debugging
Guile in GDB. I thought maybe I could run this by you since you've
been working on GDB.
It all started with Guile getting hung during one of the first garbage
collections. It turned out that it got into an infinity loop in
scm_i_dbl2big due to this function being passed a NAN from
scm_gc_stats.
When tracking down where this NAN got created, it was at the statement
marked below within gc.c:gc_end_stats. I could set a watchpoint on
the double scm_gc_cells_marked_acc, and could see
scm_gc_cells_marked_acc change from 0 to -nan(0x8000000000000) when
adding the difference between the ulong scm_gc_cells_swept=0x6f58 and
the ulong scm_gc_cells_collected=0x350d at the line marked with =>.
static void
gc_end_stats ()
{
unsigned long t = scm_c_get_internal_run_time ();
scm_gc_time_taken += (t - t_before_gc);
scm_gc_sweep_time_taken += (t - t_before_sweep);
++scm_gc_times;
=>scm_gc_cells_marked_acc += scm_gc_cells_swept - scm_gc_cells_collected;
scm_gc_cells_swept_acc += scm_gc_cells_swept;
}
Of course I expected a compiler bug (am using gcc version 2.95.4
20010902 (Debian prerelease)), so I looked at the assembler output,
which looks completely OK:
----------------------------------------------------------------------
gc_end_stats:
.LBB14:
pushl %ebp
movl %esp,%ebp
subl $28,%esp
pushl %edi
pushl %esi
pushl %ebx
call .L316
.L316:
popl %ebx
addl $_GLOBAL_OFFSET_TABLE_+[.-.L316],%ebx
.stabn 68,0,875,.LM135-gc_end_stats
.LM135:
call address@hidden
movl %eax,%ecx
.stabn 68,0,876,.LM136-gc_end_stats
.LM136:
movl address@hidden(%ebx),%eax
movl %ecx,%edx
subl address@hidden(%ebx),%edx
addl %edx,(%eax)
.stabn 68,0,877,.LM137-gc_end_stats
.LM137:
movl address@hidden(%ebx),%eax
subl address@hidden(%ebx),%ecx
addl %ecx,(%eax)
.stabn 68,0,878,.LM138-gc_end_stats
.LM138:
movl address@hidden(%ebx),%eax
incl (%eax)
.stabn 68,0,884,.LM139-gc_end_stats
.LM139:
movl address@hidden(%ebx),%esi
movl address@hidden(%ebx),%edi
movl (%edi),%eax
movl (%esi),%edx
subl %eax,%edx
movl %edx,%eax
xorl %edx,%edx
movl %eax,-8(%ebp)
movl %edx,-4(%ebp)
fildll -8(%ebp)
movl address@hidden(%ebx),%ecx
faddl (%ecx)
.stabn 68,0,885,.LM140-gc_end_stats
.LM140:
addl $-12,%esp
leal address@hidden(%ebx),%eax
.stabn 68,0,884,.LM141-gc_end_stats
.LM141:
fstpl (%ecx)
.stabn 68,0,885,.LM142-gc_end_stats
.LM142:
pushl (%edi)
pushl (%esi)
pushl 4(%ecx)
pushl (%ecx)
pushl %eax
call address@hidden
.stabn 68,0,887,.LM143-gc_end_stats
.LM143:
movl (%esi),%eax
xorl %edx,%edx
movl %eax,-8(%ebp)
movl %edx,-4(%ebp)
fildll -8(%ebp)
movl address@hidden(%ebx),%ecx
faddl (%ecx)
fstpl (%ecx)
leal -40(%ebp),%esp
popl %ebx
popl %esi
popl %edi
leave
ret
.stabn 68,0,888,.LM144-gc_end_stats
.LM144:
.LBE14:
.Lfe13:
.size gc_end_stats,.Lfe13-gc_end_stats
.stabs "t:r(0,5)",64,0,875,1
.stabn 192,0,0,.LBB14-gc_end_stats
.stabn 224,0,0,.LBE14-gc_end_stats
.Lscope12:
.stabs "",36,0,0,.Lscope12-gc_end_stats
----------------------------------------------------------------------
What on Earth might be going on???
Mikael (who was debugging using GNU gdb 5.0.90-cvs (MI_OUT) on an
i686-pc-linux-gnu)
- Really weird things happening in Guile/GDB,
Mikael Djurfeldt <=