Skip to content

Fix backwards timeout condition#2759

Merged
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:fix-timeout-expiration
Feb 23, 2023
Merged

Fix backwards timeout condition#2759
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:fix-timeout-expiration

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

@stevenengler stevenengler commented Feb 22, 2023

The timeout condition in the SysCallCondition is backwards, causing the process to wake up before its timeout has expired. (And maybe not wake up at all when it does exceed the timeout?)

(This doesn't fix our tor onion service stream timeout issue.)

@stevenengler stevenengler self-assigned this Feb 22, 2023
@github-actions github-actions bot added the Component: Main Composing the core Shadow executable label Feb 22, 2023
@sporksmith
Copy link
Copy Markdown
Contributor

I'm surprised this didn't cause any tests to fail. I suppose we need specifically a blocking syscall with a deadline with a condition that becomes true, but is falsified before the event runs...

@stevenengler
Copy link
Copy Markdown
Contributor Author

I'm surprised this didn't cause any tests to fail. I suppose we need specifically a blocking syscall with a deadline with a condition that becomes true, but is falsified before the event runs...

Yeah I think it depends on if the syscall handler believes the value of _syscallcondition_satisfied() (if it believes that the syscall condition trigger wasn't spurious), or if it does its own check to see if it should re-block and create a new syscall condition. I'm not sure what happens though if there become multiple syscall conditions with their own timers.

@stevenengler
Copy link
Copy Markdown
Contributor Author

The tor benchmark networking results change slightly, but not significantly. The runtime and memory results do not change.

https://github.com/shadow/benchmark-results/tree/master/tor/2023-02-22-T15-06-28

@stevenengler stevenengler force-pushed the fix-timeout-expiration branch from 59fbb03 to 7bf4b5c Compare February 23, 2023 15:41
@stevenengler stevenengler merged commit a8f4901 into shadow:main Feb 23, 2023
@stevenengler stevenengler deleted the fix-timeout-expiration branch February 23, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants