#36 closed defect (fixed)

report of MP bug in objectget.c

Reported by: Joel Sherrill Owned by: Joel Sherrill
Priority: low Milestone: 2
Component: score Version: 4.5
Severity: major Keywords:
Cc: bugs@… Blocked By:
Blocking:

Description

Reported via direct email. I am reporting this so it will
not be only in my inbox. First email included a file with
mods but not much description. The second had this description.

========================================================
First, the comparison "if (information->maximum >= index)" sometimes (or
always?) succeeds for remote objects. And, in the original program, if that
comparison succeeds, you only check for local objects. So remote objects are
never found and an error is always returned. I fixed that by moving the
remote object check before this comparison. If a remote object is not found
(_Objects_MP_Is_remote() returned an error) only then I check for a local
object, by calling _Objects_Get_local_object(). Actually I think this
comparison is altogether unnecessary, because Objects_Get_local_object()
performs the same comparison internally, but I left it as is.

Second, the check for remote objects was incorrect. The original check
looked like that:

_Objects_MP_Is_remote(information,

_Objects_Build_id( information->the_class, Objects_Local_node, index), ...

So, you build a local id (by using Objects_Local_node) and then call
_Objects_MP_Is_remote() to check if that id is remote. This, obviously,
always returns an error. I replaced the entire _Objects_Build_id() call with
the original object id, which was passed as an argument to the
_Objects_Get() function. That seemed to work.

So, I think a fix is needed because this whole function didn't actually work
for remote objects. I haven't done much testing and I'm not very familiar
with RTEMS internals either, so it's possible that this is not a correct
fix. If you find anything that's wrong with it, please let me know.

========================================================

Release:
snapshots and probably RTEMS-4.5

Environment:
host and target NA

How-To-Repeat:
Read description.

Attachments (2)

objectget.c (1.9 KB) - added by Joel Sherrill on Dec 3, 2006 at 1:31:13 PM.
objectget.c
pr36_patches.tgz (1.0 KB) - added by Joel Sherrill on Dec 3, 2006 at 1:31:13 PM.
pr36_patches.tgz

Download all attachments as: .zip

Change History (2)

comment:1 Changed on Nov 7, 2001 at 9:59:58 PM by Joel Sherrill

Status: assignedclosed

State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed and tested on both CVS trunk and 4.5 branch. Patches

attached. I tripped a minor bug in the ITRON code fixing this
and include a fix for that as well. This was related to PR72
where some mptests were failing. The id translation did not
always work and the tests had their own problems.

Changed on Dec 3, 2006 at 1:31:13 PM by Joel Sherrill

Attachment: pr36_patches.tgz added

pr36_patches.tgz

Note: See TracTickets for help on using tickets.