Skip to content

Segmentation fault: llvm::GetElementPtrInst::getGEPReturnType #57

@xaionaro

Description

@xaionaro

Hello. I've just built fcd and a Go's hello world, and tried to decompile the hello-world with fcd. As result it's a segfault:

$ cat helloworld.go 
package main
import "fmt"
func main() {
        fmt.Println("Hello, world!")
}
$ go version
go version go1.7.4 linux/amd64
$ go build
$ ~/src/fcd/build/fcd hello
Stack dump:
0.      Optimizing LLVM IR
1.      Running pass 'Identify locals' on module 'hello'.
0  libLLVM-4.0.so.1 0x00007f35f6b7cbc5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  libLLVM-4.0.so.1 0x00007f35f6b7ad6e llvm::sys::RunSignalHandlers() + 62
2  libLLVM-4.0.so.1 0x00007f35f6b7ae92
3  libc.so.6        0x00007f35f3495060
4  libLLVM-4.0.so.1 0x00007f35f6c6edb4 llvm::PointerType::get(llvm::Type*, unsigned int) + 20
5  fcd              0x0000000000960b44 llvm::GetElementPtrInst::getGEPReturnType(llvm::Type*, llvm::Value*, llvm::ArrayRef<llvm::Value*>) + 100
6  fcd              0x0000000000a5dd3b llvm::GetElementPtrInst::GetElementPtrInst(llvm::Type*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, unsigned int, llvm::Twine const&, llvm::Instruction*) + 123
7  fcd              0x0000000000a5ce97
8  fcd              0x0000000000a4a530
9  fcd              0x0000000000a48d3b
10 fcd              0x0000000000a48933
11 libLLVM-4.0.so.1 0x00007f35f6c43007 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 759
12 fcd              0x0000000000a21acc
13 fcd              0x0000000000a1f61d main + 2957
14 libc.so.6        0x00007f35f34822e1 __libc_start_main + 241
15 fcd              0x0000000000879b7a _start + 42
Segmentation fault (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions