Subject: I am getting random hangs executing coreutils 8.21 sort.

From: Kevin Wills <[email-masked]>
Date: Wed, 1 May 2013 09:02:50 -0500

I am getting random hangs executing coreutils 8.21 sort.
It occurs every so often but I can't reproduce on demand.
 
OS: RHEL 5.8 Linux 2.6.18-308.4.1.el5 #1 SMP Wed Mar 28 01:54:56 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
 
CMDLINE: INSTALL/coreutils-8.21/bin/sort --parallel=4 -k3,3 -k4,4n -t , -S 768M -T /tmp
 
-rw------- 1 x x 410M Apr 30 17:31 /tmp/TEST.20100129.1367347586.5d6b2b011bb90cc1/sortrg8yHh
INFO THREADS

 2 Thread 0x43386940 (LWP 28946) 0x0000003675c0d594 in __lll_lock_wait () from /lib64/libpthread.so.0
* 1 Thread 0x2af45f251e20 (LWP 28724) 0x0000003675c07ba5 in pthread_join () from /lib64/libpthread.so.0
 
Each of the hangs is at this same place.
 
(gdb) info threads

  2 Thread 0x43386940 (LWP 28946)  0x0000003675c0d594 in __lll_lock_wait () from /lib64/libpthread.so.0
* 1 Thread 0x2af45f251e20 (LWP 28724)  0x0000003675c07ba5 in pthread_join () from /lib64/libpthread.so.0

THREAD #1

(gdb) bt 20
#0  0x0000003675c07ba5 in pthread_join () from /lib64/libpthread.so.0
#1  0x0000000000406d92 in sortlines (lines=0x2af4898c1b50, nthreads=1, total_lines=3913269, node=0x1dbf37b0, queue=0x7fffb16a4b80, tfp=0x1dbf32a0,
    temp_output=0x1dbf323d "/tmp/TEST.20100129.1367347586.5d6b2b011bb90cc1/sortrg8yHh") at src/sort.c:3587
#2  0x0000000000406d83 in sortlines (lines=0x2af48b69ccf0, nthreads=2, total_lines=3913269, node=0x1dbf35b0, queue=0x7fffb16a4b80, tfp=0x1dbf32a0,
    temp_output=0x1dbf323d "/tmp/TEST.20100129.1367347586.5d6b2b011bb90cc1/sortrg8yHh") at src/sort.c:3585
#3  0x0000000000407191 in sort (files=0x6185b8, nfiles=0, output_file=0x0, nthreads=4) at src/sort.c:3917
#4  0x00000000004093a6 in main (argc=10, argv=0x7fffb16a5238) at src/sort.c:4702

THREAD #2

(gdb) thread 2
[Switching to thread 2 (Thread 0x43386940 (LWP 28946))]#0  0x0000003675c0d594 in __lll_lock_wait () from /lib64/libpthread.so.0
(gdb) bt 20
#0  0x0000003675c0d594 in __lll_lock_wait () from /lib64/libpthread.so.0
#1  0x0000003675c08e8a in _L_lock_1034 () from /lib64/libpthread.so.0
#2  0x0000003675c08d4c in pthread_mutex_lock () from /lib64/libpthread.so.0
#3  0x0000000000406a39 in lock_node (lines=<value optimized out>, nthreads=<value optimized out>, total_lines=3913269, node=0x1dbf3830, queue=0x7fffb16a4b80,
    tfp=0x1dbf32a0, temp_output=0x1dbf323d "/tmp/TEST.20100129.1367347586.5d6b2b011bb90cc1/sortrg8yHh") at src/sort.c:3280
#4  queue_check_insert_parent (lines=<value optimized out>, nthreads=<value optimized out>, total_lines=3913269, node=0x1dbf3830, queue=0x7fffb16a4b80, tfp=0x1dbf32a0,
    temp_output=0x1dbf323d "/tmp/TEST.20100129.1367347586.5d6b2b011bb90cc1/sortrg8yHh") at src/sort.c:3458
#5  merge_loop (lines=<value optimized out>, nthreads=<value optimized out>, total_lines=3913269, node=0x1dbf3830, queue=0x7fffb16a4b80, tfp=0x1dbf32a0,
    temp_output=0x1dbf323d "/tmp/TEST.20100129.1367347586.5d6b2b011bb90cc1/sortrg8yHh") at src/sort.c:3493
#6  sortlines (lines=<value optimized out>, nthreads=<value optimized out>, total_lines=3913269, node=0x1dbf3830, queue=0x7fffb16a4b80, tfp=0x1dbf32a0,
    temp_output=0x1dbf323d "/tmp/TEST.20100129.1367347586.5d6b2b011bb90cc1/sortrg8yHh") at src/sort.c:3608
#7  0x0000000000406dc8 in sortlines_thread (data=<value optimized out>) at src/sort.c:3538
#8  0x0000003675c0677d in start_thread () from /lib64/libpthread.so.0
#9  0x0000003674cd325d in clone () from /lib64/libc.so.6