Patch from Chris Johns <ccj@…>:
joel@… wrote:
Chris,
sp09 fails on the rtems_port_delete(0) call. This is supposed to give an
invalid id error. I can't find any changes other than the unlimited
objects patch which would have tripped this so would appreciate it if you
could look into it. I suspect that this is a side-effect of the unlimited
objects patch.
It is me.
Basically, there are 0 ports configured in sp09. The test ends up
dereferecing NULL in local_table[0] and comes up with a non-NULL invalid
pointer.
The issue is not actually allocating a local_table for an object type
which has a maximum value of 0. I cannot remember the exact workings of
the id values and the local_table. I might have changed the nature from
the pre-unlimited change. As you know the id's are an interesting game
where performance is most important.
I know the problem could be solved by adding a check for index == 0. But
I hate to slow this path down. I think you may have changed the way the
object information structure gets initialized.
This change lets the unlimited and sp09 tests run on the posix Linux
BSP. A static local variable `null_local_table' has been added. This
variable is always set to NULL. The `local_table' element of the
information structure is set to point to this variable earily in the
initialisation. If the object type has more than 0 elements the
`local_table' element is updated. All object types which have 0 elements
reference `null_local_table'. This change fixes the problem sp09 found
yet does not add any extra processing to the critical
`_Objects_Get_local_object' function.