Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"execve: Argument list too long" should not be a Failure #556

Open
Innf107 opened this issue Jun 16, 2023 · 1 comment · May be fixed by #561
Open

"execve: Argument list too long" should not be a Failure #556

Innf107 opened this issue Jun 16, 2023 · 1 comment · May be fixed by #561
Labels
bug Something isn't working

Comments

@Innf107
Copy link

Innf107 commented Jun 16, 2023

Currently, when passing arguments to a program with the new Eio.Process API, E2Big errors are propagated as Failure "execve: Argument list too long".
Programs using this API should be able to handle such an error. In my case, I am using this in an interpreter, where I would like to attach a call trace to the exception.
The current Failure exception effectively makes it impossible to do this robustly, since the error message is expected to be able to change at any point (which is not that unreasonable to expect in this case, since the current message is pretty misleading. The real error is that the total number of bytes is too large, not that there are too many arguments).

At the very least, raising a dedicated exception would prevent Warning 52: fragile constant pattern when handling the error.

@talex5
Copy link
Collaborator

talex5 commented Jun 19, 2023

Agreed. If you want to make a PR, these lines need changing to use raise (Eio.Process.err ...).

| err -> failwith err

| err -> failwith err

talex5 added a commit to talex5/eio that referenced this issue Jun 29, 2023
`readdir (dir, ".")` worked, but `readdir (dir, "")` didn't.

Also, improve formatting of empty paths (`<cwd:>` becomes `<cwd>`).

Fixes ocaml-multicore#556 (reported by Simon Grondin).
@talex5 talex5 added the bug Something isn't working label Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants