#4270 closed defect (fixed)

A failing task extension produces zombi objects and resource leaks

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 6.1
Component: score Version:
Severity: normal Keywords: qualification
Cc: Blocked By:
Blocking:

Description (last modified by Sebastian Huber)

In _Thread_Initialize() we have this code:

  _Objects_Open_u32( &information->Objects, &the_thread->Object, config->name );

  /*
   *  We assume the Allocator Mutex is locked and dispatching is
   *  enabled when we get here.  We want to be able to run the
   *  user extensions with dispatching enabled.  The Allocator
   *  Mutex provides sufficient protection to let the user extensions
   *  run safely.
   */
  extension_status = _User_extensions_Thread_create( the_thread );
  if ( extension_status )
    return true;

If an extension fails, then the thread object is not closed. Also the delete extensions are not called. If a later create extension fails, the earlier create extensions may have allocated resources which could be freed by a corresponding delete extension.

Change History (3)

comment:1 Changed on 02/26/21 at 07:51:50 by Sebastian Huber

Description: modified (diff)

comment:2 Changed on 02/26/21 at 08:26:30 by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In 1ac4a85/rtems:

score: Fix thread initialization

Close the thread object if a thread create extension fails. Also call
the delete extension to avoid resource leaks in early extensions if a
late extension fails.

Close #4270.

comment:3 Changed on 06/23/21 at 07:07:55 by Sebastian Huber

Keywords: qualification added
Note: See TracTickets for help on using tickets.