Stripped the patch a little. Changelog remains unchanged.
Thomas 2002-10-17 Thomas Pfaff <[EMAIL PROTECTED]> * thread.cc (verifyable_object_isvalid): Test for static object first. (pthread_mutex::init): Add test for valid initializer object. On Thu, 17 Oct 2002, Thomas Pfaff wrote: > > This patch should fix the segfault in pthread_mutex::init by changing > the > test order for a valid object and checking for valid initializer object > first.. > > Thomas > >
--- thread.cc.org Sun Oct 6 03:00:23 2002 +++ thread.cc Thu Oct 17 10:28:32 2002 @@ -1356,12 +1356,12 @@ verifyable_object_state verifyable_object_isvalid (void const * objectptr, long magic, void *static_ptr) { verifyable_object **object = (verifyable_object **)objectptr; + if (static_ptr && *object == static_ptr) + return VALID_STATIC_OBJECT; if (check_valid_pointer (object)) return INVALID_OBJECT; if (!*object) return INVALID_OBJECT; - if (static_ptr && *object == static_ptr) - return VALID_STATIC_OBJECT; if (check_valid_pointer (*object)) return INVALID_OBJECT; if ((*object)->magic != magic) @@ -2257,7 +2257,7 @@ pthread_mutex::init (pthread_mutex_t *mu return EINVAL; /* FIXME: bugfix: we should check *mutex being a valid address */ - if (isGoodObject (mutex)) + if (!isGoodInitializer (mutex) && isGoodObject (mutex)) { mutexInitializationLock.unlock (); return EBUSY;