[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread support plan with initial patch

From: NIIBE Yutaka
Subject: Re: Thread support plan with initial patch
Date: Sat, 7 Apr 2001 13:22:05 +0900 (JST)

NIIBE Yutaka wrote:
 > Yes.  After I've checked that it works fine,

Finally, I've got the situation of stable :-) core dumps.  GNU C
library compiled for i686 works fine, while the one for i386,i486,i586

The issue is how the pthread library find "self".  For i686, it uses
special registers, while it calculates the value from stack pointer
for i386,i486,i586.  If you have a time, please look at the
implementation (linuxthread).  The macro THREAD_SELF is the issue.

Here, I explain the case of i386,i486,i586.

When we link guile with -lpthread, functions in C library uses
features of pthreads library.  For example, malloc uses mutex to be
thread safe.  And when thread specific data is used, pthread library
need to find "self".  However, when COOP is used, pthread library trys
to find "self" with the stack of COOP, which is allocated by malloc,
and pthread library gets confused.  It results core dumps (eventually,
in unexpected way), because pthread library clobbers the memory with
wrong use of stack pointer.

The solution is simple.  When COOP is used, don't link -lpthread.
COOP doesn't work with the implementation of pthread library,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]