From: Nicholas H. <he...@se...> - 2003-08-03 07:58:15
|
On Sun, 2003-08-03 at 03:13, Nicholas Henke wrote: > > And the code where it bomb looks like: > assert(pthread_getattr_func != NULL, "floating stack pthread > must have pthread_getattr_np"); > pthread_attr_t attr; > pthread_t tid = pthread_self(); > int rslt = > ((pthread_getattr_func_type)pthread_getattr_func)(tid, &attr); > if (rslt!=0) { > /* what else can we do?? */ > fatal("Can not locate current stack region!"); > } Just a followup, it looks like rslt == 3 here, which if I am reading things correctly corresponds to the errno : #define.ESRCH.. 3. /* No such process */ I am inlining some of the code for pthread_getattr_np (glibc-linuxthread/attr.c), there is a few lines that access the pid of the thread for some scheduling stuff. Maybe the pid is not getting masked correctly or something along those lines? int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr) { pthread_handle handle = thread_handle (thread); pthread_descr descr; if (handle == NULL) return ENOENT; descr = handle->h_descr; attr->__detachstate = (descr->p_detached . . . ? PTHREAD_CREATE_DETACHED . . . : PTHREAD_CREATE_JOINABLE); attr->__schedpolicy = __sched_getscheduler (descr->p_pid); if (attr->__schedpolicy == -1) return errno; if (__sched_getparam (descr->p_pid, . . . (struct sched_param *) &attr->__schedparam) != 0) return errno; The rest of the code does not return anything besides 0 or 1, so I am guessing it is the above actions that barfs it. Much confusion ;) Nic -- Nicholas Henke Penguin Herder & Linux Cluster System Programmer Liniac Project - Univ. of Pennsylvania |