Ok, I have sorted out the broken pipe thing, basically in the webserver
I am writing stuff out using this procedure:

 proc write_string[ostr with OByteStream[ostr]]
  (sk: ostr, var s: string)
  {
    var slen = len s;
    var a = C_hack::cast[address]$ cstr s;
    var eof: bool;
    write(sk, &slen, a, &eof);
  }
}

which is in  module Flx_stream, and which, as you can see,
ignores the eof flag. What happens when I load a page and
before it has finished loading, hit RELOAD (which is easy
when lots of debugging prints slow down the transmission),
is that Firefox shuts down its end of the connection and issues
a new request.. whereas the webserver is just continuing
to write on the closed connection.

This is easy to fix in flx_stream (just return eof or whatever).

This is a bit tricky to fix in the webserver, since propagating the
eof interferes with the control flow and we don't have any exceptions:
it can be done with a non-local goto though.

HOWEVER .. none of this explains why the webserver is CRASHING:
writing on a dead connection shouldn't cause a problem as long
as the actual socket is open.

I just got another crash with a "call to pure virtual" diagnostic. I promise 
you,
there aren't any such calls.. it has to be a memory corruption problem.

The webserver IS using the collector, it uses some functions that use
the option type to return a value or error (eg, searching a string for
another string). Still .. the crash seems to happen much too soon
for the gc to be doing a collection: I will have to check this.

The gc itself has been checked and checked and checked so many
times, it is known to crash when squeezed, and it may be that the
pthread waiting and stack checking code is causing the problems.

Anyhow I'm afraid fixing the webserver to stop it writing on a dead connection
may reduce the frequency of crashes which I don't want  (I want to eliminate
them :)



--
john skaller
[email protected]





------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to