HPUX and threads?

Tim Peters tim_one at email.msn.com
Mon Aug 2 07:55:48 CEST 1999

[Markus Stenberg, watching pthreads die under HPUX-11]
> # /opt/python/bin/python
> pthread_mutex_init: Invalid argument
> Memory fault(coredump)

>> The msg is coming from line 263 of Python/thread_pthread.h.  It
>> means the platform's
>> 		status = pthread_mutex_init(&lock->mut,
>> 					    pthread_mutexattr_default);
>> returned a non-zero (failure) status.  "Invalid argument" is what the
>> platform perror() produced.  A coredump after an error here isn't
>> surprising.

> Manual page says this.. wonder what lock->mut is, hopefully this type ;)
>       int pthread_mutex_init(
>          pthread_mutex_t *mutex,
>          const pthread_mutexattr_t *attr
>       );

Yes, lock->mut has the right type.  So it's griping about
pthread_mutexattr_default.  Near line 80 you'll find:

/* set default attribute object for different versions */

#if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D7)
#  define pthread_attr_default pthread_attr_default
#  define pthread_mutexattr_default pthread_mutexattr_default
#  define pthread_condattr_default pthread_condattr_default
#elif defined(PY_PTHREAD_STD) || defined(PY_PTHREAD_D6)
#  define pthread_attr_default ((pthread_attr_t *)NULL)
#  define pthread_mutexattr_default ((pthread_mutexattr_t *)NULL)
#  define pthread_condattr_default ((pthread_condattr_t *)NULL)

I can't tell you what to do next, but that's the place you need to do it.
It would help most if you could find someone who has used pthreads under
your God-forsaken OS <wink>.

    sometimes-works-ly y'rs  - tim

More information about the Python-list mailing list