chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Calling out to C causing hang


From: felix
Subject: Re: [Chicken-users] Calling out to C causing hang
Date: Sun, 06 Apr 2003 23:40:43 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020529

Chris Double wrote:
On Sun, 06 Apr 2003 14:18, Chris Double wrote:

On Sun, 06 Apr 2003 13:37, address@hidden wrote:

I have seen similar "lock ups" - in my case the CPU went to 100% in
use. It turned out to be a loop in the (minor?) garbage collector,
repeating the collection infinitely.

This sounds like the problem. My CPU goes up to 100% also. Are you able to
provide a pointer to what functions to look at that might be looping so I
can confirm?


I can confirm that this is definitely my problem. Chicken gets stuck calling C_reclaim over and over. My scheme code looks something like:

(let loop ()
   c_func()
   (loop))

c_func gets called many times and with many minor and the odd major collection occuring. Then at one point handle_interrupt is called in C_reclaim and that's when things go funny. As soon as that happens chicken gets stuck in a loop performing minor collections.

I'm now tracking down why handle_interrupt got called, what it does and why it should cause the problem.


When interrupts are triggered (by UNIX signals, or by a timer-interrupt, that
means, by C_check_for_interrupt), the current nursery-pointer is set above the
nursery-limit. This will cause a minor GC (on the next nursery-check), which
in turn will see that an interrupt has been triggered.

handle_interrupt is only called by C_raise_interrupt. C_raise_interrupt is
either called by C_check_for_interrupt(in chicken.h) or by UNIX signal-
handlers.

Perhaps the interrupt-handling code somehow triggers an interrupt itself.
Are you using finalizers? Or multithreading?
The best way of tackling this seems to be to walk through the whole
thing with gdb, setting breakpoints in handle_interrupt and C_raise_interrupt
(and C_reclaim). It would be nice if you could send me the gdb output starting
from the point where handle_interrupt is called and up to the minor GC
loop.


cheers,
felix





reply via email to

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