chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] how to -block?


From: Jörg F . Wittenberger
Subject: Re: [Chicken-hackers] how to -block?
Date: 08 Apr 2013 00:58:08 +0200

On Apr 5 2013, Felix wrote:

From: Jörg F. Wittenberger <address@hidden>
Subject: [Chicken-hackers] how to -block?
Date: 31 Mar 2013 20:51:19 +0200

I'm trying to figure out howto use -block optimization.

Whenever I use it with any module no matter how simple it is,
the resulting binary will segfault immediately.

Which restrictions should I watch?

If you get a segfault, do you compile/run code in unsafe mode?

Yes.

Accidentally.

The uses/import consusion as it turned out. … Took me >2 full days
to work that out.

Maybe we should recommend in the manual to NOT ever have "uses"
and "import" in the same file.  By doing so, I managed to make
the compiler miss unbound variables.  For whatever reason those
where eventually bound when accessed - at least most of the time.

By cutting out all "uses" from all modules and accumulating them into
a single "link-file" (having no code except for a single import
of the toplevel "main" procedure and call it I've been able to
track several unboudn variables down.  (Those came from code-
rearrangements done under the safe-feeling that chicken points
unbound variables out anyway.  You should never trust…)

Now I shall go back and retry with the -block.


Thanks

/Jörg

Block-optimization should normally not result in crashes, but will
produce runtime-errors when variables are referenced that are not
bound. In block mode, defined toplevel variables will not be exposed
and not be visible to code outside of the file compiled in that mode.
This is really the only difference to compilation in normal mode.


cheers,
felix




reply via email to

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