#1817 closed defect

Variable _Thread_Heir is not protected against interrupts

Reported by: Helder Silva Owned by: Sebastian Huber
Priority: normal Milestone: 4.11
Component: score Version: 4.10
Severity: normal Keywords:
Cc: sebastian.huber@…, gedare@… Blocked By:
Blocking:

Description (last modified by Joel Sherrill)

Variable _Thread_Heir is protected against interrupts except when the
_Thread_Is_heir function is called from _Thread_Evaluate_mode from
rtems_task_mode. Interrupts need to be disabled before thread evaluation for
context switch.

Attachments (2)

1817.diff (9.1 KB) - added by Helder Silva on Sep 22, 2011 at 9:40:26 AM.
Patch of the bug implementation on the head of the repository 20110921
output.txt (124.8 KB) - added by Helder Silva on Sep 22, 2011 at 9:57:30 AM.
Tests output.

Download all attachments as: .zip

Change History (13)

comment:1 Changed on Jun 15, 2011 at 3:37:54 PM by Gedare Bloom

Cc: giddyup44@… added
Version: HEAD4.10

Changed on Sep 22, 2011 at 9:40:26 AM by Helder Silva

Attachment: 1817.diff added

Patch of the bug implementation on the head of the repository 20110921

Changed on Sep 22, 2011 at 9:57:30 AM by Helder Silva

Attachment: output.txt added

Tests output.

comment:2 Changed on Sep 22, 2011 at 10:05:54 AM by Sebastian Huber

attachments.ispatch: 01
attachments.mimetype: application/octet-streamtext/plain

comment:3 Changed on Sep 22, 2011 at 10:09:21 AM by Sebastian Huber

Cc: Sebastian Huber added

comment:4 Changed on Sep 22, 2011 at 1:20:03 PM by Sebastian Huber

Replying to comment:8:

Yes, you are right, if you consider *a=b as atomic instruction, the
_ISR_Disable
*a = b;
_ISR_Enable

is unnecessary. Please just keep in mind the final assembly code, which is

not atomic.

Yes, you are right. We have a read and a write.

comment:5 Changed on Nov 23, 2014 at 4:36:17 PM by Joel Sherrill

Description: modified (diff)
Owner: changed from Joel Sherrill to Sebastian Huber
Status: newassigned

Sebastian .. OK to close?

comment:6 Changed on Nov 24, 2014 at 11:06:51 AM by Sebastian Huber

I still don't know what the problem is.

comment:7 Changed on Nov 27, 2014 at 12:53:02 PM by Sebastian Huber

Resolution: fixed
Status: assignedclosed

I reviewed rtems_task_mode(). There is no problem since a call to a global function (_ISR_Set_level()) is between the executing->is_preemptible update and the call to _Thread_Is_heir().

comment:8 Changed on Nov 27, 2014 at 12:54:11 PM by Sebastian Huber

Resolution: fixed
Status: closedreopened

comment:9 Changed on Nov 27, 2014 at 12:54:27 PM by Sebastian Huber

Resolution: wontfix
Status: reopenedclosed

comment:10 Changed on Nov 27, 2014 at 3:56:16 PM by Gedare Bloom

You looked at 4.10 also?

comment:11 Changed on Nov 28, 2014 at 10:22:04 AM by Sebastian Huber

Thanks for the remainder. I looked now also at 4.10. I don't see a problem here.

Note: See TracTickets for help on using tickets.