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 Winkelmann
Subject: Re: [Chicken-users] Calling out to C causing hang
Date: Mon, 07 Apr 2003 14:01:58 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530

Chris Double wrote:
On Mon, 07 Apr 2003 21:38, Tony Garnock-Jones wrote:

Wow. For me, that's a big ask - the GTK+ stuff was locking up on the
final GC before exit...


I can get it to happen almost immediately. I've got gdb going now so I'll dig into it when I get a chance. From a casual inspection with gdb it looks like saved_stack_limit and C_stack_limit are being set to very similar values (sometimes equal) which is causing the infinite loop when C_stack_probe is checked in the C code of functions. This causes C_save_and_reclaim to be called.

From the looks of things C_stack_limit is supposed to be set to some value to
cause a collection when C_raise_interrupt is called (because it's the collection that results in the interrupt being handled). The old value is saved in saved_stack_limit to restore later.

When handle_interrupt is run, then C_stack_limit is restored to saved_stack_limit. If these values are the same or sufficiently similar then an inifinte loop of collections results.

How to find out how they get that way is the problem...


This situation can arise when the interrupt is triggered and
at the same time the stack is exhausted.
But normally, the minor GC after the interrupt-handling (when
the *next* C_stack_probe() sees the need for a minor GC) should
clean up the stack.

Where does the invocation of C_stack_probe() that starts the loop
occur? In ##sys#interrupt-hook (library.c)?


cheers,
felix





reply via email to

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