[RTEMS Project] #1964: _Chain_Is_first/last overshoot

RTEMS trac trac at rtems.org
Wed Jan 10 14:36:07 UTC 2018


#1964: _Chain_Is_first/last overshoot
--------------------+----------------------------
 Reporter:  Gedare  |       Owner:  Joel Sherrill
     Type:  defect  |      Status:  closed
 Priority:  normal  |   Milestone:  4.11
Component:  score   |     Version:  4.10
 Severity:  normal  |  Resolution:  fixed
 Keywords:          |
--------------------+----------------------------
Changes (by Gedare):

 * version:  4.11 => 4.10


Old description:

> A user reported a possible problem with the implementation of the
> _Chain_Is_first/last functions:
> -------- Original Message --------
> Subject: [Milkymist-devel] [PATCH, tentative] RTEMS: _Chain_Is_first/last
> overshoot
> Date: Wed, 9 Nov 2011 16:53:53 -0300
> From: Werner Almesberger <werner at almesberger.net>
> Reply-To: Milkymist One, Milkymist SoC and Flickernoise developers' list
> <devel at lists.milkymist.org>
> To: Milkymist One, Milkymist SoC and Flickernoise developers' list
> <devel at lists.milkymist.org>
>
> Doubly-linked lists ("chains") in RTEMS have a "control" block that
> looks like the next/prev link pair in an element. The list elements
> link both ways to this control block.
>
> _Chain_Is_first and _Chain_Is_last only probed if the link to the
> next element - which would be the control block - is non-NULL.
> Telling by the function description and given that there are already
> functions called _Chain_Is_head and _Chain_Is_tail (which could be
> simplified), this is probably not the intended behaviour.
>
> This also affects the aliases rtems_chain_is_first and
> rtems_chain_is_last.
>
> These functions are not used a lot and I haven't seen any immediate
> effect on M1 after changing them, so I can't say whether this patch
> may unearth other problems.
>
> - Werner

New description:

 A user reported a possible problem with the implementation of the
 _Chain_Is_first/last functions:
 -------- Original Message --------
 Subject: [Milkymist-devel] [PATCH, tentative] RTEMS: _Chain_Is_first/last
 overshoot
 Date: Wed, 9 Nov 2011 16:53:53 -0300
 From: Werner Almesberger <werner at almesberger.net>
 Reply-To: Milkymist One, Milkymist SoC and Flickernoise developers' list
 <devel at lists.milkymist.org>
 To: Milkymist One, Milkymist SoC and Flickernoise developers' list
 <devel at lists.milkymist.org>

 Doubly-linked lists ("chains") in RTEMS have a "control" block that
 looks like the next/prev link pair in an element. The list elements
 link both ways to this control block.

 _Chain_Is_first and _Chain_Is_last only probed if the link to the
 next element - which would be the control block - is non-NULL.
 Telling by the function description and given that there are already
 functions called _Chain_Is_head and _Chain_Is_tail (which could be
 simplified), this is probably not the intended behaviour.

 This also affects the aliases rtems_chain_is_first and
 rtems_chain_is_last.

 These functions are not used a lot and I haven't seen any immediate
 effect on M1 after changing them, so I can't say whether this patch
 may unearth other problems.

 - Werner

--

Comment:

 I ran over this on 4.10.2 also. I will plan to fix it on the 4.10 branch
 pending 4.10.3.

--
Ticket URL: <http://devel.rtems.org/ticket/1964#comment:7>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list