[Top][All Lists]

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

[Chicken-hackers] Half a bug report

From: Jörg F . Wittenberger
Subject: [Chicken-hackers] Half a bug report
Date: 05 Jun 2012 14:58:39 +0200

Sorry for that: I failed.

All I can do is let you know about the following observation
in the hope that it might be helpful to know when looking
into the compiler/scrutinizer.

A chicken version from trunk as of 2012-02-10 did catch
the following error with ease.  My next update per 2012-05-12
did no longer.

All my attempts to boil it down to the usual foo/bar style
all failed with chicken doing the right thing.

However I had problems with "illegal forwarded objects".

Those came up after I did a little unclean macro expansion.
I passed a well known procedure into under the name "values"
into formerly well tested code[1].  Efficiently it expanded int
code like this

(define foo
(let ((receiver (lambda (a b c) <somecode>))
  (lambda (x y z)
   ((lambda (values a b c) <macroexpanded code here>)
    receiver x y z))))

[[Before it was:
[[  (define (foo x x y)
[[   (receive (a b c) <macro expanded code here>
[[    <somecode>))

My bad that I actually used "values" twice.  Once for
the actual multiple value return I wanted to replace.
And once elsewhere with a different number of arguments.

The old compiler complained about the wrong number of arguments
being passed to my receiver procedure (going by the name "values"
but no longer being bound to the standard values as before)
The new version happily compiled the call with no warning
passing garbage for missing arguments.

Fixing the wrong expansion fixed the illegal objects and
frequent segfaults during garbage collection.

Pruning the code from all the things, which are "obviously"
unrelated is not easy.  Chicken complains correct when
I substitute simple expressions.  Giving up at that point.

Best Regards


[1] The idea: avoid frequent creation of values continuations.
BTW: this driven by the idea that multiple values under chicken
would be less efficient than calling a continuation which is passed
as an argument.  I'd like to learn how valid this wild guess
a.k.a. assumption actually is.)

reply via email to

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