Bug with pthreads

Peter Pointner pr at schenk.isar.de
Tue Feb 22 17:43:08 UTC 2000


Hello,

I think there is a bug somewhere in the posix api:

a) exec/posix/src/pthread.c, _POSIX_Threads_Manager_initialization() calls
   _Objects_Initialize_information with parameter 'is_string' set to TRUE.

b) exec/posix/src/pthreadcreate.c, pthread_create() defines
      char * default_name = "psx";
   on the stack, then calls
      _Thread_Initialize( ..., &default_name);

c) exec/score/src/threadinitialize.c, _Thread_Initialize() gives this
   parameter to the macro _Objects_Open

d) exec/score/macros/rtems/score/object.inl, _Objects_Open() decides
   (based on the information from a) ), to pass this parameter to 
   _Objects_Copy_name_string

e) exec/score/src/objectcopynamestring.c, _Objects_Copy_name_string treats
   the value as pointer to a null terminated string and copies it.

If I didn't get something wrong, this might lead to unpredictable results,
if this '&default_name' doesn't contain a null byte.

I'm a bit too confused now to fix that. Any takers?

Peter





More information about the users mailing list