> Assuming you're on i686-compatible chips, then this is a known bug that
> still has not been fixed, afaik, but I wouldn't know, as I applied the fix
> from inside my own program.
>
> See [ruby-core:01278] (july 2003) in the archives for code on how to find
> the real stack-pointer. That was the conclusion to a very frustrating bug
> I had been sweating about for a whole year.
>
> You would then pass the value of that to the following undocumented
> function of libruby.so :
>
> extern "C" void Init_stack(VALUE *addr);
>
> Matz thinks my solution is not nice: to be exact, when I proposed the
> above solution, he said that he didn't know how *he* would do it.
>
> To avoid the semblance of big hack involving a voluntary segfault and
> similar blackmagic, you could hardcode the value 0xBFFFFFFC in your
> program, but be warned that this only works on i686-linux and compatible,
> and may fail on just about every other platform.
>
Great many thanks.

A quick test with the hardcoded value did the trick.
Although I feel a little uneasy about putting your vodoo code into my 
application (can't see anything wrong with it, still ...)
But since I dont have a better idea, and I only need the value at compiletime, 
I will probably write a mini prog, that generates a header which I can 
include with the correct stackbase.

again many thanks for your help


Peter