Ok; This has just started happening again. 

I would really like to get to the bottom of this. Any debugging suggestions 
appreciated.

To reiterate; This is running on a linux 2.6.8.1 system, and is an 
intermittent problem which appears occasionally as I work on the code. If I 
edit the code, randomly; adding a blank line or something; The problem goes 
away. If I copy the code to another directory, and run it from there, it 
works fine. Follow this example session carefully and become as puzzled as 
I...

andrew@orac rubyx $ ls -l
total 168
drwxrwxr-x  7 andrew users   4096 Sep 15 12:01 BitKeeper
drwxrwxr-x  2 andrew users   4096 Sep 15 12:00 SCCS
drwxrwxr-x  3 andrew users   4096 Sep 15 12:01 contrib
drwxrwxr-x  3 andrew users   4096 Aug 24 16:31 lib
lrwxrwxr-x  1 andrew users     10 Sep 15 12:01 rubyx -> sbin/rubyx
drwxrwxr-x  3 andrew users   4096 Sep 16 10:54 sbin
-rw-r--r--  1 andrew users 138745 Sep 16 14:35 strace.log
-rwxr-xr-x  1 andrew users     28 Sep 16 14:35 test
drwxrwxr-x  5 andrew users   4096 Sep 15 12:01 www

[NOTICE THE SYMLINK]

andrew@orac rubyx $ ./rubyx
[BUG] unknown node type 0
ruby 1.8.2 (2004-08-22) [i686-linux]

Aborted

[BROKEN RUNNING FROM SYMLINK]

andrew@orac rubyx $ sbin/rubyx
Rubyx (DEVELOPMENT)

[WORKS RUNNING FROM PATH]

andrew@orac rubyx $ cd ..
andrew@orac ~ $ mkdir test
andrew@orac ~ $ cd test
andrew@orac test $ cp -rpd ../rubyx .
andrew@orac test $ cd rubyx/
andrew@orac rubyx $ ls -l
total 168
drwxrwxr-x  7 andrew users   4096 Sep 15 12:01 BitKeeper
drwxrwxr-x  2 andrew users   4096 Sep 15 12:00 SCCS
drwxrwxr-x  3 andrew users   4096 Sep 15 12:01 contrib
drwxrwxr-x  3 andrew users   4096 Aug 24 16:31 lib
lrwxrwxrwx  1 andrew users     10 Sep 16 15:01 rubyx -> sbin/rubyx
drwxrwxr-x  3 andrew users   4096 Sep 16 10:54 sbin
-rw-r--r--  1 andrew users 138745 Sep 16 14:35 strace.log
-rwxr-xr-x  1 andrew users     28 Sep 16 14:35 test
drwxrwxr-x  5 andrew users   4096 Sep 15 12:01 www

andrew@orac rubyx $ ./rubyx
Rubyx (DEVELOPMENT)

[WORKS FROM SYMLINK ON COPY!]

andrew@orac rubyx $ cd ../rubyx/
andrew@orac rubyx $ ./rubyx
Rubyx (DEVELOPMENT)

[AND FROM PATH]

Weird huh?

I also compiled a version of ruby with debug info, but that works just fine, 
even on original copy of source, so running with gdb doesn't help.

I have managed to use strace on the working and broken cases, which might help 
shed some light for the ruby developers.

A snapshot around the problem area for the working case:

open("/home/andrew/test/rubyx/lib/ruby/site_ruby/rubyx/packages/gnome.rb", 
O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=37514, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x4024e000
read(3, "class Pkg_Gnome < Package\n  def "..., 4096) = 4096
read(3, "glib\',\'gnome-vfs\',\'gtkplus\',\'gai"..., 4096) = 4096
read(3, "8e7460fc6c985724500470b1-gdm-2.6"..., 4096) = 4096
read(3, "r.bz2\'],\'c\'=>\'-O3\',\'c++\'=>\'-O3\'}"..., 4096) = 4096
read(3, "\'0.3.3\'=>{\'files\'=>[\'ww://ww.rub"..., 4096) = 4096
read(3, "se newer pwlib\n\t\t#\t\'configure\'.f"..., 4096) = 4096
read(3, "5c03edd1138136f925d14e81fcaf4420"..., 4096) = 4096
read(3, "omePackage\n\tdef initialize()\n\t\ts"..., 4096) = 4096
read(3, "kage\n\tdef initialize()\n\t\tsuper(\'"..., 4096) = 4096
mmap2(NULL, 1167360, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x402ee000
read(3, "71648410da984b49fd596bf3350bddb2"..., 4096) = 650
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x4024e000, 4096)                = 0
lstat64("/home/andrew/test/rubyx/lib/ruby/site_ruby/rubyx/packages/gnupg.rb", 
{st_mode=S_IFREG|0444, st_size=612, ...}) = 0
stat64("/home/andrew/test/rubyx/lib/ruby/site_ruby/rubyx/packages/gnupg.rb", 
{st_mode=S_IFREG|0444, st_size=612, ...}) = 0
open("/home/andrew/test/rubyx/lib/ruby/site_ruby/rubyx/packages/gnupg.rb", 
O_RDONLY|O_LARGEFILE) = 3
close(3)                                = 0

And for the broken case:

open("/home/andrew/rubyx/lib/ruby/site_ruby/rubyx/packages/gnome.rb", 
O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=37514, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x4024e000
read(3, "class Pkg_Gnome < Package\n  def "..., 4096) = 4096
read(3, "glib\',\'gnome-vfs\',\'gtkplus\',\'gai"..., 4096) = 4096
read(3, "8e7460fc6c985724500470b1-gdm-2.6"..., 4096) = 4096
read(3, "r.bz2\'],\'c\'=>\'-O3\',\'c++\'=>\'-O3\'}"..., 4096) = 4096
read(3, "\'0.3.3\'=>{\'files\'=>[\'ww://ww.rub"..., 4096) = 4096
read(3, "se newer pwlib\n\t\t#\t\'configure\'.f"..., 4096) = 4096
read(3, "5c03edd1138136f925d14e81fcaf4420"..., 4096) = 4096
read(3, "omePackage\n\tdef initialize()\n\t\ts"..., 4096) = 4096
read(3, "kage\n\tdef initialize()\n\t\tsuper(\'"..., 4096) = 4096
mmap2(NULL, 1167360, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x402ee000
read(3, "71648410da984b49fd596bf3350bddb2"..., 4096) = 650
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x4024e000, 4096)                = 0
write(2, "[BUG] ", 6[BUG] )                   = 6
write(2, "unknown node type 0", 19unknown node type 0)     = 19
write(2, "\nruby 1.8.2 (2004-08-22) [i686-l"..., 39

I can supply the full source tarball if that is useful.

Any suggestions?

Andrew Walrond

PS This machine is otherwise rock solid, and has been thoroughly tested with 
memtest, so it's unlikely to be flakey hardware.
Ruby was compiled with gcc 3.4.1 and CFLAGS='-march=i686 -O2'