Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006775OCamlstandard librarypublic2015-02-10 11:482016-12-07 11:47
Reportersliquister 
Assigned Togasche 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version4.02.2+dev / +rc1Fixed in Version4.02.2+dev / +rc1 
Summary0006775: Digest.file leaks fds on error
Description$ for _i = 0 to 10000; do try ignore (Digest.file "." : string) with e -> Printf.printf "%s\n%!" (Printexc.to_string e); done;;
...
(Sys_error ".: Too many open files")
(Sys_error ".: Too many open files")
(Sys_error ".: Too many open files")

Digest.file should catch exceptions and close the channel, for instance:

let file filename =
  let ic = open_in_bin filename in
  let d =
    try channel ic (-1)
    with e -> close_in ic; raise e
  in
  close_in ic;
  d
Tagspatch
Attached Files

- Relationships

-  Notes
(0013291)
gasche (administrator)
2015-02-15 22:11

Fixed in 4.02 and trunk. Thanks!

- Issue History
Date Modified Username Field Change
2015-02-10 11:48 sliquister New Issue
2015-02-12 23:25 doligez Tag Attached: patch
2015-02-12 23:25 doligez Target Version => 4.02.2+dev / +rc1
2015-02-12 23:25 doligez Status new => acknowledged
2015-02-15 22:11 gasche Note Added: 0013291
2015-02-15 22:11 gasche Status acknowledged => resolved
2015-02-15 22:11 gasche Fixed in Version => 4.02.2+dev / +rc1
2015-02-15 22:11 gasche Resolution open => fixed
2015-02-15 22:11 gasche Assigned To => gasche
2016-12-07 11:47 xleroy Status resolved => closed
2017-02-23 16:43 doligez Category OCaml standard library => standard library


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker