www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19481] New: Aborting from

https://issues.dlang.org/show_bug.cgi?id=19481

          Issue ID: 19481
           Summary: Aborting from
                    local/libphobos/libdruntime/core/sync/mutex.d(95)
                    Error: pthread_mutex_init failed.
           Product: D
           Version: D2
          Hardware: Other
                OS: Solaris
            Status: NEW
          Severity: major
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

Thread._locks is not suitably aligned.

---

__gshared align(Mutex.alignof) void[__traits(classInstanceSize, Mutex)][2]
_locks;

static void initLocks()  nogc
{
    foreach (ref lock; _locks)
    {
        lock[] = typeid(Mutex).initializer[];
        (cast(Mutex)lock.ptr).__ctor();
    }
}

---

_locks should be aligned to pthread_mutex_t, not pointer size.

--
Dec 12 2018