chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH] Fix seemingly random crashes in foreign callba


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Fix seemingly random crashes in foreign callbacks (#1337)
Date: Wed, 28 Dec 2016 19:18:33 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

Hi all,

The attached patch fixes #1337, which has exactly the same root cause as
the "Salmonella crashes a lot" issue we struggled with back in 2015:
http://lists.gnu.org/archive/html/chicken-hackers/2015-10/msg00001.html

I guess we never noticed this because the circumstances are relatively
rare:  You have to use a foreign callback which calls code that triggers
a GC, and this GC needs to happen before the argvector is copied onto
the stack by an intermediate function that happens to call another
function with a larger number of arguments.

I don't know how to make a test case for this that reliably triggers the
error.  The test case from the ticket happens to trigger it now, but it
might not in the future.

I also noticed that when the stack is full in C_allocate_vector, we call
C_reclaim(allocate_vector_2, c), but we save one more thing than the
number of arguments allocate_vector takes.

Cheers,
Peter

Attachment: 0001-Fix-crashes-in-callbacks-after-GC-1337.chicken-5.patch
Description: Text Data

Attachment: 0001-Fix-crashes-in-callbacks-after-GC-1337.master.patch
Description: Text Data

Attachment: signature.asc
Description: Digital signature


reply via email to

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