[LLVMbugs] [Bug 17375] New: function declared as returning value but not returning a value results in SIGILL when executed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Sep 25 21:10:00 PDT 2013


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

            Bug ID: 17375
           Summary: function declared as returning value but not returning
                    a value results in SIGILL when executed
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jorgensen at lowtechsolutions.net
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11282
  --> http://llvm.org/bugs/attachment.cgi?id=11282&action=edit
c++ source demonstrating the problem, preprocessed

The following code, built against libstdc++ 4.7.3 results in SIGILL:

#include <future>

int main()
{
        std::promise<int> promise;
        (void) promise.get_future();
}

It turns out there's a bug in libstdc++ (include/future):

      template<typename _Tp>
        static bool
        _S_check(const shared_ptr<_Tp>& __p)
        {
          if (!static_cast<bool>(__p))
            __throw_future_error((int)future_errc::no_state);
        }

the function doesn't return a value, but resulting in a SIGILL at runtime
doesn't seem like the best outcome. This bug may be the same as 16071 however
the comments there say that this problem is noted at compile-time by a warning
that is enabled by default. However I compiled with clang++ out of svn right
now and I got no such warning, no warnings at all in fact. Try it yourself:

clang++ -std=c++11 -g -o tester preprocessed.cpp

I've attached the (lzma-compressed) preprocessed source from above just to make
it easy.

-- 
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/20130926/67da15b7/attachment.html>


More information about the llvm-bugs mailing list