#1237 closed defect (fixed)

Interrupt during dispatch may fill up task stack

Reported by: Johan Zandin Owned by: Joel Sherrill
Priority: normal Milestone: 4.8
Component: unspecified Version: 4.5
Severity: critical Keywords:
Cc: johan.zandin@…, mattias.holm@… Blocked By:
Blocking:

Description

In the following scenario, the stack of a task may be completely filled:
1) During a context switch from task A to task B, an interrupt occurs within the last critical region of _Thread_Dispatch (the one where _Thread_Dispatch_disable_level is cleared).
2) As soon as ISR:s are enabled, the interrupt causes a new context switch (either back to task A or to some other task) before the dispatching of task B is fully completed.
3) During step 2, RTEMS adds a new frame to the stack of task B.
4) Step 1 to 3 are repeated several times, without task B being completely dispatched a single time inbetween. Each time, RTEMS adds a new frame to the task B stack, without removing the previous ones.
5) Finally the stack of task B is full and the software starts trashing the preceding part of the memory instead.

Attachments (2)

sparc-2.diff (8.3 KB) - added by Joel Sherrill on Apr 16, 2007 at 10:32:12 AM.
Revised and cleaned up patch which appears to work with 4.7
pr1237-46.diff (35.1 KB) - added by Joel Sherrill on May 10, 2007 at 5:44:04 PM.
slightly different patch for 4.6

Download all attachments as: .zip

Change History (6)

comment:1 Changed on Apr 10, 2007 at 11:34:29 AM by Johan Zandin

Cc: Johan Zandin added

comment:2 Changed on Apr 16, 2007 at 10:27:15 AM by Mattias Holm

Cc: Mattias Holm added

Changed on Apr 16, 2007 at 10:32:12 AM by Joel Sherrill

Attachment: sparc-2.diff added

Revised and cleaned up patch which appears to work with 4.7

Changed on May 10, 2007 at 5:44:04 PM by Joel Sherrill

Attachment: pr1237-46.diff added

slightly different patch for 4.6

comment:3 Changed on May 10, 2007 at 5:44:43 PM by Joel Sherrill

Resolution: fixed
Status: newclosed

The attached patches should be correct and applied to 4.6, 4.7, and the CVS head.

comment:4 Changed on Oct 10, 2017 at 6:35:44 AM by Sebastian Huber

Component: miscunspecified
Note: See TracTickets for help on using tickets.