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

            Bug ID: 18282
           Summary: When converting std::bind to a std::function, we enter
                    an infinite loop causing a segmentation fault.
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

The following code was posted to stackoverflow giving a segmentation fault with
libc++.


    #include <functional>

    int main() {
        std::function<void(int)> function = [](int) {};
        auto binding = std::bind(function, 10);
        std::function<void()> jobFunctor = binding; // crashes here with
EXC_BAD_ACCESS
    }

>From looking at gdb, it appears that the last line causes an infinite loop of
calls within std::bind until we run out of room on the stack, causing the
crash.

-- 
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