[gccsdk] Threading + Alt-Break = Trashed Computer

John-Mark Bell jmb202 at ecs.soton.ac.uk
Thu Jul 10 14:39:31 PDT 2008


On Thu, 10 Jul 2008, John-Mark Bell wrote:

> On Thu, 10 Jul 2008, John Tytgat wrote:
>
>> Ironically, moments after I've sent that message I got:
>> 
>>  Internal error: Abort on data transfer at &0000A658
>> 
>> So clearly there is something we want to identify and fix.
>
> I'm not currently in a position to check myself, but you may want to look at 
> what that address corresponds to in Adam's test binary. It's possible that 
> the ticker handler isn't getting removed correctly, and thus the OS is 
> calling back into an entirely different task after ours has died.

I've now checked this and the above address is within 
__pthread_callback(), which seems mildly odd, given that's only called by 
the signal handling code and pthread_yield() iirc.

[later]

It would appear that the Wimp pre/post filters aren't getting removed when 
whatever Alt-Break does happens. The way in which the Wimp reuses task 
handles means that the next Wimp task to start is pretty likely to inherit 
the handle of the task that was killed. The pthread filter address will 
then be called the first time it polls the Wimp and explosions will 
ensue.

Here's the salient output from *filters (modified for simplicity)

   With SigTest2 running:

   Type:  Filter name:      Task:      Mask:
   Pre    UnixLib pthread   SigTest2   N/A
   Post   UnixLib pthread   SigTest2   00000000

   After Alt-Break:

   Type:  Filter name:      Task:      Mask:
   Pre    UnixLib pthread   00003A08   N/A
   Post   UnixLib pthread   00003A08   00000000


Therefore, it seems obvious that the filters need removing by UnixLib when 
Alt-Break happens. Quite how we achieve this is left as an exercise for
the reader -- my knowledge of the watchdog is approximately nil.


J.




More information about the gcc mailing list