[Bug #3243] Can't build Ruby after r26506

Bug #3243: Can’t build Ruby after r26506
http://redmine.ruby-lang.org/issues/show/3243

e$B5/I<<Te(B: Yuki S.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
ruby -v: ruby 1.9.1p412 (2010-01-30) [i686-linux]

r26506e$B0J9_!"<!$N4D6-$Ge(BRuby
1.9.1e$B$,%S%k%I$G$-$J$/$J$C$F$$$^$9!#KIHwO?$H$7$F!#e(B
Linux jade915.yugui.jp 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16
08:10:02 UTC 2010 i686 GNU/Linux

./miniruby -I…/…/src/lib -I.ext/common -I./-
-r…/…/src/ext/purelib.rb …/…/src/tool/generic_erb.rb -c -o encdb.h
…/…/src/template/encdb.h.tmpl …/…/src/enc enc
/home/yugui/dev/ruby/src/lib/optparse.rb:1310: [BUG] Segmentation fault
ruby 1.9.1p412 (2010-01-30) [i686-linux]

– control frame ----------
c:0013 p:---- s:0060 b:0060 l:000059 d:000059 CFUNC :catch
c:0012 p:0049 s:0056 b:0056 l:000988 d:000ed4 BLOCK
/home/yugui/dev/ruby/src/lib/optparse.rb:1310
c:0011 p:---- s:0050 b:0050 l:000049 d:000049 FINISH
c:0010 p:---- s:0048 b:0048 l:000047 d:000047 CFUNC :catch
c:0009 p:0062 s:0044 b:0044 l:000988 d:000988 METHOD
/home/yugui/dev/ruby/src/lib/optparse.rb:1258
c:0008 p:0024 s:0034 b:0034 l:000033 d:000033 METHOD
/home/yugui/dev/ruby/src/lib/optparse.rb:1252
c:0007 p:0066 s:0029 b:0029 l:0012fc d:002658 BLOCK
…/…/src/tool/generic_erb.rb:12
c:0006 p:0116 s:0026 b:0026 l:000025 d:000025 METHOD
/home/yugui/dev/ruby/src/lib/optparse.rb:793
c:0005 p:---- s:0020 b:0020 l:000019 d:000019 FINISH
c:0004 p:---- s:0018 b:0018 l:000017 d:000017 CFUNC :new
c:0003 p:0069 s:0015 b:0015 l:0012fc d:000b30 EVAL
…/…/src/tool/generic_erb.rb:8
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0012fc d:0012fc TOP

– Ruby level backtrace
information-----------------------------------------
/home/yugui/dev/ruby/src/lib/optparse.rb:1310:in catch' /home/yugui/dev/ruby/src/lib/optparse.rb:1310:in block in
parse_in_order’
/home/yugui/dev/ruby/src/lib/optparse.rb:1258:in catch' /home/yugui/dev/ruby/src/lib/optparse.rb:1258:in parse_in_order’
/home/yugui/dev/ruby/src/lib/optparse.rb:1252:in order!' ../../src/tool/generic_erb.rb:12:in block in ’
/home/yugui/dev/ruby/src/lib/optparse.rb:793:in initialize' ../../src/tool/generic_erb.rb:8:in new’
…/…/src/tool/generic_erb.rb:8:in `’

– C level backtrace information

0x8155bb7 ./miniruby(rb_vm_bugreport+0x47) [0x8155bb7]
0x8082863 ./miniruby() [0x8082863]
0x80828d8 ./miniruby(rb_bug+0x28) [0x80828d8]
0x8102f18 ./miniruby() [0x8102f18]
0x4001d410 [0x4001d410]
0x8144cb5 ./miniruby() [0x8144cb5]
0x8145000 ./miniruby() [0x8145000]
0x814f51d ./miniruby() [0x814f51d]
0x814ae2f ./miniruby() [0x814ae2f]
0x814dc36 ./miniruby() [0x814dc36]
0x8152c35 ./miniruby() [0x8152c35]
0x8144cb5 ./miniruby() [0x8144cb5]
0x8145000 ./miniruby() [0x8145000]
0x814f51d ./miniruby() [0x814f51d]
0x814ae2f ./miniruby() [0x814ae2f]
0x814dc36 ./miniruby() [0x814dc36]
0x81477dd ./miniruby() [0x81477dd]
0x8083be2 ./miniruby(rb_obj_call_init+0x42) [0x8083be2]
0x80b3b5a ./miniruby(rb_class_new_instance+0x2a) [0x80b3b5a]
0x8144cb5 ./miniruby() [0x8144cb5]
0x8145000 ./miniruby() [0x8145000]
0x814f51d ./miniruby() [0x814f51d]
0x814ae2f ./miniruby() [0x814ae2f]
0x814dc36 ./miniruby() [0x814dc36]
0x814de69 ./miniruby(rb_iseq_eval_main+0x99) [0x814de69]
0x80847af ./miniruby(ruby_exec_node+0x9f) [0x80847af]
0x8085b36 ./miniruby(ruby_run_node+0x46) [0x8085b36]
0x805c58a ./miniruby(main+0x5a) [0x805c58a]
0x400c3bd6 /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)
[0x400c3bd6]
0x805c491 ./miniruby() [0x805c491]

[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

make: *** [encdb.h] Aborted

e$B%A%1%C%He(B #3243 e$B$,99?7$5$l$^$7$?!#e(B (by Juergen Daubert)

I ran into the same issue with ruby version 1.9.1-p429 using gcc 4.4.4.
I read the comments in issue #2727, but think that it is not acceptable
that the latest stable version of ruby cannot build with gcc 4.4.x now.
Note: it’s not possible to build ruby without -O2 optimization because
-O2 is hardcoded in configure.in if gcc is used, see the test for gcc in
line 191 and the following setting of ${optflags}.

http://redmine.ruby-lang.org/issues/show/3243

Hi,

At Sat, 3 Jul 2010 17:51:44 +0900,
Juergen Daubert wrote in [ruby-dev:41796]:

Note: it’s not possible to build ruby without -O2
optimization because -O2 is hardcoded in configure.in if gcc
is used, see the test for gcc in line 191 and the following
setting of ${optflags}.

Why did you think it is impossible?

Try:

$ ./configure optflags=-O0 debugflags=’-g3 -ggdb’

and/or

$ make optflags=-O3

e$B%A%1%C%He(B #3243 e$B$,99?7$5$l$^$7$?!#e(B (by Juergen Daubert)

Hi,
yes, that works. Thanks for the hint!

http://redmine.ruby-lang.org/issues/show/3243