Michal,

I've got no immediate plans to port these patches to 1.8.6.
Why is this important for you?  I (perhaps naively) thought 1.8.7
would run just about anything that 1.8.6 does.

The Ruby build seems to do special things to configure alloca() on ppc
machines.
In particular, I just noticed that Ruby does not use GNUC's
__builtin_alloca()
on PPC even if compiled with GNUC.
Instead, it substitutes a 'C' version that just calls malloc().
When forced  to use the __builtin_alloca() on PPC, the resulting interpreter
failed even if all my stack clearing was disabled.  

There is some interesting history here.  
Perhaps someone on this list tell me what in Ruby is 
incompatible with the GNU's PPC version of __builtin_alloca().

Nevertheless, I've put up a very experimental patch at:
http://sites.google.com/site/brentsrubypatches/
The patch file is an attachment called:
ruby-1.8.7-p72-mbariPPC.patch
near the bottom of the page.

Apply the usual seven MBARI patches, then this PPC patch atop them all.

The PPC patch tries to work around alloca() strangeness by invoking the
_builtin_alloca() 
directly for stack clearing whenever __GNUC__ is defined.  
This seems to work well on the mac g4 laptop on which I tested.

The test suite ran 11m6s patched vs 11m3s unpatched.
Both versions flagged an Error in test_translit_option plus one other
failure.

I built each with CFLAGS=-O2 because -fno-stack-protector does not seem
to be supported by the apple version of gcc.

Let me know how it works for you on ppc64...
Please send (just me) the output of gcc -v if this patch fails.
You might also want to attach your config.h file

- brent


Bugzilla from calcifer / runbox.com wrote:
> 
> Are you (or someone else) also planning on rebasing the 
> patches against 1.8.6 ? I've tried that myself but it didn't work very
> well 
> (ruby test/runner.rb fails 3 tests on 0x2770, and segfaults when i use
> 0x4770,  
> on x86_64 machine)
> 
> I also tried building on ppc64, with 0x4770 it wont even build, segfaults
> on 
> launching miniruby:
> 
> gcc -O2 -g    -DRUBY_EXPORT -D_GNU_SOURCE=1  -L.  -rdynamic -Wl,-export-
> dynamic   main.o  libruby-static.a -ldl -lcrypt -lm -o miniruby
> ./ext/purelib.rb:2: [BUG] Segmentation fault
> ruby 1.8.7 (2009-1-18 MBARI 7/0x4770 on patchlevel 72) [powerpc64-linux]
> make: *** [.rbconfig.time] Aborted
> 
> With 0x2770 it builds & runs the same test suite with 6 failures & 1
> error. 
> 
> 

-- 
View this message in context: http://www.nabble.com/-ruby-core%3A19846---Bug--744--memory-leak-in-callcc--tp20447794p21602687.html
Sent from the ruby-core mailing list archive at Nabble.com.