You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_dtcl@tcl.apache.org by yahalom emet <ya...@zvia.org.il> on 2001/11/07 11:52:53 UTC

Re: content-type problem

I installed the latest version and still I am getting:

[Wed Nov  7 12:36:47 2001] [notice] child pid 21873 exit signal Segmentation
fault (11)

wasn't it fixed?


Yahalom Emet
Software Developer
Xor Technologies Ltd.
----- Original Message -----
From: "David N. Welton" <da...@dedasys.com>
To: "yahalom emet" <ya...@zvia.org.il>
Cc: "Mod_dtcl" <mo...@tcl.apache.org>
Sent: Tuesday, October 30, 2001 6:16 PM
Subject: Re: content-type problem


> "yahalom emet" <ya...@zvia.org.il> writes:
>
> > I'm tring to use the ttml module as an xml Server. when I send xml
> > data to the ttml from tcl using http package I get an xml reply as
> > expected.
>
> Good...
>
> > when I use microsoft XMLHTTPRequest object to connect to the ttml
> > file I see in the apache error_log:
>
> > [Tue Oct 30 09:56:20 2001] [error] [client 192.116.217.98]
> > [libapreq] unknown content-type: `(null)'
>
> It figures that they are doing something stupid.
>
> The relevant code is this:
>
>     if (r->method_number == M_POST) {
> const char *ct = ap_table_get(r->headers_in, "Content-type");
> if (ct && strncaseEQ(ct, DEFAULT_ENCTYPE, DEFAULT_ENCTYPE_LENGTH)) {
>     result = ApacheRequest_parse_urlencoded(req);
> }
> else if (ct && strncaseEQ(ct, MULTIPART_ENCTYPE,
MULTIPART_ENCTYPE_LENGTH)) {
>    result = ApacheRequest_parse_multipart(req);
> }
> else {
>     ap_log_rerror(REQ_ERROR,
>   "[libapreq] unknown content-type: `%s'", ct);
>     result = HTTP_INTERNAL_SERVER_ERROR;
> }
>     }
>
> Basically, it's not being sent as
>
> #define DEFAULT_ENCTYPE "application/x-www-form-urlencoded"
>
> or
>
> #define MULTIPART_ENCTYPE "multipart/form-data"
>
> and they are sending it as 'none'.  That sucks.
>
> I would be very interested to see an strace (system call) of the
> transaction with your server..
>
> strace -o /tmp/outputfile -s 5000 apache -X
>
> > [Tue Oct 30 09:56:21 2001] [notice] child pid 5749 exit signal
Segmentation fault (11)
>
> This is my fault.  I have fixed and committed to CVS.
>
> > I changed in the XMLHTTPRequest object the content-type to different
> > setting but nothing change (only the unknown content-type in the
> > error_log)
>
> > when I run the xmlServer as a cgi script it works fine.
>
> I'm not sure about this... I mean, if it doesn't tell you how it's
> supposed to be parsed, then there isn't a lot to be done.
>
> --
> David N. Welton
>    Consulting: http://www.dedasys.com/
> Free Software: http://people.debian.org/~davidw/
>    Apache Tcl: http://tcl.apache.org/
>      Personal: http://www.efn.org/~davidw/


Re: content-type problem

Posted by "David N. Welton" <da...@dedasys.com>.
"yahalom emet" <ya...@zvia.org.il> writes:

> I have in the end of the ttml file exit command. this causes the
> exit. what happens when I do this?

Bad Things.  Don't do it:-)

> another question if I may:

> I am trying to set this header:

> <META http-equiv=Refresh content=360>

That's an HTML tag, not a header.

> so i do:

> headers set http-equiv=Refresh 360

> it does not work. what am I doing wrong?

You could do two things:

1) just include that HTML header.

2) something like this:

headers set Refresh "20 ; URL=display.ttml"

Ciao,
-- 
David N. Welton
   Consulting: http://www.dedasys.com/
Free Software: http://people.debian.org/~davidw/
   Apache Tcl: http://tcl.apache.org/
     Personal: http://www.efn.org/~davidw/

Re: content-type problem

Posted by yahalom emet <ya...@zvia.org.il>.
Silly me:-)

I have in the end of the ttml file exit command. this causes the exit. what
happens when I do this?

another question if I may:

I am trying to set this header:

<META http-equiv=Refresh content=360>

so i do:

headers set http-equiv=Refresh 360

it does not work. what am I doing wrong?

Thanks a lot

Yahalom Emet
Software Developer
Xor Technologies Ltd.
----- Original Message -----
From: "David N. Welton" <da...@dedasys.com>
To: "yahalom emet" <ya...@zvia.org.il>
Cc: <mo...@tcl.apache.org>
Sent: Wednesday, November 07, 2001 1:58 PM
Subject: Re: content-type problem


>
> Ok, the crash is not occuring because of the ___parse bug (it's fixed,
> of course).  Maybe the original one wasn't either?
>
> It actually serves up the response, but then does some odd things:
>
> write(6, "07-11
> 13:10:47\n<root><header><protocol>1</protocol>\n<oem>YAHALOM...")
> close(6)                                = 0
>
> This is what I have doubts about:
>
> fcntl64(2, F_GETFL)                     = 0x401 (flags O_WRONLY|O_APPEND)
> fcntl64(2, F_SETFL, O_WRONLY|O_APPEND)  = 0
> fcntl64(2, F_GETFL)                     = 0x401 (flags O_WRONLY|O_APPEND)
> fcntl64(0, F_GETFL)                     = 0x2 (flags O_RDWR)
> fcntl64(0, F_SETFL, O_RDWR)             = 0
> fcntl64(0, F_GETFL)                     = 0x2 (flags O_RDWR)
> --- SIGSEGV (Segmentation fault) ---
> +++ killed by SIGSEGV +++
>
> It looks like something you have is trying to fool around with stdin
> and stderr, which is probably not a good thing for it to be doing.  I
> don't think this is likely mod_dtcl's fault, or Apache's, but let's
> see if we can figure out what the problem is.  Maybe someone is
> writing Tcl packages that make bad assumptions about what environments
> they will run in.
>
> You might try eliminating pieces of library code one at a time to see
> if anything makes it go away.  You can also dig around and look for
> occurences of 'stderr' in the code.
>
> --
> David N. Welton
>    Consulting: http://www.dedasys.com/
> Free Software: http://people.debian.org/~davidw/
>    Apache Tcl: http://tcl.apache.org/
>      Personal: http://www.efn.org/~davidw/


Re: content-type problem

Posted by "David N. Welton" <da...@dedasys.com>.
Ok, the crash is not occuring because of the ___parse bug (it's fixed,
of course).  Maybe the original one wasn't either?

It actually serves up the response, but then does some odd things:

write(6, "07-11
13:10:47\n<root><header><protocol>1</protocol>\n<oem>YAHALOM...")
close(6)                                = 0

This is what I have doubts about:

fcntl64(2, F_GETFL)                     = 0x401 (flags O_WRONLY|O_APPEND)
fcntl64(2, F_SETFL, O_WRONLY|O_APPEND)  = 0
fcntl64(2, F_GETFL)                     = 0x401 (flags O_WRONLY|O_APPEND)
fcntl64(0, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(0, F_SETFL, O_RDWR)             = 0
fcntl64(0, F_GETFL)                     = 0x2 (flags O_RDWR)
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++

It looks like something you have is trying to fool around with stdin
and stderr, which is probably not a good thing for it to be doing.  I
don't think this is likely mod_dtcl's fault, or Apache's, but let's
see if we can figure out what the problem is.  Maybe someone is
writing Tcl packages that make bad assumptions about what environments
they will run in.

You might try eliminating pieces of library code one at a time to see
if anything makes it go away.  You can also dig around and look for
occurences of 'stderr' in the code.

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

Re: content-type problem

Posted by "David N. Welton" <da...@dedasys.com>.
"yahalom emet" <ya...@zvia.org.il> writes:

> I installed the latest version and still I am getting:
> 
> [Wed Nov  7 12:36:47 2001] [notice] child pid 21873 exit signal Segmentation
> fault (11)
> 
> wasn't it fixed?

Yes, it was.  Try sending me another strace so I can diagnose the
problem you are encountering.

After shutting apache down, do:

strace -o outputfile -s 5000 apache -X

then do one run of your program that makes it segfault, then send it
to me (maybe gzipping it - I only have a modem connection to the net).

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