-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Code generated with --fdmd-trace-functions segfaults when threads are used #3447
Comments
Could this be related? https://github.com/dlang/dmd/blob/2fea187ca09988e493759c538b8aeeb139aad6e2/src/dmd/glue.d#L1097-L1098 Because this code sample doesn't segfault with DMD, only with LDC. |
This is not a segfault, but some |
From your call stack, https://github.com/dlang/druntime/blob/69d120f5ef5a3176963503496ffaef6fd59b3fd4/src/rt/dmain2.d#L183 seems to be a problem, as that atomicOp is already instrumented, but the code apparently relies on |
Yep sorry for the misnomer in the title. |
So it looks like the linker prefers an (instrumented) atomicOp instantiation from your code, not one from (uninstrumented) druntime. This might be due to COMDATs breaking the one-definition-rule (dropped with LDC v1.22 for ELF targets). The call should probably be inlined as well, at least for a release druntime; that might be due to missing |
|
Works on Linux x64 with v1.21 according to run.dlang.io, so I won't be able to test this myself. |
I'll try it myself once I set up building LDC on the Mac. Thanks for all the pointers! |
You don't need to build LDC yourself, you can just download the macOS artifact from https://dev.azure.com/ldc-developers/ldc/_build/results?buildId=1700&view=artifacts&type=publishedArtifacts (the latest CI run for #3442). |
It worked! |
Well, it worked for the simple test-case, but in a more elaborate one it failed. But I haven't reduced it for the second case yet. |
Test-case:
Run:
Here's LLDB:
The text was updated successfully, but these errors were encountered: