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

Re: [microblaze-uclinux] pthread_mutex_unlock() on unlocked mutex lock system hard



At Wed, 25 Aug 2004 19:44:39 +1000,
John Williams wrote:
> 
> Hi Yashi,
> 
> Yasushi SHOJI wrote:
> 
> > attached code locks system hard.  I'm not sure where to look
> > for. armnommu works just fine with same code, so this problem should
> > be microblaze specific. (or SUZAKU specific, I don't know)
> 
> pthreads support on microblaze is experimental - I worked on it for as 
> long as it took to get the thread_demos to ocmpile, link and run without 
>   total failure!

well, thread demo works on SUZAKU, too.  it's just unlock() on already
unlocked mutex kills the system.

> That said, your demo seems to run fine on my system (pretty standard 
> mbvanilla_net). Output:
> 
> # /mnt/yashitest
> process wait
> process run 0

thank you for the test.  and it's good to know the test works on other
platform.

> As for source of problem - by locks hard I assume you mean totally dead 
> system?  no ping reply, no interrupts, nothing?

no nothing..  sigh...

> If you use the mdm based debugging (see website for uClinux-specific 
> details), you can fire up xmd, connect, and basically trap the 
> microblaze "live".  Then load mb-gdb, you can do a stack unwind, see 
> where the execution context is, and see how it got there.  This only 
> works in kernel space though, so if you're locking in a library or app, 
> you're out of luck at this stage.

thanks for the info. i'll try.

> The arch-specific pthreads support lives in 
> uClibc/libpthread/linuxthreads/sysdeps/microblaze
> 
> Just browsing there now, I see some horrible code of mine - a user/lib 
> space cli() critical section for the semaphore implementation.  yuck. 

well, there is only a few way to implement test-and-set.

- cli/sti
- new syscall
- lamport algorithm
- k1/magic (playstation2)

> But, probably unlikely to be the cause of your problem.

that's what I thought.

regards,
--
           yashi
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/