[llvm-bugs] [Bug 33309] New: Fibonacci example segfault

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 5 00:53:52 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33309

            Bug ID: 33309
           Summary: Fibonacci example segfault
           Product: libraries
           Version: 4.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
          Assignee: unassignedbugs at nondot.org
          Reporter: lodovico at giaretart.net
                CC: llvm-bugs at lists.llvm.org

I'm on ArchLinux x86_64

  > uname -a
  Linux <username> 4.11.3-1-ARCH #1 SMP PREEMPT Sun May 28 10:40:17 CEST 2017
x86_64 GNU/Linux

  > llvm-config --version
  4.4.0

I'm compiling the Fibonacci example downloaded from the GitHub mirror at [1]
this way (I'm using the fish shell):

  > eval g++ -g3 (llvm-config --cxxflags --ldflags --libs) fib.cpp

It compiles fine (just one warning about a missing sentinel, which is actually
present), but it segfaults. This is the stack trace reported by gdb:

  #0 llvm::Value::getContext() const () from /usr/lib/LLVM-4.0.so
  #1 llvm::Value::setNameImpl(llvm::Twine const&) () from /usr/lib/LLVM-4.0.so
  #2 llvm::Value::setName(llvm::Twine const&) () from /usr/lib/LLVM-4.0.so
  #3 llvm::Function::BuildLazyArguments() const () from /usr/lib/LLVM-4.0.so
  #4 llvm::Function::CheckLazyArguments (this=<optimized out>) at
/usr/include/llvm/IR/Function.h:100
  #5 llvm::Function:arg_begin (this=<optimized out>) at
/usr/include/llvm/IR/Function:551
  #6 CreateFibFunction (Context=..., M=0x632370) at fib.cpp:67
  #7 main (argc=<optimized out>, argv=0x7fffffffe608) at fib.cpp:114


[1]
https://raw.githubusercontent.com/llvm-mirror/llvm/release_40/examples/Fibonacci/fibonacci.cpp

-- 
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/20170605/2519bfbb/attachment.html>


More information about the llvm-bugs mailing list