Skip to contentSkip to conversation

xfstests: aio-stress is calling pthread_join incorrectly

PATCH Applied Dave Kleikamp 3 participants 3 messages Jun 18, 2013 – Jun 26, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: aio-stress is calling pthread_join incorrectly

The retval parameter to pthread_join() is a pointer to a pointer. aio-stress is passing in a pointer to an int. This can result in a bus error on sparc64 when the pointer is not aligned on a 64-bit boundary. Since the return value is not used, it is simplest to pass a NULL pointer instead.

This has been fixed in the LTP source:
https://github.com/linux-test-project/ltp/commit/981d33aad3b33c4625b88990fbf2fad5470d47e0

---

ltp/aio-stress.c renamed from ltp/aio-stress.c.orig +1 -2
diff -up xfstests/ltp/aio-stress.c.orig xfstests/ltp/aio-stress.c
@@ -1210,7 +1210,6 @@ typedef void * (*start_routine)(void *);
 int run_workers(struct thread_info *t, int num_threads)
 {
     int ret;
-    int thread_ret;
     int i;
 
     for(i = 0 ; i < num_threads ; i++) {
@@ -1221,7 +1220,7 @@ int run_workers(struct thread_info *t, i
 	}
     }
     for(i = 0 ; i < num_threads ; i++) {
-        ret = pthread_join(t[i].tid, (void *)&thread_ret);
+        ret = pthread_join(t[i].tid, NULL);
         if (ret) {
 	    perror("pthread_join");
 	    exit(1);

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Dave Kleikamp

The retval parameter to pthread_join() is a pointer to a pointer. aio-stress is passing in a pointer to an int. This can result in a bus error on sparc64 when the pointer is not aligned on a 64-bit boundary. Since the return value is not used, it is simplest to pass a NULL pointer instead.

This has been fixed in the LTP source:
https://github.com/linux-test-project/ltp/commit/981d33aad3b33c4625b88990fbf2fad5470d47e0

Looks good. Thanks, Shaggy.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Applied
#2 lore raw
Quoted 7 lines · Dave Chinner
Quoted 6 lines · Dave Kleikamp

The retval parameter to pthread_join() is a pointer to a pointer. aio-stress is passing in a pointer to an int. This can result in a bus error on sparc64 when the pointer is not aligned on a 64-bit boundary. Since the return value is not used, it is simplest to pass a NULL pointer instead.

Quoted 8 lines
Quoted 4 lines

This has been fixed in the LTP source:
https://github.com/linux-test-project/ltp/commit/981d33aad3b33c4625b88990fbf2fad5470d47e0

Looks good. Thanks, Shaggy.

Applied.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs