_impure_ptr invalid after task_delete() called?
cjohns at cybertec.com.au
Wed May 29 21:03:39 UTC 2002
Phil Torre wrote:
> On Thu, May 30, 2002 at 05:35:48AM +1000, Chris Johns wrote:
> > Phil Torre wrote:
> > >
> > > Excellent. Many thanks, Fernando!
> > >
> > How does this fix the problem you posted ?
> Upon further investigation, it turns out that it doesn't. My bug
> was caused by libc_delete_hook() clearing the newlib reentrancy
> struct pointer before the code Fernando pointed out gets to run.
> I don't know if this is how it's supposed to work and the manual
> forgot to mention "don't call libc from a Thread_delete extension,
> or if it's a bona fide bug.
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
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
Chris Johns, cjohns at cybertec.com.au
More information about the users