This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: question re: questions


On Fri, Jul 05, 2002 at 08:07:00PM +0200, Thomas Vander Stichele wrote:
> 
> > The second problem is the testcase reuses the stack memory. It seems
> > to really confuse the glibc. I will see if I can create a different
> > testcase.
> 
> Do you mean, that different threads are trying to use the same piece of 
> stack memory ? I will look over it some more now that you have provided 
> some help.

Linuxthreads is pretty much broken when you call pthread_create after
pthread_join and stack memory is reused for whatever reason. The
problem is the corrupted doubly linked list of active threads. The
linked list is maitained by pthread_handle_create and pthread_exited.
However, memset in pthread_allocate_stack can trash the doubly linked
list before the dead threads are removed from the active thread list.
I don't know what is the best fix. It can be very tricky.

I am enclosing the testcase here.


H.J.

Attachment: pthreadtest.c
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]