Repository navigation
bug: obs-util: windows-gnu profiler_parity access violation - #682
Merged
Merged
Conversation
On x86_64-pc-windows-gnu, starting the C profiler exits 0xC0000005 before this fix. MSVC has no libgcc, so the same calls return. Refs obs-rust#441
zackees
approved these changes
Oct 14, 2026
libgcc emutls calls pthread_getspecific and loads pthread_key_t as a 32-bit unsigned long. The oracle's w32-pthreads key is a pointer, so on real Windows the truncated key is not a valid address. windows-gnu now renames those pthread, sem, and sched symbols to oracle_* and links libwinpthread for the unprefixed names. GCC 15 needs sys/stat.h before platform.h's struct stat. MSVC /W4 treats uthash's while (0) as C4127, so that warning is disabled with C4702. Fixes obs-rust#441 Local-Gate: v1 tree=5dce400cf7f35892300c42b81598a6898f74eae3 secs=472 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run Ci-Attestation: {"at":1791957527,"gate":"rust/all/fmt","host":"linux-x86_64","key":"79fbbb0031bd937abe8be2ca103ace2c95fa82a98f43d633c6e2d3e0d6435de3","lane":"lint","parents":["0f82bc0a34e8f51fd3c9e1d817e56e8232c88f11"],"secs":42,"stamp":"2dd9dac1f157ca1072218fb5554ca00c","tree":"5dce400cf7f35892300c42b81598a6898f74eae3","v":1,"via":"run"} Ci-Attestation: {"at":1791957527,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"79fbbb0031bd937abe8be2ca103ace2c95fa82a98f43d633c6e2d3e0d6435de3","lane":"lint","parents":["0f82bc0a34e8f51fd3c9e1d817e56e8232c88f11"],"secs":42,"stamp":"d87b630fd9f2056b2015f56be610cf0b","tree":"5dce400cf7f35892300c42b81598a6898f74eae3","v":1,"via":"run"} Ci-Attestation: {"at":1791957527,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"47a8ff0b77da71c65ac65d61e0242c0569b96b00b47620df0b621d74675f9821","lane":"rust-test","parents":["0f82bc0a34e8f51fd3c9e1d817e56e8232c88f11"],"secs":135,"stamp":"627a1e828325fb6b28238af64a0bd30d","tree":"5dce400cf7f35892300c42b81598a6898f74eae3","v":1,"via":"run"} Ci-Attestation: {"at":1791957527,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"68f639aca67118a8c7951aa8b05645819455ce8a787dbd49d06e3b8c79454f1c","lane":"cross","parents":["0f82bc0a34e8f51fd3c9e1d817e56e8232c88f11"],"secs":136,"stamp":"a781699c147dc880f123d3f296f35eb8","tree":"5dce400cf7f35892300c42b81598a6898f74eae3","v":1,"via":"run"} Ci-Attestation: {"at":1791957527,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"68f639aca67118a8c7951aa8b05645819455ce8a787dbd49d06e3b8c79454f1c","lane":"cross","parents":["0f82bc0a34e8f51fd3c9e1d817e56e8232c88f11"],"secs":136,"stamp":"5cf0c557cd10d28ea6893f43b72d39cc","tree":"5dce400cf7f35892300c42b81598a6898f74eae3","v":1,"via":"run"} Ci-Attestation: {"at":1791957527,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"68f639aca67118a8c7951aa8b05645819455ce8a787dbd49d06e3b8c79454f1c","lane":"cross","parents":["0f82bc0a34e8f51fd3c9e1d817e56e8232c88f11"],"secs":136,"stamp":"822ce47fdd348842f3159fefeb5cdbfb","tree":"5dce400cf7f35892300c42b81598a6898f74eae3","v":1,"via":"run"} Ci-Attestation: {"at":1791957527,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"68f639aca67118a8c7951aa8b05645819455ce8a787dbd49d06e3b8c79454f1c","lane":"cross","parents":["0f82bc0a34e8f51fd3c9e1d817e56e8232c88f11"],"secs":136,"stamp":"7e653eac2efe67d0f8f9ae1ab423ac14","tree":"5dce400cf7f35892300c42b81598a6898f74eae3","v":1,"via":"run"} Ci-Attestation: {"at":1791957527,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"68f639aca67118a8c7951aa8b05645819455ce8a787dbd49d06e3b8c79454f1c","lane":"cross","parents":["0f82bc0a34e8f51fd3c9e1d817e56e8232c88f11"],"secs":136,"stamp":"4e553f9f45985fb0e059b1c914f197be","tree":"5dce400cf7f35892300c42b81598a6898f74eae3","v":1,"via":"run"} Ci-Attestation: {"at":1791957527,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"68f639aca67118a8c7951aa8b05645819455ce8a787dbd49d06e3b8c79454f1c","lane":"cross","parents":["0f82bc0a34e8f51fd3c9e1d817e56e8232c88f11"],"secs":136,"stamp":"74dbaa0e6a68e9de6f16f8cbe90d71b0","tree":"5dce400cf7f35892300c42b81598a6898f74eae3","v":1,"via":"run"} Ci-Attestation: {"at":1791957527,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"72129a31187ce100be612fae7c74a538d8103eb42b4265c23cca4c5017fcb8f9","lane":"tier2-linux","parents":["0f82bc0a34e8f51fd3c9e1d817e56e8232c88f11"],"secs":159,"stamp":"9ab99000d0b59aa15ce69bf92bb01fb2","tree":"5dce400cf7f35892300c42b81598a6898f74eae3","v":1,"via":"run"}
Member
|
Rebased onto master, ran the local gate and stamped it, as you asked. Its cross lane builds and clippy-checks windows-gnu. Red → green: CI has no windows-gnu test lane, only MSVC on Windows, and the crash does not reproduce under Wine. So the RED (
|
zackees
force-pushed
the
fix/441-mingw-profiler-crash
branch
from
October 14, 2026 05:58
2925d06 to
1583d96
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #441
RED
0f82bc0a3:oracle_profiler_survives_process_tlsinprofiler_parity. Onx86_64-pc-windows-gnuthe process exits0xC0000005(STATUS_ACCESS_VIOLATION) insidepthread_getspecific, reading an address whose top 32 bits are zero. MSVC runs the same calls and returns.GREEN
2925d060c:oracle_profiler_survives_process_tlspasses on windows-gnu and on MSVC. The wholeobs-utilsuite passed locally forx86_64-pc-windows-gnu.libgcc emutls calls
pthread_getspecificand loadspthread_key_tas a 32-bit unsigned long. The oracle's w32-pthreads key is a pointer. On real Windows that pointer is above 4GB, so the truncated value is not a valid address. Wine and a debugger heap stay in the low 4GB, which is why the same binary survived there. windows-gnu now renames the oracle'spthread_*,sem_*, andsched_*symbols tooracle_*and links libwinpthread for the unprefixed names.The RED commit is the check that the rename matters: without it, that test crashes. The rename was put back in GREEN.
GCC 15 needs
sys/stat.hincluded beforeplatform.h'sstruct stat. MSVC/W4treats uthash'swhile (0)as C4127, so that warning is disabled next to the existing C4702 disable.Docker is not installed here, so the Tier 2 cmocka lane and the local-gate stamp were not run.
./linton this machine fails inci/unit tests becausecmakeis not onPATHand the working tree has an unrelated dirtyplugins/obs-websocketpointer.soldr rustfmt --checkpassed on the two Rust files in this PR. Please rebase onto master and stamp if this branch is behind or the stamp is required.Reporter: @zackees