| Anonymous | Login | Signup for a new account | 2013-05-23 10:13 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
| 0005953 | OCaml | OCaml otherlibs | public | 2013-03-15 18:20 | 2013-03-22 12:44 | |||||||
| Reporter | dim | |||||||||||
| Assigned To | dim | |||||||||||
| Priority | low | Severity | minor | Reproducibility | always | |||||||
| Status | resolved | Resolution | open | |||||||||
| Platform | OS | OS Version | ||||||||||
| Product Version | 4.01.0+dev | |||||||||||
| Target Version | 4.01.0+dev | Fixed in Version | ||||||||||
| Summary | 0005953: Unix.system does not handle EINTR | |||||||||||
| Description | Right now Unix.system calls waitpid and does not handle EINTR. This means that if a signal handler is set somewhere else in the program a call to Unix.system may fail with this error. I think Unix.system should waitpid again until it does not fail with EINTR since: - this is what the system(3) function of the libc does - the user does not have the pid of the sub-process so it cannot restart the call if it is interrupted The attached patch replace the call to waitpid in Unix.system by one to waitpid_non_intr. | |||||||||||
| Steps To Reproduce | # #load "unix.cma";; # Sys.set_signal Sys.sigchld (Sys.Signal_handle ignore);; - : unit = () # let ic = Unix.open_process_in "sleep 5";; val ic : in_channel = <abstr> # Unix.system "sleep 10";; Exception: Unix.Unix_error (Unix.EINTR, "waitpid", ""). | |||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
Notes |
|
|
(0008995) dim (developer) 2013-03-20 18:24 |
If nobody objects I'll merge the patch. |
|
(0009001) dim (developer) 2013-03-22 12:44 |
Applied in revisions 13421 and 13422. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2013-03-15 18:20 | dim | New Issue | |
| 2013-03-15 18:20 | dim | Status | new => assigned |
| 2013-03-15 18:20 | dim | Assigned To | => dim |
| 2013-03-15 18:20 | dim | File Added: 0001-handle-EINTR-in-Unix.system.patch | |
| 2013-03-15 18:27 | dim | Description Updated | View Revisions |
| 2013-03-20 18:24 | dim | Note Added: 0008995 | |
| 2013-03-22 12:44 | dim | Note Added: 0009001 | |
| 2013-03-22 12:44 | dim | Status | assigned => resolved |
| 2013-03-22 12:44 | dim | Target Version | => 4.01.0+dev |
| Copyright © 2000 - 2011 MantisBT Group |