-
Notifications
You must be signed in to change notification settings - Fork 31
SIGSEGV in llvm::SectionMemoryManager #153
Comments
Hey, thanks for reporting the issue! The error looks like something’s up deep inside LLVM. Are you able to get a stacktrace for where the segfault is happening? That should help determine if Axiom isn’t playing nicely with LLVM somehow. |
Sorry for the slow response, here's the backtrace.
|
Hey, thanks for the stack trace. That certainly helps to narrow it down, I'm guessing the IR the compiler is providing to LLVM's JIT is invalid somehow in a subtle way, which I have seen cause this kind of problem before. Very possibly something target-specific, since I've never seen this specific issue occur on Windows or Mac. Are you building it as 32-bit or 64-bit? I'll try to replicate it locally when I get the chance. |
Building on a 64-bit Intel machine for the same target. I've had to make just one minor change to get it to build (maybe the issue is with that).
Otherwise, I'm happy to open PRs for Linux if/when this is all working. |
I've pushed a commit to fix those casts, however I haven't had any luck replicating the segfault on Linux (admittedly with WSL, but I don't think that should make a difference?), which is going to make this hard to resolve. Are you able to make this change, and then provide the contents of the diff --git a/compiler/src/frontend/runtime.rs b/compiler/src/frontend/runtime.rs
index 4fdce87..3e2698f 100644
--- a/compiler/src/frontend/runtime.rs
+++ b/compiler/src/frontend/runtime.rs
@@ -146,6 +146,8 @@ impl Runtime {
// deploy the library to the JIT
let library_module = Runtime::codegen_lib(&context, &target);
optimizer.optimize_module(&library_module);
+ use std::path::Path;
+ library_module.print_to_file(Path::new("debug")).unwrap();
jit.deploy(&library_module);
let library_pointers = LibraryPointers::new(&jit); |
I think I'm linking to LLVM 6 correctly, though my compiler itself depends on my systems
llvm-libs
which contains.so
files, so IDK for sure I guess... Either way this is the error I'm getting on my Arch Linux system ATM.The text was updated successfully, but these errors were encountered: