Chen Guo wrote: > Hi Professor Eggert, > On Sun, Dec 5, 2010 at 11:01 PM, Paul Eggert <egg...@cs.ucla.edu> wrote: >> On 12/05/2010 09:16 PM, Chen Guo wrote: >>> Before saying anything else, I should note that for mutexes, on 4 >>> threads 20% of the time there's a segfault on a seemingly innocuous >>> line in queue_insert (): >>> node->queued = true >> >> It does sound like mutexes are the way to go, and that this bug >> needs to be fixed. I assume that this is the call to queue_insert >> from queue_check_insert_parent? What's the backtrace? (And >> what patch are you using, to get mutexes?) >> > > I've attached the patch (inlined at the bottom). Here's the GDB > crash, with backtrace. I also printed node->queued in GDB, so it's > evident that its accessible. > > (gdb) run --parallel 2 rec_1M > /dev/null > Starting program: /data/chen/Coding/Coreutils/test/sort-mutex > --parallel 2 rec_1M > /dev/null
Hi Chen, Thanks. What does your input file look like? I've been unable to reproduce the failure using the output of seq 1000000. I've tried a few different -S ... options, in case the amount of available memory is a factor: seq 1000000 > in-1M for i in $(seq 1000); do \ printf '%03d\r' $i; src/sort --parallel=2 -S 1M in-1M > /dev/null; done