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

[Bug]: vast-front -cc1 crashes if not given a target dialect #663

Open
PappasBrent opened this issue Jul 10, 2024 · 0 comments
Open

[Bug]: vast-front -cc1 crashes if not given a target dialect #663

PappasBrent opened this issue Jul 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@PappasBrent
Copy link
Collaborator

VAST version

Ubuntu clang version 18.1.8 (++20240615103753+3b5b5c1ec4a3-1exp120240615223858.136) Target: x86_64-pc-linux-gnu Thread model: posix

LLVM version

18.1.8

Operating system

Ubuntu 22.04.4 LTS x86_64

Description

vast-front crashes with the following stack trace when passed the -cc1 flag without also being passed a vast-emit-mlir flag:

[VAST fatal] not implemented: frontend_action_ptr vast::cc::create_frontend_action(compiler_instance &, const vast_args &, mcontext_t &) because unsupported frontend action
PLEASE submit a bug report to https://github.com/trailofbits/vast/issues and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: ./builds/default/tools/vast-front/Debug/vast-front -cc1 test_simple.c
 #0 0x00007fd6d798d716 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-18/lib/libLLVM.so.18.1+0xd94716)
 #1 0x00007fd6d798b6d0 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-18/lib/libLLVM.so.18.1+0xd926d0)
 #2 0x00007fd6d798dddb (/usr/lib/llvm-18/lib/libLLVM.so.18.1+0xd94ddb)
 #3 0x00007fd6d667b520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x0000562c71da9a8f vast::cc::create_frontend_action(clang::CompilerInstance&, vast::cc::vast_args const&, mlir::MLIRContext&) /home/bpappas/github.com/trailofbits/vast/tools/vast-front/compiler_invocation.cpp:57:22
 #5 0x0000562c71daa163 vast::cc::execute_compiler_invocation(clang::CompilerInstance*, vast::cc::vast_args const&) /home/bpappas/github.com/trailofbits/vast/tools/vast-front/compiler_invocation.cpp:97:23
 #6 0x0000562c71dbe8b0 vast::cc::cc1(vast::cc::vast_args const&, llvm::ArrayRef<char const*>, char const*, void*) /home/bpappas/github.com/trailofbits/vast/tools/vast-front/cc1.cpp:116:23
 #7 0x0000562c71daf8e4 execute_cc1_tool(llvm::SmallVectorImpl<char const*>&) /home/bpappas/github.com/trailofbits/vast/tools/vast-front/driver.cpp:71:16
 #8 0x0000562c71daee84 main /home/bpappas/github.com/trailofbits/vast/tools/vast-front/driver.cpp:146:20
 #9 0x00007fd6d6662d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#10 0x00007fd6d6662e40 call_init ./csu/../csu/libc-start.c:128:20
#11 0x00007fd6d6662e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#12 0x0000562c71da8bb5 _start (./builds/default/tools/vast-front/Debug/vast-front+0xe49bb5)
Illegal instruction (core dumped

Steps to Reproduce

Create a file test.c with the following contents:

int main(void) { return 0; }

Run vast-front on the file like so:

vast-front -cc1 test.c
@PappasBrent PappasBrent added the bug Something isn't working label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant