failure of psxsem01 and possible bug...

Joel Sherrill joel.sherrill at OARcorp.com
Fri May 26 11:19:15 UTC 2000



"John S. Gwynne" wrote:
> 
> 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".

Believe it or not... you can legimately create an unnamed POSIX 
semaphore.  Classic API names are unsigned32's, POSIX names
where they exist are strings.  

FYI a couple of the filesystem tests fail as well due to
the unmount handler being called twice.  

And cpuuse is incorrectly printing from a task switch extension.

All fixed.

> 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....

Your fix looks remarkably like the one I checked in. ;)

Index: objectcopynamestring.c
===================================================================
RCS file: /usr1/CVS/rtems/c/src/exec/score/src/objectcopynamestring.c,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- objectcopynamestring.c      1999/11/17 17:50:39     1.2
+++ objectcopynamestring.c      2000/05/16 18:58:18     1.2.2.1
@@ -39,7 +39,10 @@
   unsigned8 *source_p = (unsigned8 *) source;
   unsigned8 *destination_p = (unsigned8 *) destination;

-  do {
-    *destination_p++ = *source_p;
-  } while ( *source_p++ );
+  *destination_p = '\0';
+  if ( source_p ) {
+    do {
+      *destination_p++ = *source_p;
+    } while ( *source_p++ );
+  }
 }                                    

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



More information about the users mailing list