>>>>> "D" == Dave Thomas <Dave / PragmaticProgrammer.com> writes:

D>      ruby 1.6.7 (2002-08-01)
D>      mod_ruby 0.9.9
D>      Apache 1.3.26

 I've tried with

  Server: Apache/1.3.26 (Unix) Debian GNU/Linux mod_ruby/0.9.9 Ruby/1.6.7

aestivum% ruby -v
ruby 1.6.7 (2002-08-12) [i686-linux]
aestivum% 


 Not found 'ruby 1.6.7 (2002-08-01)' but it seems to exist a strange
 interaction between mod_ruby/apache/ruby

 For example, I don't have a segfault but an infinite loop for the second
 request 

(gdb) p rb_cNilClass
$6 = 1077541192
(gdb) p *(struct RClass *)rb_cNilClass
$7 = {basic = {flags = 2051, klass = 1077607672}, iv_tbl = 0x81087e0, 
  m_tbl = 0x81153a0, super = 1077541192}
(gdb) 


 See that rb_cNilClass->super == rb_cNilClass

 Apparently the only line in the source where rb_cNilClass is modified is
 in class.c

#define SPECIAL_SINGLETON(x,c) if (obj == (x)) {\
    if (!FL_TEST(c, FL_SINGLETON)) {\
        c = rb_singleton_class_new(c);\
        rb_singleton_class_attached(c,obj);\
    }\
    return c;\
}

VALUE
rb_singleton_class(obj)
    VALUE obj;
{
    VALUE klass;

    if (FIXNUM_P(obj) || SYMBOL_P(obj)) {
        rb_raise(rb_eTypeError, "can't define singleton");
    }
    if (rb_special_const_p(obj)) {
        SPECIAL_SINGLETON(Qnil, rb_cNilClass);
        SPECIAL_SINGLETON(Qfalse, rb_cFalseClass);
        SPECIAL_SINGLETON(Qtrue, rb_cTrueClass);
        rb_bug("unknown immediate %d", obj);
    }

[...]

 but I don't understand how this can have an effect with apache
 (multi-thread/process ???)


Guy Decoux