Ruby 1.8.0 bug

Hello

Sometimes in my application I get following message:
[BUG] unknown node type 0
ruby 1.8.0 (2003-02-16) [i686-linux-gnu]
Aborted

When I find the place where the bug occures and insert empty line before
it the problem always disappears.

I can’t show the offending code, because the app has about 5000 lines of
code and until now the bug appeared in several places.

I had the same problem with Ruby 1.6.8. I run Ruby on Gentoo Linux.

I really don’t know te reason of this problem. is my CPU (Duron 1200)
too fast?

···


Marek Janukowicz

I also see this periodically. However, when I do see it, it is caused by an
argument type mismatch or an argument count error.

···

On Sunday 02 March 2003 09:10 am, Child wrote:

Hello

Sometimes in my application I get following message:
[BUG] unknown node type 0
ruby 1.8.0 (2003-02-16) [i686-linux-gnu]
Aborted

When I find the place where the bug occures and insert empty line before
it the problem always disappears.

I can’t show the offending code, because the app has about 5000 lines of
code and until now the bug appeared in several places.

I had the same problem with Ruby 1.6.8. I run Ruby on Gentoo Linux.

I really don’t know te reason of this problem. is my CPU (Duron 1200)
too fast?


Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com

Hi,

···

At Mon, 3 Mar 2003 01:10:01 +0900, Child wrote:

Sometimes in my application I get following message:
[BUG] unknown node type 0
ruby 1.8.0 (2003-02-16) [i686-linux-gnu]
Aborted

Can you show the stack trace?


Nobu Nakada

I also see this periodically. However, when I do see it, it is caused by an
argument type mismatch or an argument count error.

This is not normal.

Hello

Sometimes in my application I get following message:
[BUG] unknown node type 0
ruby 1.8.0 (2003-02-16) [i686-linux-gnu]
Aborted

This mean that the node was GC'ed

I can't show the offending code, because the app has about 5000 lines of
code and until now the bug appeared in several places.

If it's easy to reproduce the bug send me, in private email, the source.

I had the same problem with Ruby 1.6.8. I run Ruby on Gentoo Linux.

Personnaly I don't trust linux distribution : debian was able to
*completely break* Berkeley DB 4.0.14 :-(((

I really don't know te reason of this problem. is my CPU (Duron 1200)
too fast?

No, probably a bug with the GC

Guy Decoux

···

On Sunday 02 March 2003 09:10 am, Child wrote:

When I see this behavior, if I show the stack trace the message no longer
occurs. Similarly with running under the debugger. (That’s how I found out
that it seems to be caused by argument type mismatches.)

···

On Sunday 02 March 2003 09:47 am, nobu.nokada@softhome.net wrote:

Hi,

At Mon, 3 Mar 2003 01:10:01 +0900, > > Child wrote:

Sometimes in my application I get following message:
[BUG] unknown node type 0
ruby 1.8.0 (2003-02-16) [i686-linux-gnu]
Aborted

Can you show the stack trace?


Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com

Hi Nobu

I ran over the same bug some time ago. Matz tried to reproduce it, but failed
(I think…). And now after several CVS updates even I can’t reproduce the
bug anymore.
But I send you my mail with the stack trace (at the bottom) from back then
anyway.

Greets, Thomas

···

On Sunday 02 March 2003 17:47, nobu.nokada@softhome.net wrote:

Can you show the stack trace?


Hi,

I think I discovered a bug in Ruby 1.8.0:

uehli@ueh-h bug2 $ ruby -v
ruby 1.8.0 (2003-01-27) [i686-linux]

uehli@ueh-h bug2 $ ruby extconf.rb
[BUG] unknown node type 0
ruby 1.8.0 (2003-01-27) [i686-linux]
Aborted

The executed script is the (slightly modified) extconf.rb of the Ruby OpenGL
extension. I tried to narrow down the bug but as soon as I comment a single
line of the source out the bug seems to disappear.

So here is the script (sorry for the length!):

extconf.rb

$Date: 2001/12/01 05:24:58 $

$Author: yoshi $

require “rbconfig”
Config::CONFIG.each do |k,v| Config::MAKEFILE_CONFIG[k] = v.dup end
require “mkmf”

gl_libname = “”
glu_libname = “”
glut_libname = “”

modules = “”
ogl_flg = false
glut_flg = false

File.unlink(“Makefile”) if (FileTest.exist? “Makefile”)
File.unlink(“Makefile.ogl”) if (FileTest.exist? “Makefile.ogl”)
File.unlink(“Makefile.glut”) if (FileTest.exist? “Makefile.glut”)

if (/cygwin/ =~ PLATFORM)
$CFLAGS=“-DWIN32”
gl_libname = “opengl32”
glu_libname = “glu32”
glut_libname = “glut32”
elsif (/mswin32/ =~ PLATFORM)
$CFLAGS=“-DWIN32”
gl_libname = “opengl32”
glu_libname = “glu32”
glut_libname = “glut32”
else
$CFLAGS += " -I."

dir_config(“x11”, “/usr/X11R6”)

$libs = append_library($libs, “Xmu”)
$libs = append_library($libs, “X11”)
gl_libname = “GL”
glu_libname = “GLU”
glut_libname = “glut”
end

$objs = [“glu.o”, “ogl.o”, “rbogl.o”]
#have_library(“pthread”, “pthread_create”)
(have_library(gl_libname, “glEnd”) || have_library(“Mesa”+gl_libname, nil)) &&
(have_library(glu_libname, “gluDisk”) || have_library(“Mesa”+glu_libname,
nil)) &&
create_makefile(“opengl”)
if (FileTest.exist? “Makefile”)
open(“Makefile”) {|f|
open(“Makefile.ogl”, “w”) {|wfile|
wfile.write(f.read)
}
}
File.unlink(“Makefile”)
modules = modules + “opengl.#{CONFIG[‘DLEXT’]}”
ogl_flg = true
else
p “can’t create OpenGL module!”
exit 1
end

$objs = [“glut.o”]
have_library(“Xi”, “XAllowDeviceEvents”) &&
have_library(“Xext”, “XMITMiscGetBugMode”) &&
have_library(“Xmu”, “XmuAddCloseDisplayHook”)
have_library(glut_libname, nil) &&
create_makefile(“glut”)
if (FileTest.exist? “Makefile”)
open(“Makefile”) {|f|
open(“Makefile.glut”, “w”) {|wfile|
wfile.write(f.read)
}
}
File.unlink(“Makefile”)
modules = "glut.#{CONFIG[‘DLEXT’]} " + modules
glut_flg = true
end

open(“Makefile”, “w”) {|f|
f.write <<“MAKEFILE”
SHELL = /bin/sh
all: #{modules}

opengl.#{CONFIG[‘DLEXT’]}: rbogl.c ogl.c glu.c rbogl.h
@echo Now Making opengl extend module
@$(MAKE) -f Makefile.ogl

glut.#{CONFIG[‘DLEXT’]}: glut.c
@echo Now Making glut extend module
@$(MAKE) -f Makefile.glut

clean:
@rm -f *.o *.so *.sl *.a
@rm -f $(TARGET).lib $(TARGET).exp
@rm -f core ruby$(EXEEXT) ~
@rm -f Makefile.ogl Makefile.glut
@rm -f Makefile extconf.h conftest.

install: #{modules}
#{“\t@$(MAKE) -f Makefile.ogl install” if (ogl_flg)}
#{“\t@$(MAKE) -f Makefile.glut install” if (glut_flg)}

site-install: #{modules}
#{“\t@$(MAKE) -f Makefile.ogl site-install” if (ogl_flg)}
#{“\t@$(MAKE) -f Makefile.glut site-install” if (glut_flg)}
MAKEFILE
}

==========================================

Note that there must be EXACTLY 2 empty lines at the end (as above), else the
bug disappears too.

Here is the stack trace:

(gdb) info stack
#0 0x400a1031 in kill () from /lib/libc.so.6
#1 0x400a0c28 in raise () from /lib/libc.so.6
#2 0x400a272b in abort () from /lib/libc.so.6
#3 0x080c7829 in rb_bug (fmt=0x0) at error.c:174
#4 0x08058a51 in rb_eval (self=1075661308, n=0x0) at eval.c:3427
#5 0x0805b7d3 in rb_call0 (klass=1075666208, recv=1075661308, id=9865, oid=0,
argc=0, argv=0xbfffeb70, body=0x4022dce0, nosuper=0) at eval.c:4743
#6 0x0805bd51 in rb_call (klass=1075666208, recv=1075661308, mid=9865,
argc=2, argv=0xbfffeb68, scope=1) at eval.c:4833
#7 0x08056de2 in rb_eval (self=1075661308, n=0x0) at eval.c:2789
#8 0x080554f0 in rb_eval (self=1075661308, n=0x0) at eval.c:2251
#9 0x08053446 in ruby_exec () at eval.c:1314
#10 0x08053484 in ruby_run () at eval.c:1335
#11 0x080514f5 in main (argc=0, argv=0x0, envp=0xbffff760) at main.c:50
#12 0x4008ce34 in __libc_start_main () from /lib/libc.so.6

I could reproduce the bug on two Linux boxes and it’s not the first time I ran
into that bug but I could not get hold of that nasty thing before.

Thanks for your help.
– Thomas

Aren’t you getting a core dump?

···

On Mon, Mar 03, 2003 at 01:50:48AM +0900, Seth Kurtzberg wrote:

On Sunday 02 March 2003 09:47 am, nobu.nokada@softhome.net wrote:

Hi,

At Mon, 3 Mar 2003 01:10:01 +0900, > > > > Child wrote:

Sometimes in my application I get following message:
[BUG] unknown node type 0
ruby 1.8.0 (2003-02-16) [i686-linux-gnu]
Aborted

Can you show the stack trace?

When I see this behavior, if I show the stack trace the message no longer
occurs. Similarly with running under the debugger. (That’s how I found out
that it seems to be caused by argument type mismatches.)


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

As I currently don’t have a floppy drive in my computer, I’d like to
make an `emergency cdrom’ :wink:
– Eugene Crosser crosser@average.org

I can’t show the offending code, because the app has about 5000 lines of
code and until now the bug appeared in several places.
If it’s easy to reproduce the bug send me, in private email, the source.

It should be easy - I’ll send it to you later today.

I had the same problem with Ruby 1.6.8. I run Ruby on Gentoo Linux.

Personnaly I don’t trust linux distribution : debian was able to
completely break Berkeley DB 4.0.14 :-(((

Gentoo is the “source” distribution - everything is compiled on my
machine. All the distro provides is an .ebuild file containing rules for
downloading, unpacking and compiling the package. And for Ruby 1.8.0 I
created that file myself - it contains nothing more than simple
…/configure; make; make install;

Conclusion: although I agree some binary packages in sme distributions
are broken, I am sure this is not such case.

···

On Mon, 3 Mar 2003 01:46:36 +0900, ts wrote:


Marek Janukowicz

No, obviously not. If I were getting a core dump I would have the stack
trace.

···

On Sunday 02 March 2003 10:22 am, Mauricio Fernández wrote:

On Mon, Mar 03, 2003 at 01:50:48AM +0900, Seth Kurtzberg wrote:

On Sunday 02 March 2003 09:47 am, nobu.nokada@softhome.net wrote:

Hi,

At Mon, 3 Mar 2003 01:10:01 +0900, > > > > > > Child wrote:

Sometimes in my application I get following message:
[BUG] unknown node type 0
ruby 1.8.0 (2003-02-16) [i686-linux-gnu]
Aborted

Can you show the stack trace?

When I see this behavior, if I show the stack trace the message no longer
occurs. Similarly with running under the debugger. (That’s how I found
out that it seems to be caused by argument type mismatches.)

Aren’t you getting a core dump?


Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com

This has nothing to do with gentoo. I see the same behavior on Debian, Red
Hat, and Slackware.

···

On Sunday 02 March 2003 10:50 am, Child wrote:

On Mon, 3 Mar 2003 01:46:36 +0900, ts wrote:

I can’t show the offending code, because the app has about 5000 lines
of code and until now the bug appeared in several places.

If it’s easy to reproduce the bug send me, in private email, the source.

It should be easy - I’ll send it to you later today.

I had the same problem with Ruby 1.6.8. I run Ruby on Gentoo Linux.

Personnaly I don’t trust linux distribution : debian was able to
completely break Berkeley DB 4.0.14 :-(((

Gentoo is the “source” distribution - everything is compiled on my
machine. All the distro provides is an .ebuild file containing rules for
downloading, unpacking and compiling the package. And for Ruby 1.8.0 I
created that file myself - it contains nothing more than simple
…/configure; make; make install;

Conclusion: although I agree some binary packages in sme distributions
are broken, I am sure this is not such case.


Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com

You should :slight_smile: If you’re in bash do

batsman@tux-chan:~$ ulimit -c
0
batsman@tux-chan:~$ ulimit -c 20000
batsman@tux-chan:~$ ulimit -c
20000

Ruby will always try to dump when it exits with such an error…

···

On Mon, Mar 03, 2003 at 02:36:07AM +0900, Seth Kurtzberg wrote:

On Sunday 02 March 2003 10:22 am, Mauricio Fernández wrote:

On Mon, Mar 03, 2003 at 01:50:48AM +0900, Seth Kurtzberg wrote:

On Sunday 02 March 2003 09:47 am, nobu.nokada@softhome.net wrote:

Hi,

At Mon, 3 Mar 2003 01:10:01 +0900, > > > > > > > > Child wrote:

Sometimes in my application I get following message:
[BUG] unknown node type 0
ruby 1.8.0 (2003-02-16) [i686-linux-gnu]
Aborted

Can you show the stack trace?

When I see this behavior, if I show the stack trace the message no longer
occurs. Similarly with running under the debugger. (That’s how I found
out that it seems to be caused by argument type mismatches.)

Aren’t you getting a core dump?

No, obviously not. If I were getting a core dump I would have the stack
trace.


_ _

__ __ | | ___ _ __ ___ __ _ _ __
'_ \ / | __/ __| '_ _ \ / ` | ’ \
) | (| | |
__ \ | | | | | (| | | | |
.__/ _,
|_|/| || ||_,|| |_|
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

[…] or some clown changed the chips on a board and not its name.
(Don’t laugh! Look at the SMC etherpower for that.)
– from /usr/src/linux/MAINTAINERS

I have ulimit set correctly and other apps do indeed produce cores. I’ve not
produced a core from this with Ruby 1.8.

···

On Sunday 02 March 2003 11:10 am, Mauricio Fernández wrote:

On Mon, Mar 03, 2003 at 02:36:07AM +0900, Seth Kurtzberg wrote:

On Sunday 02 March 2003 10:22 am, Mauricio Fernández wrote:

On Mon, Mar 03, 2003 at 01:50:48AM +0900, Seth Kurtzberg wrote:

On Sunday 02 March 2003 09:47 am, nobu.nokada@softhome.net wrote:

Hi,

At Mon, 3 Mar 2003 01:10:01 +0900, > > > > > > > > > > Child wrote:

Sometimes in my application I get following message:
[BUG] unknown node type 0
ruby 1.8.0 (2003-02-16) [i686-linux-gnu]
Aborted

Can you show the stack trace?

When I see this behavior, if I show the stack trace the message no
longer occurs. Similarly with running under the debugger. (That’s
how I found out that it seems to be caused by argument type
mismatches.)

Aren’t you getting a core dump?

No, obviously not. If I were getting a core dump I would have the stack
trace.

You should :slight_smile: If you’re in bash do

batsman@tux-chan:~$ ulimit -c
0
batsman@tux-chan:~$ ulimit -c 20000
batsman@tux-chan:~$ ulimit -c
20000

Ruby will always try to dump when it exits with such an error…


Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com