Skip to content

Conversation

@ChrisDryden
Copy link
Collaborator

@ChrisDryden ChrisDryden commented Dec 29, 2025

This GNU test is a tough one because it references the source code directly to use GDB to set up a race condition and it is testing a race condition that architecturally the Rust implementation doesn't have.

It appears that the reason this test exists is because the GNU implementation performs the read before setting up the watchers, and the uutils implementation sets up the watchers before performing the read so the race condition does not exist. I tried to come up with the best "Equivelant" for where to point the gdb source to break on and came up with the watcher_rx.watch_with_parent line in watch.rs since its the same equivalent of breaking before setting up the watcher.

Its not to say the test isn't useful for regressions, if we do change the architecture to perform the reads before the watches, this test will make sure that we handle race conditions in that scenario.

@ChrisDryden ChrisDryden marked this pull request as ready for review December 29, 2025 15:23
@oech3
Copy link
Contributor

oech3 commented Dec 29, 2025

Oh, not upstreamable form... I hope that this hack is last 2

@ChrisDryden
Copy link
Collaborator Author

At least there's only three GDB tests in the whole GNU test suite, these two and rm/r-root.sh which is even more problematic because it uses LD_PRELOAD and gdb. I am not sure how you would approach coming up with an upstream test for this one since its testing for an architecture that we don't have.

@ChrisDryden
Copy link
Collaborator Author

I wonder if to think outside the box for these ones, instead of patching, we could come up with a new criteria for these types of tests, instead of SKIP its a "INCOMPATIBLE". or something similar. Something to indicate to the organizations relying on the GNU test compatibility metric to understand that there's a difference between skipping because uutils doesn't support it and skipping because the tests are implementation specific and are not compatible with the uutils implementation.

@oech3
Copy link
Contributor

oech3 commented Dec 29, 2025

I think r-root.sh could be replaced by unshare, but GNU's thought is "widely supported LD_PRELOAD is better".

@oech3
Copy link
Contributor

oech3 commented Dec 29, 2025

I still want to keep leaving not compatible tests to the log. Someone saw them might find actual bugs/security issues from them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants