On Tue, Jun 26, 2012 at 09:56:51PM +0200, Peter Bex wrote: > The attached patch is a hack, but it makes the error go away because it > allows the heap size to keep up with the mutation stack size. It doesn't > take care of the size of the live finalizers, and it mutates heap_size in > such a way that you can't read back the heap_size value to determine the > current heap size; it just hacks the system into thinking that's the > current heap size so when it's growing it needs to take that into account.
I think the patch is a stab in the right direction, but that calculation is not near precise enough. The bug can be triggered more easily by passing a low heap growth percentage, for example: ./test/finalizer-error-test.scm -:hg110 This causes the test to fail even on i386. Even if the heap growth is just over 100%, it shouldn't ever crash (it is, after all, _growing_). All sorts of annoying details of other types of memory that get copied into the heap shouldn't have to bother the user; the heap growth percentage is (AFAIK) just supposed to be an optimization hint. I propose the attached patch to help us keep track of this bug more closely. I tightened up the tests a LOT by making it only grow by 105%, stressing the code more for this edge case. Cheers, Peter -- http://sjamaan.ath.cx -- "The process of preparing programs for a digital computer is especially attractive, not only because it can be economically and scientifically rewarding, but also because it can be an aesthetic experience much like composing poetry or music." -- Donald Knuth
>From 582c22dec78685c8971487657bef97b277a34cd8 Mon Sep 17 00:00:00 2001 From: Peter Bex <[email protected]> Date: Wed, 27 Jun 2012 20:20:00 +0200 Subject: [PATCH] Tighten up the finalizer tests so it fails in all situations. This way, when the test starts passing due to a fix we can be more certain that it really is correct --- tests/runtests.bat | 4 ++++ tests/runtests.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/tests/runtests.bat b/tests/runtests.bat index ecd8d05..3afa0bb 100644 --- a/tests/runtests.bat +++ b/tests/runtests.bat @@ -396,6 +396,10 @@ echo ======================================== finalizer tests ... if errorlevel 1 exit /b 1 echo ======================================== finalizer tests (2) ... +%compile% finalizer-error-test.scm +if errorlevel 1 exit /b 1 +a.out -:hg105 +if errorlevel 1 exit /b 1 %compile% test-finalizers-2.scm if errorlevel 1 exit /b 1 a.out diff --git a/tests/runtests.sh b/tests/runtests.sh index 63790ef..235b5e5 100755 --- a/tests/runtests.sh +++ b/tests/runtests.sh @@ -345,7 +345,7 @@ $compile symbolgc-tests.scm echo "======================================== finalizer tests ..." $interpret -s test-finalizers.scm $compile finalizer-error-test.scm -./a.out +./a.out -:hg105 $compile test-finalizers-2.scm ./a.out -- 1.7.9.1
_______________________________________________ Chicken-hackers mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-hackers
