6c656c
6c656c

Reputation: 322

OCaml Debugger: Exception uncaught

I'm trying to use ocamldebug. My program makes a lot of things and then write in a file. It compile and works fine, but when i use the ocamldebug and reach the part that it will write the file, the following exception is raised:

Uncaught exception: Unix.Unix_error (5, "waitpid", "")

Anyone could help me?

Upvotes: 2

Views: 271

Answers (1)

Jeffrey Scofield
Jeffrey Scofield

Reputation: 66823

I am not at all familiar with these issues, but when I do some googling I see discussion of a possible bug in the Unix module that causes uncaught SIGCHLD exceptions. I can recreate it on my OS X 10.8.2 system with OCaml 4.00.0:

$ ocaml
        OCaml version 4.00.0

# #load "unix.cma";;
# Sys.set_signal Sys.sigchld (Sys.Signal_handle ignore);;
- : unit = ()
# Unix.system "true";;
Exception: Unix.Unix_error (Unix.EINTR, "waitpid", "").

If you don't set the SIGCHLD signal to be ignored, you get a normal termination for true. Possibly the debugger is setting up some signal handling that is eliciting this bug.

How are you writing your output?

Upvotes: 3

Related Questions