Problem with rtems_task_variable_delete

Till Straumann strauman at slac.stanford.edu
Tue Dec 9 06:26:31 UTC 2003


This might be caused/related to an issue discussed a few months ago (see 
PR#504)
hopefully there is more in the list archives...

the appended file implements a workaround. It needs to be linked to the 
application
with -Wl,--wrap,free

Note that this is a workaround until a final solution is implemented.

HTH

-- Till

Paul Whitfield wrote:

> Dieter Schaefer wrote:
> -
>
>> Hello,
>>
>> trying to get telnetd to work (powerpc, rtems-4.6.0pre5) I 
>> experienced the following problem ...
>> trying various commands everything seems to work Ok, until I try to 
>> logoff from the telnet session. The system crashes, mean end up in 
>> the BSP panic handler.
>> Digging into the problem, it seems to be related with deleting a task 
>> variable.
>> If the task variable contains a pointer to malloc'ed memory and 
>> 'free' is passed to rtems_task_variable_add it will crash on deleting 
>> the task. Background: telnetd uses shell, and shell creates a 'user 
>> environment' after issuing a 'logoff', shell tries to execute a 
>> rtems_task_delete( RTEMS_SELF );  which in turn, at some point calls 
>> rtems_task_variable_delete(RTEMS_SELF, ... );
>> The same behavior can be reproduces with a slightly modified version 
>> of 'ticker test'  Adding a task variable pointing to malloc'ed space, 
>> assign different values etc. and deleting this space manually after 
>> 'rtems_task_variable_delete' everything works Ok. Passing 'free' to 
>> automatically delete this space, it ends up in the BSP panic handler.
>>
>> Did anybody experienced the same/similar problem? Or, even better, 
>> has a fix or work-around? 
>
>
>
> Yes I have seen a similar problem with the Telnetd and 
> rtems_task_variables.
>
> My solution was to remove the rtems_task_variable from the shell!
>
> Not a particularly good solution. This was with 4.5.0 so I was assuming
> that I had caused the problem by using a current version of the telnetd
> code with an old version of rtems.
>
> Regards
>
> Paul
>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gc.cc
URL: <http://lists.rtems.org/pipermail/users/attachments/20031208/7b8d9756/attachment-0001.ksh>


More information about the users mailing list