>>>>> "S" == Sean Chittenden <sean / chittenden.org> writes:

S> :-/ You could be right, but, the IO context is created when reading
S> data from RAM, not from an actual IO socket. 

 Here the example

pigeon% gdb ruby
GNU gdb 2002-04-01-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-linux"...
(gdb) b dln_load
Breakpoint 1 at 0x80b576b: file dln.c, line 1282.
(gdb) r tests.rb
Starting program: /usr/local/bin/ruby tests.rb
Running all tests...

Breakpoint 1, dln_load (file=0x811b340 "../libxml.so") at dln.c:1282
1282            if ((handle = (void*)dlopen(file, RTLD_LAZY|RTLD_GLOBAL)) == NULL) {
(gdb) n
1287            if ((init_fct = (void(*)())dlsym(handle, buf)) == NULL) {
(gdb) n
1293            (*init_fct)();
(gdb) b ctxtClose
Breakpoint 2 at 0x401c5c9e: file ruby_xml_parser.c, line 15.
(gdb) b fptr_finalize
Breakpoint 3 at 0x806c982: file io.c, line 1009.
(gdb) c
Continuing.

Breakpoint 3, fptr_finalize (fptr=0x81240c0) at io.c:1009
1009        if (fptr->f) {
(gdb) cond 3 fptr->f == 0x81f9558
(gdb) c
Continuing.
Loaded suite libxml
Started...
.................
Breakpoint 3, fptr_finalize (fptr=0x81f9538) at io.c:1009
1009        if (fptr->f) {
(gdb) n
1010            fclose(fptr->f);
(gdb) p fptr->f
$1 = (FILE *) 0x81f9558
(gdb) c
Continuing.
...........................
Breakpoint 2, ctxtClose (f=0x81f9558) at ruby_xml_parser.c:15
15        if (f != stdin) {
(gdb) n
16          fclose(f);
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x400d93b9 in _IO_file_close_it () from /lib/libc.so.6
(gdb) 



Guy Decoux