Bug #378

rbconfig.rb:173: [BUG] Stack consistency error

Added by Anonymous about 7 years ago. Updated over 4 years ago.

[ruby-core:18029]
Status:Closed
Priority:Normal
Assignee:Koichi Sasada
ruby -v: Backport:

Description

=begin
I've tried to compile ruby 1.9 svn HEAD on an openSUSE 11.0 and ran into a build problem with prelude.c Build log is attached.
=end

log Magnifier (2.02 KB) Anonymous, 07/31/2008 02:55 AM

valgrind.log.gz - Log valgrind (4.56 KB) Thibault Normand, 08/07/2008 06:11 PM

gdb.log.gz - Log gdb (1.54 KB) Thibault Normand, 08/07/2008 06:11 PM

History

#1 Updated by Thibault Normand about 7 years ago

=begin
Same problem on OpenSUSE 11.0 x64.
Try some valgrind / gdb pass to identify the problem
=end

#2 Updated by Koichi Sasada about 7 years ago

  • Assignee set to Koichi Sasada

=begin

=end

#3 Updated by Yusuke Endoh about 7 years ago

=begin
Hi,

2008/7/31 Anonymous redmine@ruby-lang.org:

I've tried to compile ruby 1.9 svn HEAD on an openSUSE 11.0 and ran into a build problem with prelude.c Build log is attached.

I duplicated the problem on openSUSE 11.0 on VMware on 32bit WindowsXP.

To simplify it, multiple assignment dumps core.

$ ./miniruby -e 'a, b = 1, 2'
-e:1: [BUG] Stack consistency error (sp: 10, bp: 8)
ruby 1.9.0 (2008-08-21 revision 18754) [i686-linux]

-- control frame ----------
c:0003 p:0013 s:0010 b:0008 l:000007 d:000007 TOP -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH :private_class_method
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP :17


DBG> : "-e:1:in `'"
-- backtrace of native function call (Use addr2line) --
0x814f3f4
0x808069e
0x80806e8
0x81455b4
0x8145d24
0x8145f0c
0x8082a6f
0x8083d76
0x805ba00
0xb7eb05f5
0x805b901


Aborted

The cause is, the function REMOVE_ELEM in compile.c is certainly called
but seems not to work. I think gcc does wrong optimization because:

  • if building with optflags="-O0", it works
  • if adding attribute((noinline)) to REMOVE_ELEM, it works
  • if building with gcc 4.3.1 built by myself, it works

So I suspect packaging issue of gcc in openSUSE 11.0 or gcc's own bug.
As a workaround, you may use ./configure optflags="-O0".

--
Yusuke ENDOH mame@tsg.ne.jp

=end

#4 Updated by Yukihiro Matsumoto about 7 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF