"Too many open files" error following lots of Pathreparse

Issue #14 resolved
Stephen Weeks
created an issue

Someone here got the below error with ocamlspotter and OCaml 3.12.1:

{{{ Pathreparse: not supported: { ... record type omitted ... } (Parsing.Parse_error) ... lots of repeats of the Pathreparse: not supported: { ... record type omitted ... } (Sys_error("...file name omitted...: Too many open files")) uncaught exception: Sys_error("...file name omitted...: Too many open files") BYE! }}}

I'm not sure if this bug is an infinite loop, or if there really are that many files needed open.

Comments (5)

  1. camlspotter repo owner

    Stephen, could you strace and see which files are opened so many times? I guess it is one file, not many.

    One quick workaround for you could be to disable this Pathreparse thing. Comment out the definition like:

    (* annots and region improvement by path *) let annots, r = ... in

    ocamlspot.ml around line 155.

  2. Stephen Weeks reporter

    The error is indeed the same file being opened over and over, and not closed. Here is one iteration of the bug from the strace.

    14503 open("$FILE", O_RDONLY) = 1021
    14503 fcntl(1021, F_SETFD, FD_CLOEXEC)  = 0
    14503 lseek(1021, 0, SEEK_CUR)          = 0
    14503 read(1021, "open Core_extended.Std\nopen Jane"..., 4096) = 4096
    14503 close(1021)                       = 0
    14503 write(1, "Pathreparse: not supported: {\n  "..., 1034) = 1034
    14503 open("$FILE", O_RDONLY) = 1021
    14503 fcntl(1021, F_SETFD, FD_CLOEXEC)  = 0
    14503 lseek(1021, 0, SEEK_CUR)          = 0
    14503 lseek(1021, 1410, SEEK_SET)       = 1410
    14503 read(1021, "{\n  instr                    : I"..., 4096) = 4096
    14503 open("$FILE", O_RDONLY) = 1022
    
  3. Log in to comment