http://llvm.org/bugs/show_bug.cgi?id=21995

            Bug ID: 21995
           Summary: Infrequent deadlocks with std::future
           Product: libc++
           Version: 3.4
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Created attachment 13582
  --> http://llvm.org/bugs/attachment.cgi?id=13582&action=edit
Simple app to stress-test std::future

We see occasional deadlocks with std::future, first observed on iOS. We then
wrote a test program (attached) to try and isolate the problem. The test
program simulates a work queue and repeatedly creates stack-allocated futures
to track background "tasks".

The program deadlocks when built for OS X in both Xcode 5.1 & 6.1.1. 

It also fails when compiled on Ubuntu Trusty with clang 3.4 and clang 3.6, but
segfaults rather than deadlocking. 

Test program compiled as:

clang++-3.6 -o future-shock -std=c++11 -pthread -g future_shock.cpp

vagrant@vagrant-ubuntu-trusty-64:~$ clang++-3.6 -v
Ubuntu clang version 3.6.0-svn224581-1~exp1 (trunk) (based on LLVM 3.6.0)
Target: x86_64-pc-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.1
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Selected multilib: .;@m64

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to