You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-dev@tcl.apache.org by Ronnie Brunner <ro...@netcetera.ch> on 2002/03/05 18:53:51 UTC

current status: core dump

Working on solaris, I get core dumps when runnig th test suite (in
both threaded and non-threaded versions fo websh with apache 2 and
apache 1.3 respectively).

Since I ran all tests w/o problem this afternoon, some of the changes
from David or me must have created a problem. Anyone else with similar
observations? 

BTW: Compiling mod_websh for Apache 2 doesn't work because there are
some header files missing for interpool.c: the recent changes in

    if (strcmp(id, filename)) {
      struct stat statPtr;
      if (Tcl_Access(id, R_OK) != 0 ||
        Tcl_Stat(id, &statPtr) != TCL_OK)
	{
	  return NULL;
	}
	mtime = statPtr.st_mtime;
    }

now require 

    #include <sys/stat.h>
    #include <unistd.h>

on my machine. The are included in th Apache 1.3 headers, but not in
the Tcl headers and not in the Apache 2 headers. (Which is actually
strange, because it's something Tcl uses ...)

Ronnie
------------------------------------------------------------------------
Ronnie Brunner                               ronnie.brunner@netcetera.ch
Netcetera AG, 8040 Zuerich    phone +41 1 247 79 79 Fax: +41 1 247 70 75

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-dev-help@tcl.apache.org


Re: current status: core dump - GOT IT

Posted by Ronnie Brunner <ro...@netcetera.ch>.
> > However if we have a problem with the file system and/or permissions
> > on our file, we might want to check. -> check for errno != ENOENT
> > before logging (or some other flags), and do not return in any case
> > (just keep trying to remove the other files seems to be the proper
> > approach). David: can you look at this?
> 
> Ok, I'm curious... are you actually getting stuff in the error_log
> file?  I don't see anything.

I still had crashes even w/o the return: the call to  Tcl_PosixError
crashed, because when destroying the requestdata, interp == 0. -> I
changed that to  Tcl_ErrnoMsg(Tcl_GetErrno()), which is independent of
the interpreter.

Why no logs? I also looked at this: we don't get any logs, when interp
is NULL, which it is in our case. It is not, when a slave interpreter
is deleted. However, even there, the interp is already marked as
deleted, which prevents access to assoc data in the log facility -> 
even providing a valid interp pointer (instead of NULL) does not
create any logs. (So the statments are actually for nothing ;-). I
left them in anyway and fixed them so theoretically, they would report
properly what's happening.

Ronnie
------------------------------------------------------------------------
Ronnie Brunner                               ronnie.brunner@netcetera.ch
Netcetera AG, 8040 Zuerich    phone +41 1 247 79 79 Fax: +41 1 247 70 75

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-dev-help@tcl.apache.org


Re: current status: core dump - GOT IT

Posted by "David N. Welton" <da...@dedasys.com>.
Ronnie Brunner <ro...@netcetera.ch> writes:

> > > Since I ran all tests w/o problem this afternoon, some of the
> > > changes from David or me must have created a problem. Anyone else
> > > with similar observations?
> > 
> > Damn... they work for me.  I will go back through and look at them
> > all.
> 
> I tracked t down: the fix of checking the return value of remove in
> requst.c line 212ff causes the dump because of the return TCL_ERROR.

Ah, yeah... on second thought, the return isn't such a good idea.

> It seems we don't properly clean up some memory in hat case.  The
> checking does not make sense anyway: not being able to remove a
> tempfile is usually not a problem because it's not there in the
> first place: remove is called for every filename that was generated
> using [web::tempfile]. If the process removes it directly (or does
> not even use it), we shouldn't really log an error.

> However if we have a problem with the file system and/or permissions
> on our file, we might want to check. -> check for errno != ENOENT
> before logging (or some other flags), and do not return in any case
> (just keep trying to remove the other files seems to be the proper
> approach). David: can you look at this?

Ok, I'm curious... are you actually getting stuff in the error_log
file?  I don't see anything.

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-dev-help@tcl.apache.org


Re: current status: core dump - GOT IT

Posted by Ronnie Brunner <ro...@netcetera.ch>.
> > Since I ran all tests w/o problem this afternoon, some of the
> > changes from David or me must have created a problem. Anyone else
> > with similar observations?
> 
> Damn... they work for me.  I will go back through and look at them
> all.

I tracked t down: the fix of checking the return value of remove in
requst.c line 212ff causes the dump because of the return TCL_ERROR.
It seems we don't properly clean up some memory in hat case.
The checking does not make sense anyway: not being able to remove a
tempfile is usually not a problem because it's not there in the first
place: remove is called for every filename that was generated using
[web::tempfile]. If the process removes it directly (or does not even
use it), we shouldn't really log an error.
However if we have a problem with the file system and/or permissions
on our file, we might want to check. -> check for errno != ENOENT
before logging (or some other flags), and do not return in any case
(just keep trying to remove the other files seems to be the proper
approach). David: can you look at this?

Ronnie
------------------------------------------------------------------------
Ronnie Brunner                               ronnie.brunner@netcetera.ch
Netcetera AG, 8040 Zuerich    phone +41 1 247 79 79 Fax: +41 1 247 70 75

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-dev-help@tcl.apache.org


Re: current status: core dump

Posted by "David N. Welton" <da...@dedasys.com>.
Ronnie Brunner <ro...@netcetera.ch> writes:

> Working on solaris, I get core dumps when runnig th test suite (in
> both threaded and non-threaded versions fo websh with apache 2 and
> apache 1.3 respectively).

> Since I ran all tests w/o problem this afternoon, some of the
> changes from David or me must have created a problem. Anyone else
> with similar observations?

Damn... they work for me.  I will go back through and look at them
all.

> BTW: Compiling mod_websh for Apache 2 doesn't work because there are
> some header files missing for interpool.c: the recent changes in

>     #include <sys/stat.h>
>     #include <unistd.h>
 
> on my machine. The are included in th Apache 1.3 headers, but not in
> the Tcl headers and not in the Apache 2 headers. (Which is actually
> strange, because it's something Tcl uses ...)

Hrm...  I wonder if we ought to investigate the apr function that does
'stat'?  Those files are Apache specific, right, so we ought to be
able to count on that.

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-dev-help@tcl.apache.org