Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My program crashes on a call to Unix.write #6055

Closed
vicuna opened this issue Jun 27, 2013 · 5 comments
Closed

My program crashes on a call to Unix.write #6055

vicuna opened this issue Jun 27, 2013 · 5 comments
Milestone

Comments

@vicuna
Copy link

vicuna commented Jun 27, 2013

Original bug ID: 6055
Reporter: pmeunier
Status: closed (set by @xavierleroy on 2015-12-11T18:23:58Z)
Resolution: not a bug
Priority: normal
Severity: crash
OS: Linux and Mac OS
Version: 4.00.1
Target version: 4.01.1+dev
Category: standard library

Bug description

The programs produced by patoline (http://patoline.org) with our "Net" driver crash when used with safari.
The crash seems to occur on a call to Unix.write. It happens on each session, maybe not on the first slide. I could not give a small example.

Steps to reproduce

Compile the attached program with

ocamlfind ocamlopt -o slides_server -package "cryptokit,str" -thread -linkpkg slides_server.ml

Then run it: ./slides_server -master master

Open firefox at localhost:8080/master
And safari/webkit at localhost:8080

Go back and forth between the slides.
After at most two or three slides, and/or a page reload in safari, the server silently crashes.

Additional information

In some versions of safari, the page may remain blank, due to a bug in my implementation of the old version of websockets they use. However, I believe that my program should not crash.

File attachments

@vicuna
Copy link
Author

vicuna commented Jul 2, 2013

Comment author: @damiendoligez

Reproduced on MacOS, but the server crash is not silent, I get this message:
not pushed (Unix.Unix_error(Unix.EPIPE, "write", ""))

Note: I don't get the crash in the byte-code version.

@vicuna
Copy link
Author

vicuna commented Jul 25, 2013

Comment author: @damiendoligez

Is there some hidden state in the server? At one point I had it crashing on every "back" keystroke, but then I removed Safari's cache for localhost, and now I can't make it crash at all.

@vicuna
Copy link
Author

vicuna commented Jul 25, 2013

Comment author: gerd

EPIPE is a normal condition for a web server. Browsers sometimes reset the TCP connection to the server, and this is reported to the program as EPIPE (but ECONNRESET is also possible). Note that EPIPE implies a signal by default, hence the impression of a crash. You should set this signal to ignored (Sys.set_signal), and handle exceptions from Unix.write.

@vicuna
Copy link
Author

vicuna commented Aug 19, 2013

Comment author: @damiendoligez

So do we agree that this is not a bug? pmeunier?

@vicuna
Copy link
Author

vicuna commented Aug 19, 2013

Comment author: pmeunier

Yes, sorry for the noise.

@vicuna vicuna closed this as completed Dec 11, 2015
@vicuna vicuna added the stdlib label Mar 14, 2019
@vicuna vicuna added this to the 4.01.1 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant