On Sat Apr 27 12:47:38 2024 +0000, Rémi Bernon wrote:
I don't think there's any difference in one case or the other. In both case we access an invalid `object_shm` pointer in `get_thread_session_object`, either because the lock id is uninitialized and != 0, or because the pointer is uninitialized and != NULL, before doing anything with the session pointer. IMO the lock initial state requirement is the same as initializers for pthread mutexes, and I've added an OBJECT_LOCK_INIT definition to make it more explicit. The (zeroed) initial lock state is a valid state -unlike a NULL pointer-, and only the lock state decides whether the object pointer is usable. The caller doesn't need to and shouldn't have to check the pointer value.
Right. Your new approach looks good enough. Sorry for wasting your time.