Notice: We have migrated to GitLab launching 2024-05-01 see here:

#4738 closed defect (fixed)

psxrwlock01 uses uninitialized lock that may or may not autoinitialize

Reported by: Lucian-Raul Silistru Owned by: joel@…
Priority: normal Milestone:
Component: test Version:
Severity: normal Keywords:
Cc: Blocked By:


When running psxrwlock01, the NULL argument check from testsuites/psxtests/psxrwlock01/test.c:458 uses the uninitialized rwlock.
Depending on memory content this lock may or may not be auto-initialized. The cases I can see are:

  1. if memory is zeroed, it will auto a new lock and acquire without checking abstime value. Will return SUCCESS and test will fail.
  2. if memory is random it will instantly return EINVAL from autoinitialization, again not checking abstime. Test will pass.
  3. if memory somehow ends up over another older lock structure, it will try to take over that lock - not encountered this specific behaviour.

Change History (2)

comment:1 Changed on 10/06/22 at 16:15:15 by Joel Sherrill

The odds are that on the BSPs which get the most testing, the memory is zeroed. Can you see if initializing the id variable in question to 0 resolves the issue and the test still works?

Patch appreciated if so.

comment:2 Changed on 10/07/22 at 05:04:22 by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: newclosed

In [changeset:"46f08961a22ff7ffc6196971c0ff04006689ded1/rtems" 46f08961/rtems]:

psxrwlock01: Use an initilized lock for tests

Close #4738.

Note: See TracTickets for help on using tickets.