i Peter,

Peter Griffin wrote:
Also, my illegal instruction happens after running a short time. My simple example prints in a loop, and starts a thread that prints in a loop. I see the child thread loop about a dozen times before the illegal instruction.
-
allon


I had a very similar bug when getting pthreads working on a uClinux port I was doing.

The problem turned out to be incorrect cache flushing on the signal trampoline (arch/kernel/signal.c -- setup_frame()).

The pthread library uses lots of signals to wake up and manage threads etc.

If the signal trampoline is not properly flushed, you can get a cache hit rather than executing the trap instruction which is written into the user tasks stack frame to return from the signal handler. If this happens you end up executing your stack :-(

A simple way to check if this is the problem is to turn the cache off completely and see if your pthread apps run ok (albeit slowly).

For the m68knommu arch at least that was fixed earlier this
year in a patch by Wilson Callan. I pushed that to main line
(certainly in 2.6.26, maybe even 2.6.25 - I would have to double
check that).

Regards
Greg


------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     [EMAIL PROTECTED]
SnapGear -- a Secure Computing Company      PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to