Erlang/OTP Forums

Author Message

<  Yaws mailing list  ~  crash in yaws code leaves connection hanging

Guest
Posted: Tue Mar 11, 2008 12:03 am Reply with quote
Guest
I'm using yaws 1.75 in embedded mode, and it seems that a crash in
the yaws code in some situations leaves the client connection open
and hanging.

Here is the specific situation that triggered this for me just
today:

- I started yaws in embedded mode and passed it a #sconf record with
opaque = { some_tuple, ... }. (This will cause the crash later...)

- I have an appmod that selects one of a few CGI scripts based on
the path, like so:

out (YawsArg = #arg{ pathinfo = "/foo" }) ->
yaws_api:call_cgi (YawsArg, "/path/to/foo.cgi");
out (YawsArg = #arg{ pathinfo = "/bar" }) ->
yaws_api:call_cgi (YawsArg, "/path/to/bar.cgi").

- Then a request for /appmod/foo will hang forever. A crash like
this is reported through error_logger:

Error in process <0.9696.0> on node 'my_node' with exit value: {function_clause,[{lists,foldl,[#Fun<yaws_server.48.125267158>,{["foo"],{[],[]}},{some_tuple, ...}]},{yaws_server,vdirpath,3},{yaws_server,mappath,3},{yaws_cgi,cgi_env...

So, yes, it seems to be a bug that I passed #arg.opaque as a tuple
instead of a list (opaque is not very opaque after all...but
that's another discussion).

The disturbing part is that the client connection is not closed
when the crash occurs.

Is there an easy fix to ensure that crashes within yaws itself are
detected and handled as nicely as crashes within user appmods or
auto-generated modeuls from .yaws files?

Thanks,

Mike

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist
Guest
Posted: Tue Mar 11, 2008 8:06 am Reply with quote
Guest
Michael Radford wrote:

> Error in process <0.9696.0> on node 'my_node' with exit value: {function_clause,[{lists,foldl,[#Fun<yaws_server.48.125267158>,{["foo"],{[],[]}},{some_tuple, ...}]},{yaws_server,vdirpath,3},{yaws_server,mappath,3},{yaws_cgi,cgi_env...
>
> So, yes, it seems to be a bug that I passed #arg.opaque as a tuple
> instead of a list (opaque is not very opaque after all...but
> that's another discussion).

Agreed, there's some cruft in the opaque field e.g. vdir specifications
are there when they really should be a proper field in #sconf{}

>
> The disturbing part is that the client connection is not closed
> when the crash occurs.

Bad

>
> Is there an easy fix to ensure that crashes within yaws itself are
> detected and handled as nicely as crashes within user appmods or
> auto-generated modeuls from .yaws files?

Hmmm this needs to be debugged - I'll have a look at it. Thanks
for reporting.

Client socket should definitely die here.

/klacke

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum