You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Ch...@raytheon.com on 2005/12/10 20:43:06 UTC
rivet upload causes server crash
Here's the original post to comp.lang.tcl:
http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/efd78335da7dda95/a576aeb60ec3c8c9?lnk=raot
The short explanation is, running on winXP, a file upload in rivet causes
apache to crash, but does succeed in creating the file, but zero-length, in
the target upload directory. I pulled the 7.0 and 5.0 installs from
http://www.apache.org/dist/tcl/rivet/binary/
and have tried both; the crash occurs no matter what.
On an additional interesting note, I installed the threaded active tcl
8.4.12 release, and that broke rivet completely. Reverted back to tcl
8.4.11.1 and rivet was happy once again, if still choking on uploads.
I've configured this thing six ways to sunday-- anyone have any
suggestions?
Thanks.
- chess hazlett
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
RE: rivet upload causes server crash
Posted by Jeff Hobbs <je...@ActiveState.com>.
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: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet upload causes server crash
Posted by "David N. Welton" <da...@dedasys.com>.
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.
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.
Just out of curiosity, Charles, if you wanted to try an experiment, you
could change the installed version of the handle_error proc, found in
the init.tcl file, to something along these lines:
proc handle_error {} {
global errorInfo
global errorOutbuf
puts stderr "ERRORINFO: $errorInfo"
puts stderr "OUTPUT BUFFER:"
puts stderr $errorOutbuf
}
and then run things... that ought to print something out to the log file
or stderr, if we are lucky.
--
David N. Welton
- http://www.dedasys.com/davidw/
Linux, Open Source Consulting
- http://www.dedasys.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
RE: rivet upload causes server crash
Posted by Jeff Hobbs <je...@ActiveState.com>.
Charles_S_Hazlett@raytheon.com wrote:
> Here's the error page yielded when running rivet under
> threaded active tcl 8.4.12, by the way.
>
> Rivet ErrorScript failed!
>
> can not find channel named "stdout"
I would narrow this down to mod_rivet.c:Rivet_PerInterpInit,
where a channel is created and then set to TCL_STDOUT. I can't
say what the issue is though ... maybe register the channel
right after setting it std? Has Rivet been tried with mt Tcl
on another platform (IOW, is this just a Windows issue)?
Jeff Hobbs, The Tcl Guy
http://www.ActiveState.com/, a division of Sophos
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
RE: rivet upload causes server crash
Posted by Ch...@raytheon.com.
Here's the error page yielded when running rivet under threaded active tcl
8.4.12, by the way.
Rivet ErrorScript failed!
can not find channel named "stdout"
while executing
"puts <PRE>"
(procedure "::Rivet::handle_error" line 5)
invoked from within
"::Rivet::handle_error"
> 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.
- chess hazlett
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
RE: rivet upload causes server crash
Posted by Jeff Hobbs <je...@ActiveState.com>.
David N. Welton wrote:
> Charles_S_Hazlett@raytheon.com wrote:
> > On an additional interesting note, I installed the threaded active tcl
> > 8.4.12 release, and that broke rivet completely. Reverted back to tcl
> > 8.4.11.1 and rivet was happy once again, if still choking on uploads.
>
> Jeff - note the above, since you asked before...
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.
Jeff Hobbs, The Tcl Guy
http://www.ActiveState.com/, a division of Sophos
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet upload causes server crash
Posted by Ch...@raytheon.com.
using Apache 1.3.29. The smallest snippet is
source page, index.rvt:
<form method=post action=upload.rvt name=ulfilename
enctype=multipart/form-data>
Upload: <input type=file name=ulfilename></input><br/><br/>
<input type=submit value=go!></input><br/><br/>
</form>
target page, upload.rvt:
set data [upload size ulfilename]
set ulf [upload filename ulfilename]
# upload save ulfilename d:/tmp/uploads/$ulf
puts "uploaded $ulf to server<br /><br/><pre>$data</pre><br/>"
Everything works fine as pictured above. Uncommenting the upload line
causes the server crash.
Argh.
- chess hazlett
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: rivet upload causes server crash
Posted by "David N. Welton" <da...@dedasys.com>.
Charles_S_Hazlett@raytheon.com wrote:
> Here's the original post to comp.lang.tcl:
> http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/efd78335da7dda95/a576aeb60ec3c8c9?lnk=raot
>
> The short explanation is, running on winXP, a file upload in rivet causes
> apache to crash, but does succeed in creating the file, but zero-length, in
> the target upload directory. I pulled the 7.0 and 5.0 installs from
> http://www.apache.org/dist/tcl/rivet/binary/
> and have tried both; the crash occurs no matter what.
>
> On an additional interesting note, I installed the threaded active tcl
> 8.4.12 release, and that broke rivet completely. Reverted back to tcl
> 8.4.11.1 and rivet was happy once again, if still choking on uploads.
Jeff - note the above, since you asked before...
> I've configured this thing six ways to sunday-- anyone have any
> suggestions?
I can have a look at it if you post the smallest configuration/code
snippet that causes the crash.
Also, which Apache are you using?
--
David N. Welton
- http://www.dedasys.com/davidw/
Linux, Open Source Consulting
- http://www.dedasys.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org