Subject: bug#6281: Fwd: Possible bug in coreutils-8.5 or associated gnulib version

From: Chris Clayton <[email-masked]>
Date: Thu, 27 May 2010 15:40:09 +0100

Resend because the first try somehow ended up at the Debbugs-submit
mailing list!

Fingers crossed.

---------- Forwarded message ----------
From: Chris Clayton <[email-masked]>
Date: 27 May 2010 09:19
Subject: Possible bug in coreutils-8.5 or associated gnulib version
To: [email-masked]

Hi,

I've just tried to build coreutils-8.5. The compilation finished OK,
but make check hangs when
gnulib-tests/test-lock is run. The log showed that the hang occurred
somewhere after the
message "Starting test_rwlock" was output, so I've added some
additional debugging output to the
test_rwlock function so that it now looks like:

static void
test_rwlock (void)
{
 int i;
 gl_thread_t checkerthreads[THREAD_COUNT];
 gl_thread_t threads[THREAD_COUNT];

 /* Initialization.  */
 for (i = 0; i < ACCOUNT_COUNT; i++)
   account[i] = 1000;
 rwlock_checker_done = 0;

 /* Spawn the threads.  */
 printf ("\nCreating %d rwlock_checker_threads:", THREAD_COUNT);
 for (i = 0; i < THREAD_COUNT; i++)
   checkerthreads[i] = gl_thread_create (rwlock_checker_thread, NULL);
 printf ("OK\n");
 printf ("Creating %d rwlock_mutator_threads:", THREAD_COUNT);
 for (i = 0; i < THREAD_COUNT; i++)
   threads[i] = gl_thread_create (rwlock_mutator_thread, NULL);
 printf ("OK\n");

 /* Wait for the threads to terminate.  */
 printf ("Waiting for rwlock_mutator_threads to terminate:\n");
 for (i = 0; i < THREAD_COUNT; i++) {
   printf ("\t%d\n", i);
   gl_thread_join (threads[i], NULL);
 }
 rwlock_checker_done = 1;
 printf ("Waiting for rwlock_checker_threads to terminate:\n");
 for (i = 0; i < THREAD_COUNT; i++) {
   printf ("\t%d\n", i);
   gl_thread_join (checkerthreads[i], NULL);
 }
 check_accounts ();
}

I compiled the amended test app and ran it a few times. The output I
got is as follows:

[root:/home/chris/rpm/build/coreutils-8.5/gnulib-tests]$ ./test-lock
Starting test_lock ... OK
Starting test_rwlock ...
Creating 10 rwlock_checker_threads:OK
Creating 10 rwlock_mutator_threads:OK
Waiting for rwlock_mutator_threads to terminate:
       0
       1
^C
[root:/home/chris/rpm/build/coreutils-8.5/gnulib-tests]$ ./test-lock
Starting test_lock ... OK
Starting test_rwlock ...
Creating 10 rwlock_checker_threads:OK
Creating 10 rwlock_mutator_threads:OK
Waiting for rwlock_mutator_threads to terminate:
       0
       1
^C
[root:/home/chris/rpm/build/coreutils-8.5/gnulib-tests]$ time ./test-lock
Starting test_lock ... OK
Starting test_rwlock ...
Creating 10 rwlock_checker_threads:OK
Creating 10 rwlock_mutator_threads:OK
Waiting for rwlock_mutator_threads to terminate:
       0
       1
^C

real    23m14.207s
user    0m3.039s
sys     0m4.329s

The final run shows that even if I leave the app to run for several
minutes, it still fails to
complete.

I am running kernel 2.6.34 and my gcc is gcc (GCC) 4.4.5 20100525
(prerelease) (this week's 4.4
snapshot), although I get the same hang if I build and test with gcc-3.4.6.

I'm not subscribed, so please cc me into any reply  More than happy to
provide any other information
you need to solve this.

Thanks,

Chris Clayton

--
The more I see, the more I know. The more I know, the less I
understand. Changing Man - Paul Weller

-- 
The more I see, the more I know. The more I know, the less I
understand. Changing Man - Paul Weller