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

[Bug] Windows CI segfaulting during tests #172

Open
cretz opened this issue Oct 17, 2024 · 1 comment
Open

[Bug] Windows CI segfaulting during tests #172

cretz opened this issue Oct 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@cretz
Copy link
Member

cretz commented Oct 17, 2024

Describe the bug

Looking at CI for Windows, segfaults are continuously occurring during the test portion and it is not known why. This could be related to running the dev server in a mssy2/mingw environment and not Ruby, unsure. Investigate.

@cretz cretz added the bug Something isn't working label Oct 17, 2024
@cretz
Copy link
Member Author

cretz commented Oct 17, 2024

So I have some backtraces from gdb like:

#0  0x00007ffcc22b7618 in x64-ucrt-ruby330!rb_w32_Sleep () from c:\dls\ruby-3.3.5\bin\x64-ucrt-ruby330.dll
#1  0x00007ffcb14fc9a2 in parking_lot::raw_mutex::RawMutex::lock_slow () from c:\work\tem\sdk-ruby\temporal-sdk-ruby\temporalio\lib\temporalio\internal\bridge\temporalio_bridge.so
#2  0x00007ffcb14e3568 in tokio::runtime::blocking::pool::Inner::run () from c:\work\tem\sdk-ruby\temporal-sdk-ruby\temporalio\lib\temporalio\internal\bridge\temporalio_bridge.so
#3  0x00007ffcb14a3b0a in std::sys::backtrace::__rust_begin_short_backtrace () from c:\work\tem\sdk-ruby\temporal-sdk-ruby\temporalio\lib\temporalio\internal\bridge\temporalio_bridge.so
#4  0x00007ffcb14c4d3f in core::ops::function::FnOnce::call_once{{vtable.shim}} () from c:\work\tem\sdk-ruby\temporal-sdk-ruby\temporalio\lib\temporalio\internal\bridge\temporalio_bridge.so
#5  0x00007ffcb1620a5d in std::sys::pal::windows::thread::Thread::new::thread_start () from c:\work\tem\sdk-ruby\temporal-sdk-ruby\temporalio\lib\temporalio\internal\bridge\temporalio_bridge.so
#6  0x00007ffd6078257d in KERNEL32!BaseThreadInitThunk () from C:\windows\System32\kernel32.dll
#7  0x00007ffd61e4af28 in ntdll!RtlUserThreadStart () from C:\windows\SYSTEM32\ntdll.dll
#8  0x0000000000000000 in ?? ()

Similar shown here when I turn on debug symbols. Basically it looks like somehow parking_lot::raw_mutex::RawMutex::lock_slow is calling rb_w32_Sleep which is so strange. I would expect rb_w32_Sleep to segfault if called from a non-Ruby thread (it asks for Ruby thread local info using TlsGetValue and always assumes that returns a non-null pointer, but in this case it is a null pointer). I wonder if somehow https://github.com/Amanieu/parking_lot/blob/0.12.3/core/src/thread_parker/windows/bindings.rs#L31 is actually picking up https://github.com/ruby/ruby/blob/v3_3_5/include/ruby/win32.h#L159 due to how the build is working that is putting Ruby headers on the gcc path or included alongside the Rust code. Very confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant