Skip to content

Add SyscallNonDeterministicArg strace logger wrapper#3473

Merged
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:strace-determinism
Dec 28, 2024
Merged

Add SyscallNonDeterministicArg strace logger wrapper#3473
stevenengler merged 1 commit intoshadow:mainfrom
stevenengler:strace-determinism

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

@stevenengler stevenengler commented Dec 23, 2024

This makes the determinism tests pass again on my computer.

Example:

00:00:01.000000000 [tid 1000] futex(<pointer>, 265, 1001, <pointer>, <pointer>, <non-deterministic>) = 0

Closes #3460.

@stevenengler stevenengler self-assigned this Dec 23, 2024
@github-actions github-actions bot added Component: Testing Unit and integration tests and frameworks Component: Main Composing the core Shadow executable Component: Documentation In-repository documentation, under docs/ labels Dec 23, 2024
Copy link
Copy Markdown
Member

@robgjansen robgjansen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we (eventually) want to apply this to all pointer types too, where we don't want the value of the pointer to be printed? Or is our current method for handling those sufficient?

@stevenengler
Copy link
Copy Markdown
Contributor Author

Do we (eventually) want to apply this to all pointer types too, where we don't want the value of the pointer to be printed? Or is our current method for handling those sufficient?

Pointer types like *const u64 should already print "<pointer>" rather than an address/value if the "deterministic" option is enabled, for example like the implementation of deref_pointer_impl. The new wrapper is for types that are normally deterministic (such as u64), but aren't for some specific syscalls like ones that take a variable number of arguments or syscalls where integers are sometimes actually pointers. I'll add a comment to explain this better.

If you mean to reuse the new SyscallNonDeterministicArg wrapper in the deref_pointer_impl macro for example, I think we could do that, but I don't think we'd gain much from it.

This makes the determinism tests pass again on my computer.
@stevenengler stevenengler merged commit 087d71e into shadow:main Dec 28, 2024
@stevenengler stevenengler deleted the strace-determinism branch December 28, 2024 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Documentation In-repository documentation, under docs/ Component: Main Composing the core Shadow executable Component: Testing Unit and integration tests and frameworks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Determinism tests fail if ASLR can't be disabled

2 participants