change log for rtems (2010-07-25)

rtems-vc at rtems.org rtems-vc at rtems.org
Sun Jul 25 15:10:37 UTC 2010


 *joel*:
2010-07-25	Joel Sherrill <joel.sherrill at oarcorp.com>

	* libcsupport/src/gxx_wrappers.c: Free contents of key not key itself.
	Kye pointer will never be malloc'ed.

M 1.2518  cpukit/ChangeLog
M   1.21  cpukit/libcsupport/src/gxx_wrappers.c

diff -u rtems/cpukit/ChangeLog:1.2517 rtems/cpukit/ChangeLog:1.2518
--- rtems/cpukit/ChangeLog:1.2517	Sat Jul 24 11:12:48 2010
+++ rtems/cpukit/ChangeLog	Sun Jul 25 09:52:27 2010
@@ -1,3 +1,8 @@
+2010-07-25	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* libcsupport/src/gxx_wrappers.c: Free contents of key not key itself.
+	Kye pointer will never be malloc'ed.
+
 2010-07-24	Joel Sherrill <joel.sherrill at oarcorp.com>
 
 	* libcsupport/Makefile.am, libcsupport/src/termios_baud2num.c,

diff -u rtems/cpukit/libcsupport/src/gxx_wrappers.c:1.20 rtems/cpukit/libcsupport/src/gxx_wrappers.c:1.21
--- rtems/cpukit/libcsupport/src/gxx_wrappers.c:1.20	Thu Jul  1 10:37:48 2010
+++ rtems/cpukit/libcsupport/src/gxx_wrappers.c	Sun Jul 25 09:52:27 2010
@@ -122,9 +122,10 @@
   status = rtems_task_variable_delete( RTEMS_SELF, (void **)key );
   if ( status == RTEMS_SUCCESSFUL ) {
     /* Hmm - hopefully all tasks using this key have gone away... */
-    if ( key ) free( (void *)key );
+    if ( key ) free( *(void **)key );
     return 0;
   }
+  key = NULL;
   return 0;
 }
 


 *joel*:
2010-07-25	Joel Sherrill <joel.sherrill at oarcorp.com>

	* gxx01/gxx01.scn, gxx01/init.c: Add more testcases.

M  1.212  testsuites/libtests/ChangeLog
M    1.2  testsuites/libtests/gxx01/gxx01.scn
M    1.2  testsuites/libtests/gxx01/init.c

diff -u rtems/testsuites/libtests/ChangeLog:1.211 rtems/testsuites/libtests/ChangeLog:1.212
--- rtems/testsuites/libtests/ChangeLog:1.211	Thu Jul 22 06:54:10 2010
+++ rtems/testsuites/libtests/ChangeLog	Sun Jul 25 09:53:37 2010
@@ -1,3 +1,7 @@
+2010-07-25	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* gxx01/gxx01.scn, gxx01/init.c: Add more testcases.
+
 2010-07-22	Bharath Suri <bharath.s.jois at gmail.com>
 
 	* devfs02/init.c, devfs02/devfs02.doc, devfs02/devfs02.scn,

diff -u rtems/testsuites/libtests/gxx01/gxx01.scn:1.1 rtems/testsuites/libtests/gxx01/gxx01.scn:1.2
--- rtems/testsuites/libtests/gxx01/gxx01.scn:1.1	Thu Jul  1 09:37:43 2010
+++ rtems/testsuites/libtests/gxx01/gxx01.scn	Sun Jul 25 09:53:37 2010
@@ -12,6 +12,8 @@
 rtems_gxx_recursive_mutex_unlock() - OK
 rtems_gxx_recursive_mutex_lock() - OK
 rtems_gxx_recursive_mutex_unlock() - OK
+rtems_gxx_mutex_destroy(mutex) - OK
+rtems_gxx_mutex_destroy(mutex) - NOT OK
 
 Call once method the first time
 Running once method
@@ -21,6 +23,12 @@
 rtems_gxx_key_delete(key) - OK
 rtems_gxx_key_create(&key, key_dtor) - OK
 rtems_gxx_setspecific() - OK
-rtems_gxx_petspecific() - OK
+rtems_gxx_getspecific(key) already existing - OK
 rtems_gxx_key_delete(key) - OK
+rtems_gxx_getspecific(key_for_testing) non-existent - OK
+rtems_gxx_key_delete(key_for_testing) - OK
+
+rtems_gxx_mutex_init() until exhausted and panic
+rtems_gxx_mutex_init
+fatal error, exiting
 *** END OF TEST GXX 01 ***

diff -u rtems/testsuites/libtests/gxx01/init.c:1.1 rtems/testsuites/libtests/gxx01/init.c:1.2
--- rtems/testsuites/libtests/gxx01/init.c:1.1	Thu Jul  1 09:37:46 2010
+++ rtems/testsuites/libtests/gxx01/init.c	Sun Jul 25 09:53:37 2010
@@ -46,6 +46,14 @@
   puts( "rtems_gxx_recursive_mutex_unlock() - OK" );
   sc = rtems_gxx_recursive_mutex_unlock(&mutex);
   rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_mutex_destroy(mutex) - OK" );
+  sc = rtems_gxx_mutex_destroy(&mutex);
+  rtems_test_assert( sc == 0 );
+
+  puts( "rtems_gxx_mutex_destroy(mutex) - NOT OK" );
+  sc = rtems_gxx_mutex_destroy(&mutex);
+  rtems_test_assert( sc == -1 );
 }
 
 void test_mutex(void)
@@ -97,6 +105,7 @@
 }
 
 volatile bool key_dtor_ran;
+void *key_for_testing;
 
 void key_dtor(void *ptr)
 {
@@ -125,7 +134,7 @@
   sc = rtems_gxx_setspecific(key, (void *)0x1234);
   rtems_test_assert( sc == 0 );
 
-  puts( "rtems_gxx_petspecific() - OK" );
+  puts( "rtems_gxx_getspecific(key) already existing - OK" );
   p = rtems_gxx_getspecific(key);
   rtems_test_assert( p == (void *)0x1234 );
 
@@ -134,12 +143,38 @@
   rtems_test_assert( sc == 0 );
   rtems_test_assert( key_dtor_ran == true );
 
-#if 0
+  puts( "rtems_gxx_getspecific(key_for_testing) non-existent - OK" );
+  p = rtems_gxx_getspecific((__gthread_key_t) &key_for_testing);
+  rtems_test_assert( p == NULL );
+  rtems_test_assert( key_for_testing == NULL );
+
+  key_for_testing = malloc(4);
+  rtems_test_assert( key_for_testing != NULL );
+  
+  puts( "rtems_gxx_key_delete(key_for_testing) - OK" );
+  sc = rtems_gxx_key_delete((__gthread_key_t) &key_for_testing);
+  rtems_test_assert( sc == 0 );
+  rtems_test_assert( key_for_testing == NULL );
+}
+
+void _exit(int status) RTEMS_COMPILER_NO_RETURN_ATTRIBUTE;
+
+void _exit(int status)
+{
+  puts( "*** END OF TEST GXX 01 ***" );
+
+  rtems_shutdown_executive(0);
+}
 
-void *rtems_gxx_getspecific(__gthread_key_t key);
+void test_out_of_mutexes(void)
+{
+   __gthread_mutex_t mutex;
 
-int rtems_gxx_setspecific(__gthread_key_t key, const void *ptr);
-#endif
+  puts( "rtems_gxx_mutex_init() until exhausted and panic" );
+  while (1) {
+    rtems_gxx_mutex_init(&mutex);
+    rtems_test_assert( mutex != 0 );
+  }
 }
 
 rtems_task Init(
@@ -158,10 +193,11 @@
   puts( "" );
 
   test_key();
+  puts( "" );
 
-  puts( "*** END OF TEST GXX 01 ***" );
+  test_out_of_mutexes();
 
-  rtems_test_exit(0);
+  /* does not return */
 }
 
 /* configuration information */



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100725/56908373/attachment.html>


More information about the vc mailing list