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

Join threads in MULTITHREADED_COMPUTE example. #5129

Merged

Conversation

jimblandy
Copy link
Member

@jimblandy jimblandy commented Jan 24, 2024

Join all threads before returning from the test case, to ensure that we don't return from main until all open Devices have been dropped.

This avoids a race condition in glibc in which a thread calling dlclose can unmap a shared library's code even while the main thread is still running its finalization functions. (See #5084 for details.) Joining all threads before returning from the test ensures that the Vulkan loader has finished dlclose-ing the Vulkan validation layer shared library before main returns.

Remove skip for this test on GL/llvmpipe. With this change, that has not been observed to crash. Without it, the test crashes within ten runs or so.

Fixes #5084.
Fixed #4285.

Checklist

  • Run cargo fmt.
  • Run cargo clippy.
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@jimblandy jimblandy requested a review from a team as a code owner January 24, 2024 01:47
Join all threads before returning from the test case, to ensure that
we don't return from `main` until all open `Device`s have been
dropped.

This avoids a race condition in glibc in which a thread calling
`dlclose` can unmap a shared library's code even while the main thread
is still running its finalization functions. (See gfx-rs#5084 for details.)
Joining all threads before returning from the test ensures that the
Vulkan loader has finished `dlclose`-ing the Vulkan validation layer
shared library before `main` returns.

Remove `skip` for this test on GL/llvmpipe. With this change, that has
not been observed to crash. Without it, the test crashes within ten
runs or so.

Fixes gfx-rs#5084.
Fixed gfx-rs#4285.
@jimblandy jimblandy force-pushed the multithreaded-compute-join-workers branch from cd5004c to 44af9dc Compare January 24, 2024 01:53
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Noice

@cwfitzgerald cwfitzgerald merged commit 6440af0 into gfx-rs:trunk Jan 24, 2024
27 checks passed
@jimblandy jimblandy deleted the multithreaded-compute-join-workers branch March 31, 2024 18:05
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.

Intermittent crashes in Vulkan tests on Linux Multithreaded Compute Segfaults in CI on GL/Linux
2 participants