| Anonymous | Login | Signup for a new account | 2013-05-24 06:46 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 | |||
| 0004119 | OCaml | OCaml general | public | 2006-09-21 14:49 | 2007-02-21 15:49 | |||
| Reporter | xleroy | |||||||
| Assigned To | weis | |||||||
| Priority | normal | Severity | major | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.10+dev | |||||||
| Target Version | Fixed in Version | 3.10+dev | ||||||
| Summary | 0004119: Issue with Scanf.Scanning.from_file | |||||||
| Description | (Reported on behalf of users at Athys.) The following program dies with a Sys_error("Bad file descriptor") exception, caused by reading from a closed in_channel. ------------- program -------------- open Printf let _ = let file = "toto" in let scanbuf = Scanf.Scanning.from_file file in let l = ref [] in try while not (Scanf.Scanning.end_of_input scanbuf) do l := (Scanf.bscanf scanbuf " %S -> %S ; " (fun c d -> c,d))::!l done with | Scanf.Scan_failure s -> failwith (sprintf "in file %s, %s" file s) | End_of_file -> failwith (sprintf "in file %s, unexpected end of file" file) -------------------------------- ---- input data file ./toto ---- "foo" -> "bar"; -------------------------------- | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0003803) weis (developer) 2006-10-04 12:10 |
Thanks for the bug report. This was due to interaction between mandatory closing of the input channel to the file and the end of file test condition. The bug is corrected and a corresponding regression test has been added to the library test suite. |
|
(0003804) weis (developer) 2006-10-04 12:14 |
A regression test for this bug has been added. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2006-09-21 14:49 | xleroy | New Issue | |
| 2006-10-04 12:10 | weis | Note Added: 0003803 | |
| 2006-10-04 12:14 | weis | Status | new => resolved |
| 2006-10-04 12:14 | weis | Fixed in Version | => 3.10+dev |
| 2006-10-04 12:14 | weis | Resolution | open => fixed |
| 2006-10-04 12:14 | weis | Assigned To | => weis |
| 2006-10-04 12:14 | weis | Note Added: 0003804 | |
| 2007-02-21 15:49 | xleroy | Status | resolved => closed |
| Copyright © 2000 - 2011 MantisBT Group |