Hi James, I've tried this with Debian stable 64-bit in a VirtualBox and haven't had any problems. Of course that's a different set-up but I would have expected to see something if there was a problem. It makes it rather difficult to track this down.
David
On 23/02/2017 20:44, James Clarke wrote:
Hi David, It seems Test166 (the new condition variable one) sometimes deadlocks. I'm able to reliably reproduce with the following:
./configure make -j2 compiler make -j2 compiler while true; do make -j2 check; done
(The -j2's are probably irrelevant, but I'm including them for completeness)
On the 40th iteration of the loop it got stuck for me:
val runTests = fn: string -> bool Test028.ML => Passed Test166.ML =>
Threads:
Thread 9 (Thread 0x7faf066fc700 (LWP 29448)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185 #1 0x000055ff143b7e30 in Processes::WaitInfinite(TaskData*, SaveVecEntry*) () #2 0x000055ff143b7f4f in PolyThreadCondVarWait () #3 0x000055ff1426496d in area1 () #4 0x00007faf0ce71c00 in ?? () #5 0x00007faf066fbe08 in ?? () #6 0x00007faf0fb79040 in ?? () from /lib64/ld-linux-x86-64.so.2 #7 0x00007faf0e6f0e48 in __GI___libc_malloc (bytes=140389730295024) at malloc.c:2925 #8 0x000055ff143c5477 in initThreadSignals(TaskData*) () #9 0x000055ff143b8990 in NewThreadFunction(void*) () #10 0x00007faf0f73f424 in start_thread (arg=0x7faf066fc700) at pthread_create.c:333 #11 0x00007faf0e75e9bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
Thread 8 (Thread 0x7faf06efd700 (LWP 29447)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185 #1 0x000055ff143b7e30 in Processes::WaitInfinite(TaskData*, SaveVecEntry*) () #2 0x000055ff143b7f4f in PolyThreadCondVarWait () #3 0x000055ff1426496d in area1 () #4 0x00007faf0ce71c00 in ?? () #5 0x00007faf06efce08 in ?? () #6 0x00007faf0fb79040 in ?? () from /lib64/ld-linux-x86-64.so.2 #7 0x00007faf0e6f0e48 in __GI___libc_malloc (bytes=140389730294192) at malloc.c:2925 #8 0x000055ff143c5477 in initThreadSignals(TaskData*) () #9 0x000055ff143b8990 in NewThreadFunction(void*) () #10 0x00007faf0f73f424 in start_thread (arg=0x7faf06efd700) at pthread_create.c:333 #11 0x00007faf0e75e9bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
Thread 7 (Thread 0x7faf076fe700 (LWP 29446)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185 #1 0x000055ff143b7e30 in Processes::WaitInfinite(TaskData*, SaveVecEntry*) () #2 0x000055ff143b7f4f in PolyThreadCondVarWait () #3 0x000055ff1426496d in area1 () #4 0x00007faf0ce71c00 in ?? () #5 0x00007faf076fde08 in ?? () #6 0x00007faf0fb79040 in ?? () from /lib64/ld-linux-x86-64.so.2 #7 0x00007faf0e6f0e48 in __GI___libc_malloc (bytes=140389730242944) at malloc.c:2925 #8 0x000055ff143c5477 in initThreadSignals(TaskData*) () #9 0x000055ff143b8990 in NewThreadFunction(void*) () #10 0x00007faf0f73f424 in start_thread (arg=0x7faf076fe700) at pthread_create.c:333 #11 0x00007faf0e75e9bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
Thread 6 (Thread 0x7faf07fff700 (LWP 29445)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185 #1 0x000055ff143b7237 in Processes::WaitForSignal(TaskData*, PLock*) () #2 0x000055ff143c4f8f in PolyWaitForSignal () #3 0x000055ff13f1b8ba in area1 () #4 0x00007faf0ce71c00 in ?? () #5 0x00007faf07ffee08 in ?? () #6 0x00007faf0fb79040 in ?? () from /lib64/ld-linux-x86-64.so.2 #7 0x00007faf0e6f0e48 in __GI___libc_malloc (bytes=140389730232720) at malloc.c:2925 #8 0x000055ff143c5477 in initThreadSignals(TaskData*) () #9 0x000055ff143b8990 in NewThreadFunction(void*) () #10 0x00007faf0f73f424 in start_thread (arg=0x7faf07fff700) at pthread_create.c:333 #11 0x00007faf0e75e9bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
Thread 5 (Thread 0x7faf0ce72700 (LWP 29444)): #0 pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185 #1 0x000055ff143b7e30 in Processes::WaitInfinite(TaskData*, SaveVecEntry*) () #2 0x000055ff143b7f4f in PolyThreadCondVarWait () #3 0x000055ff1426496d in area1 () #4 0x000055ff14b34e00 in gHeapSizeParameters () #5 0x00007faf0ce71e08 in ?? () #6 0x00007faf0fb64000 in ?? () #7 0x000055ff143a7988 in MemMgr::GrowOrShrinkStack(TaskData*, unsigned long) () #8 0x000055ff15c76870 in ?? () #9 0x000055ff15c76870 in ?? () #10 0x000055ff15c76660 in ?? () #11 0x000055ff15c76668 in ?? () #12 0x000055ff143c9681 in X86TaskData::EnterPolyCode() () #13 0x000055ff143b8990 in NewThreadFunction(void*) () #14 0x00007faf0f73f424 in start_thread (arg=0x7faf0ce72700) at pthread_create.c:333 #15 0x00007faf0e75e9bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
Thread 4 (Thread 0x7faf0d673700 (LWP 29443)): #0 0x00007faf0f747536 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x55ff14b34b40 <gTaskFarm>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205 #1 do_futex_wait (sem=sem at entry=0x55ff14b34b40 <gTaskFarm>, abstime=0x0) at sem_waitcommon.c:111 #2 0x00007faf0f7475e4 in __new_sem_wait_slow (sem=0x55ff14b34b40 <gTaskFarm>, abstime=0x0) at sem_waitcommon.c:181 #3 0x000055ff143a61a3 in PSemaphore::Wait() () #4 0x000055ff143a313d in GCTaskFarm::ThreadFunction() () #5 0x000055ff143a3229 in GCTaskFarm::WorkerThreadFunction(void*) () #6 0x00007faf0f73f424 in start_thread (arg=0x7faf0d673700) at pthread_create.c:333 #7 0x00007faf0e75e9bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
Thread 3 (Thread 0x7faf0de74700 (LWP 29442)): #0 0x00007faf0f747536 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x55ff14b34b40 <gTaskFarm>) at ../sysdeps/unix/sysv/linux/futex-internal.h:205 #1 do_futex_wait (sem=sem at entry=0x55ff14b34b40 <gTaskFarm>, abstime=0x0) at sem_waitcommon.c:111 #2 0x00007faf0f7475e4 in __new_sem_wait_slow (sem=0x55ff14b34b40 <gTaskFarm>, abstime=0x0) at sem_waitcommon.c:181 #3 0x000055ff143a61a3 in PSemaphore::Wait() () #4 0x000055ff143a313d in GCTaskFarm::ThreadFunction() () #5 0x000055ff143a3229 in GCTaskFarm::WorkerThreadFunction(void*) () #6 0x00007faf0f73f424 in start_thread (arg=0x7faf0de74700) at pthread_create.c:333 #7 0x00007faf0e75e9bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
Thread 2 (Thread 0x7faf0e675700 (LWP 29441)): #0 0x00007faf0f747536 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x55ff14b35fc0 SigHandler::Init()::waitSemaphore) at ../sysdeps/unix/sysv/linux/futex-internal.h:205 #1 do_futex_wait (sem=sem at entry=0x55ff14b35fc0 SigHandler::Init()::waitSemaphore, abstime=0x0) at sem_waitcommon.c:111 #2 0x00007faf0f7475e4 in __new_sem_wait_slow (sem=0x55ff14b35fc0 SigHandler::Init()::waitSemaphore, abstime=0x0) at sem_waitcommon.c:181 #3 0x000055ff143a61a3 in PSemaphore::Wait() () #4 0x000055ff143c4c91 in SignalDetectionThread(void*) () #5 0x00007faf0f73f424 in start_thread (arg=0x7faf0e675700) at pthread_create.c:333 #6 0x00007faf0e75e9bf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
Thread 1 (Thread 0x7faf0fb49740 (LWP 29440)): #0 pthread_cond_timedwait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225 #1 0x000055ff143a604e in PCondVar::WaitFor(PLock*, unsigned int) () #2 0x000055ff143b8c9f in Processes::BeginRootThread(PolyObject*) () #3 0x000055ff143aaf13 in polymain () #4 0x00007faf0e6962b1 in __libc_start_main (main=0x55ff13f15dc0 <main>, argc=1, argv=0x7ffe94073258, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe94073248) at ../csu/libc-start.c:291 #5 0x000055ff13f1661a in _start ()
Any ideas? This is on Debian amd64 unstable, but I've seen it on non-x86 architectures too with the latest version. Interestingly I can't seem to reproduce it on macOS.
Regards, James
On 21 Feb 2017, at 12:48, David Matthews <David.Matthews at prolingua.co.uk> wrote:
The latest version, provisionally called 5.6.1, has had very little change for several months. I'm not aware of any show-stoppers so I think it would be a good time to make a release. Because there have been some major changes I was planning to call it 5.7. This is the last chance to do any last tests before the release.
David _______________________________________________ polyml mailing list polyml at inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml