Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program with a function declaration but no calls segfaults #4

Open
fnune opened this issue Feb 6, 2023 · 0 comments
Open

Program with a function declaration but no calls segfaults #4

fnune opened this issue Feb 6, 2023 · 0 comments

Comments

@fnune
Copy link
Owner

fnune commented Feb 6, 2023

LLVM 10.0.1

test.vam:

fun returns_three returning i32 = 3;
 ~/Development/vampa [3] => cargo run --bin vamc ./test.vam && lli ./test.o                     23:02:47
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/vamc ./test.vam`
Stack dump:
0.      Program arguments: lli ./test.o
1.      Running pass 'Function Pass Manager' on module './test.o'.
2.      Running pass 'Branch Probability Analysis' on function '@main'
 #0 0x0000557686f9f23a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0xd0423a)
 #1 0x0000557686f9cf34 llvm::sys::RunSignalHandlers() (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0xd01f34)
 #2 0x0000557686f9d068 SignalHandler(int) (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0xd02068)
 #3 0x00007f0bc35f8140 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x13140)
 #4 0x0000557686a409e0 llvm::Instruction::getNumSuccessors() const (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x7a59e0)
 #5 0x00005576875d7991 llvm::BranchProbabilityInfo::computePostDominatedByUnreachable(llvm::Function const&, llvm::PostDominatorTree*) (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x133c991)
 #6 0x00005576875def6d llvm::BranchProbabilityInfo::calculate(llvm::Function const&, llvm::LoopInfo const&, llvm::TargetLibraryInfo const*) (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x1343f6d)
 #7 0x00005576875e02a2 llvm::BranchProbabilityInfoWrapperPass::runOnFunction(llvm::Function&) (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x13452a2)
 #8 0x0000557686a69c88 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x7cec88)
 #9 0x0000557686a6b1cc llvm::FPPassManager::runOnModule(llvm::Module&) (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x7d01cc)
#10 0x0000557686a6b52a llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x7d052a)
#11 0x0000557686b5728e llvm::MCJIT::emitObject(llvm::Module*) (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x8bc28e)
#12 0x0000557686b5794e llvm::MCJIT::generateCodeForModule(llvm::Module*) (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x8bc94e)
#13 0x0000557686b53728 llvm::MCJIT::finalizeObject() (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x8b8728)
#14 0x00005576865a5bba main (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x30abba)
#15 0x00007f0bc30e3d0a __libc_start_main ./csu/../csu/libc-start.c:308:16
#16 0x00005576865e187a _start (/home/fausto/.local/share/llvmenv/10.0.1/bin/lli+0x34687a)
[1]    515605 segmentation fault  lli ./test.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant