IA64 Ruby compilation sucessful

B

Bil Kleb

Thanks to Charlie Mills, who actually bothered to read the comment
in gc.c,

#if defined(__ia64__) && (!defined(__GNUC__) || __GNUC__ < 2 || defined(__OPTIMIZE__))
/* ruby crashes on IA64 if compiled with optimizer on */
/* when if STACK_LEVEL_MAX is greater than this magic number */
/* I know this is a kludge. I suspect optimizer bug */

we got yesterday's ruby-stable-snapshot built on NASA's SGI Altix cluster,

http://www1.nasa.gov/home/hqnews/2004/jul/HQ_04243_supercomput.html

by compiling with -O0.

We briefly tried turning off the optimization only for gc.c, but
gave up quickly.

Anyway, instead of only 44 levels with the crippled stack, we
managed to get to 105k stack levels before it seg-faulted and
dumped a >2GB core(!) with our little test code,

def helloLevel level
puts "hello world! "+level.to_s
helloLevel(level+1)
end

helloLevel 0

Much rejoicing,
 
S

Shashank Date

Bil,

Congratulations!

Bil said:
Thanks to Charlie Mills, who actually bothered to read the comment

Kudos, Charlie.

Anyway, instead of only 44 levels with the crippled stack, we
managed to get to 105k stack levels before it seg-faulted and
dumped a >2GB core(!) with our little test code,

Just curious ... how many stack levels before it seg-faulted on the
32-bit version?

-- shanko
 
B

Bil Kleb

Shashank Date asked:
Just curious ... how many stack levels before it seg-faulted on the
32-bit version?

$ cat > hello.rb
def helloLevel level
puts "hello world! "+level.to_s
helloLevel(level+1)
end

helloLevel 0
[Ctrl-d]

$ ruby hello.rb
[..]
hello world! 4542
hello.rb:3:in `helloLevel': stack level too deep (SystemStackError)
from hello.rb:3:in `helloLevel'

on linux x86. Note: it does not segfault, but raises an exception.
Adam Williams reports 1257 on OSX.3.

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,151
Messages
2,570,854
Members
47,394
Latest member
Olekdev

Latest Threads

Top