From: Zach Dennis Date: 2004-11-18T13:13:29+09:00 Subject: Re: RJB 0.1.6 on 1.8.2 Zach Dennis wrote: > I have downloaded the Ruby Java Bridge (RJB) from > http://arton.no-ip.info/collabo/backyard/?RubyJavaBridge > > It installs and compiles fine on my windows 2000 machines. Does anyone > have success running this on Ruby 1.8.2. Because it doesn't load properly. > > ------------- > requre 'rjb' > Rjb::load #This causes a segmentation fault. > ------------- Ok I found where the segfault occurred, and I fixed it, but I don't know why it is fixed. The problem is on line 152 of the load.c file. It involves a call to close a FILE stream, *fclose(f)*. It segfaulted here, and when I commented this out, it seems to run fine. Any C guys out there that know why fclose does that sometimes, The FILE stream f is not null. The block of code is: //buff is a pointer to a char *array[8192] f = fopen(bridge, "rb"); if (f == NULL) { return -1; } len = fread(buff, 1, sizeof(buff), f); fclose(f); Zach