_impure_ptr invalid after task_delete() called?

Phil Torre ptorre at zetron.com
Wed May 29 21:23:06 UTC 2002

On Thu, May 30, 2002 at 07:03:39AM +1000, Chris Johns wrote:
> This is what I suspected. The order of installing the user extension
> defines the order the extensions are called when a task is deleted. This
> is based on the way the core is written so depending on it is not
> recommended as it could change. That is the user extension can be
> prepended or appended to the user extension chain. The order of
> initialisation also effects things and this is harder to define and
> control.
> I see no RTEMS based solution with-out a change to the user extension
> API to define some sort of order parameter.
> If a task is deleting itself, could you have it clean up before deleting
> itself ?
Yes, and that is my current solution to this problem.  (If the task were
being unexpectedly killed by someone else, I'd recode it to send the
victim task a "kill yourself" message.)

Its easy to work around once you know what's happening.  The code in
question was using per-task variables and registering a destructor
with the variable_add function.  It wasn't obvious that we were even
using a user extension or what that implied for the destructor.


Phil Torre                               phone: 425-820-6363 x234
Design Engineer                          email: ptorre at zetron.com
Switching Systems Group                    fax: 425-820-7031
Zetron, Inc.                               web: http://www.zetron.com


More information about the users mailing list