-
-
Notifications
You must be signed in to change notification settings - Fork 411
Fix Issue 19481: mutex.d(95) Error: pthread_mutex_init failed #2411
Conversation
|
Thanks for your pull request, @ibuclaw! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + druntime#2411" |
|
@TurkeyMan is about to add something like maxAlignment soon. |
|
But in the meantime, Sparc and i386 Solaris runtime is failing now, and this fixes it. |
|
See #2412 for the traits from @TurkeyMan's PR. |
|
Would it be better/easier to avoid using an array to define |
Granted that there's only two locks, there's nothing lost having two separate static variables instead. |
I think that's just over engineering the problem. There's no need to wrap it up in a struct. |
|
I'm strongly against repeating the compiler's alignment calculation logic. Repeating it is over-engineering. I agree with with @schveiguy that code could be even simpler and less error prone if we do away with the array entirely. |
The small pattern that rounds a number up to an alignment boundary? It's hardly repeating the compiler (we're doing something that the compiler didn't - as it doesn't make sense to add padding to the end of classes), and is used throughout in various other places from varargs to sections (perhaps there should be an |
I think such a helper would be really useful, I missed it countless times too. |
|
Rebased. |
schveiguy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
|
Hmm |
|
This is what happens when |
@ibuclaw: |
|
@thewilsonator - Shall we just move forward? The fix for Mecca will not work until this gets merged anyway... @klickverbot - I know, but I still like to complain about long compile times caused by inability to discard instantiated symbols. ;-) |
|
Meanwhile, Solaris port is broken... |
Mecca can be patched to check for the static if (__traits(hasMember, Thread, "_locks"))
{
pragma(mangle, "_D4core6thread6Thread6_locksG2G72v") extern __gshared static
void[__traits(classInstanceSize, Mutex)][2] _locks;
}
else
{
pragma(mangle, ...) extern __gshared
align(mutexAlign) void[mutexClassInstanceSize] _slock;
} |
|
There should be some impending deadline or high priority label, as gcc-9 release is only 4 weeks away and this needs to be in before then to unblock the completion of porting of a few primary architectures. |
|
We can always temporarily remove mecca if the maintainers are unresponsive or switch to master if creating a new tag is not possible. We have done that in the past too. |
|
The maintainers are reasonably responsive, the breakage is due to them needing internals of |
We don't offer any ABI compatibility. |
Using |
The Mecca lib has locked itself out of being platform independent anyway, due to this assert. |
Yes, but if we’re going to use |
|
Thats not the problem: error: undefined reference to '_D4core6thread6Thread6_locksG2G72v'
|
|
It's still using the |
|
Ahh. |
|
@thewilsonator this still looks suspicious to me: https://github.com/weka-io/mecca/blob/1f6909ec02d19ef2115b7c7402cf4c0327bd316a/src/mecca/lib/memory.d#L453-L454. Having two symbols with the same name in the same scope, as far as I can see. |
|
Probably, but thats not the reason it is failing at the moment. |
No, but it still needs to be fixed. When they fix/add a new tag it's going to fail for another reason. |
|
|
Sorry about the missing |
|
Rebased, interestingly still get undefined reference. |
|
Using the correct tag now at least. |
|
Nope, the tag was never correct in the first place. |
|
Created a v0.0.10 tag with the new commit: https://github.com/weka-io/mecca/releases/tag/v0.0.10 |
|
And now it is failing as we expected. No point creating more tags until the problem in mecca is fixed. |
|
It appears mecca has already been disabled: https://github.com/dlang/ci/blob/9d820657ea140e7128ba9daf4b60f68bfd54afb8/buildkite.sh#L145 Please rebase. |
|
Rebased. |
|
Auto-merge toggled on |
As seen on at least Solaris, maybe SPARC/Linux as well.