From: Jo Totland Date: 2000-11-02T01:10:02+09:00 Subject: [ruby-talk:5978] Garbage collection bug: unknown data type 40 The following is a program that makes ruby crash with the error message: ./bicapitalize.rb:19: [BUG] gc_sweep(): unknown data type 40 ruby 1.6.1 (2000-09-27) [i586-linux-gnu] Aborted Here is the program: ----------------------------------------------------------------- #! /usr/bin/ruby srand $aGlobalVar = [] def doit! text text.downcase! nothing text bicapitalize! text end def nothing text for i in 0...$aGlobalVar.length end end def bicapitalize! text text.gsub!(/[a-z]/) { |m| rand < .3 ? m.upcase : m } end STDIN.each_line { |line| doit! line print line } print "\n" ------------------------------------------------------------------ This program should be run as a unix filter taking input from stdin and writing to stdout. With a sufficiently large input, the error message will appear. At least on my machine: [jo@bogon ruby]$ cat /etc/mandrake-release Linux Mandrake release 7.2 (Odyssey) for i586 [jo@bogon ruby]$ uname -a Linux bogon.jonett 2.2.17-21mdk #1 Thu Oct 5 13:16:08 CEST 2000 i686 unknown [jo@bogon ruby]$ rpm -q ruby ruby-1.6.1-2mdk -Jo -- Hours and hours of sheer boredom, punctuated by lunch.