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

EINTR always retries? #14

Open
rrnewton opened this issue Feb 15, 2018 · 3 comments
Open

EINTR always retries? #14

rrnewton opened this issue Feb 15, 2018 · 3 comments
Labels

Comments

@rrnewton
Copy link
Member

rrnewton commented Feb 15, 2018

Some system calls (e.g. open) get interrupted in the middle by a signal. The safe thing to do is just retry them and ensure determinism rather than bombing the job.

The problem is that in the ptrace model we don't have a simple way to just RETRY a system call. We could move the PC pointer up to replay that part of the computation. But would need to be able to restore the arguments.

It's important to know which system calls MUTATE the memory space of the process that calls them. (And if those mutations are idempotent....)

We are thinking of some system calls that take a pointer argument and populates a piece of heap memory at that address. Sometimes the behavior is conditional (because it might depend on whether something is zero). We need to look out for these.

[Recall: we need a retrying capability for read syscalls anyway (#20)]

@rrnewton
Copy link
Member Author

rrnewton commented Feb 15, 2018

The counter-proposal is that we control the signals and avoid the EINTR in the 1st place.
That sounds pretty appealing, because the man pages are quite clear, that only signals should cause EINTR.

@gatoWololo gatoWololo added the bug label Feb 21, 2018
@rrnewton rrnewton changed the title EINTR retries EINTR always retries? Feb 22, 2018
@rrnewton
Copy link
Member Author

I'm going to close this issue for now, on the theory that we will indeed prevent EINTR from every happening. If we cannot maintain that invariant, let's come back, reopen this, and then turn it into a retry.

@devietti
Copy link
Collaborator

devietti commented Mar 1, 2018

Reopening this until we are actually catching EINTR and throwing a runtime_error. Probably should do this in a blanket way for all system calls.

@devietti devietti reopened this Mar 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants