failure of psxsem01 and possible bug...

John S. Gwynne jsg at jsgpc.mrcday.com
Fri May 26 05:38:49 UTC 2000


The following appears as a bug to me that results in a bus error on 
the efi332 target for the test program psxsem01....

in seminit.c:36, _POSIX_Semaphore_Create_support() is called with an explict
NULL value for "name".

in semaphorecreatesupp.c:110 _Objects_Open of
_POSIX_Semaphore_Create_support() is called with the NULL valued
"name" for arg 3.

This in turn calls _Objects_Copy_name_string() in
objectcopynamestring.c through the inline function _Object_Open. This
tries to copy a null terminated string from source (a NULL pointer in
this case) to destination..... SEGV (no RAM/ROM at 0x0000 in the test
configuration I'm using)...

psxsem01 runs fine for me if I replace _Objects_Copy_name_string()
with the following code to trap the NULL source pointer (just an
example and quick fix... maybe not the best place to trap 
the NULL).... Something's not right here....


void _Objects_Copy_name_string(
  void       *source,
  void       *destination
)
{
  if (source)
    do {
      *(char *)destination++ = *(char *)source;
    } while ( *(char *)source++ );
}


john gwynne
jsg at donet.com



More information about the users mailing list