[LLVMbugs] [Bug 21995] New: Infrequent deadlocks with std::future

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Dec 19 16:45:31 PST 2014


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: unassignedclangbugs at nondot.org
          Reporter: brian at fiftythree.com
                CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
    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 at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141220/0ac116d1/attachment.html>


More information about the llvm-bugs mailing list