On Thu, 3 Feb 2011 08:38:30 +0100, David Welton wrote > On Wed, Feb 2, 2011 at 11:24 PM, Massimo Manghi > <massimo.man...@unipr.it> wrote: > > Hi > > > > I'm 80% done with my reorganization into a Rivet namespace (actually this > > was > > done long ago) but I hit a point I'd like to well understand before > > committing > > my work in branches/rivet-namespace for everyone to see it. > > > > I moved the commands in librivet.so into a new package called... RivetLib. > > Since these commands are documented with the core commands (well, not all of > > them are in the manual....) I decided to let the module include them by > > requiring RivetLib during the phase of interp initialization > > (Rivet_PerInterpInit). I found out this caused segfaults all the time in an > > apparently unrelated callback of Rivet (Rivet_ServerConf). > > Any hint what caused the segfault or why? >
The segfault occurs in Rivet_ServerConf because the pointer to the server record passed to the function is spoiled. Rivet_ServerConf goes through two rounds of calls, being a round a series of calls one for each line in the configuration. During the first round the conf record has the default values Rivet_CreateConfig put in it, then it's a mess when the second round begins. These function are direct callback of Apache, so the backtrace has no calls to mod_rivet in the stack. Since 'Tcl_PkgRequire(...,"RivetLib",...)' breaks the module while 'package require RivetLib' get it straight again (after removing the C call to Tcl_PkgRequire) I thought this could be put in connection to the way the tcl command 'package require' loads the library that most probably is more elaborate than a single call to the Tcl library and then I found that old comment in configure.ac about the stubs.... -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: rivet-dev-unsubscr...@tcl.apache.org For additional commands, e-mail: rivet-dev-h...@tcl.apache.org