Menu

#3 crashes failing to find my_tcb

open
nobody
None
5
2006-03-21
2006-03-21
Anonymous
No

I dont know if this list is still used but this may
help someone...

In taskActivate the pthread id is filled in as the
pthread is created as below

pthread_create((&tcb->pthrid.......

I believe this causes the new pthread to run before the
thread id is entered into the tcb. If a system is
heavily loaded (or I found under gdb) this may cause
errors where a task tries to find its own tcb and crashes.

an elastoplast is to put the following code into
task_wrapper to ensure the tcb is correct before the task
runs

tcb = (v2pthread_cb_t *)arg;

if (tcb->pthrid != pthread_self())
{
tcb->pthrid=pthread_self();
printf("!FIXED ONE!\n");

}

Steve

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.