David N. Welton wrote:
> Jeff Hobbs wrote:
> 
> > I'm interested in understanding why this is, and where it happens.
> > 
> > I'm somewhat suspicious that I can find Tcl_CreateInterp but no 
> > Tcl_DeleteInterp in the rivet C sources (but there is a Tcl_Finalize).  
> > I suspect that Rivet may not be fundamentally safe in its lifecycle 
> > handling of interpreters, and/or not completely thread safe (although 
> > I thought David used threaded Tcl on unix).  It may be something even 
> > more fundamental in a mismatch between the threaded Windows Tcl build 
> > and whatever configuration the Windows Apache is using by default.
> 
> I didn't realize I needed to delete the interpreter before 
> running Finalize.  I thought that would take care of nuking 
> everything Tcl related.  That's in the child exit stuff 
> though, so I wouldn't think that would be causing the 
> problems people are seeing.

Ah, this is a common misconception, and it's important to
understand why you need to delete the interp before you
finalize (regardless of its effect on this particular issue).

Tcl_Finalize does an "aggressive" finalization, generally
reverting things to a start where you can re-init, but not
necessarily properly doing cleanup throughout (it's not
Tcl_FinalizeAndCleanUpAnyMess ... ;) ).  In particular, items
like C-based command deletion callbacks and other bits
related to *interpreter* deletion are not triggered.

> It seems like it's starting up ok, then tries to run a page, 
> at which point it throws an error, tries to run handle_error, 
> and dies because it can't run that code either.

It's not that it can't run the code, but rather that there is
some issue with channel handling, so all reporting mechanisms
are being borked.  You could instrument with direct C calls
to figure out the issue.

Jeff


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to