Comments (6)
Thanks for reporting this! I think I'm already aware of this issue but I haven't been able to figure out a way to avoid the segfault and error because IIRC LLVM doesn't provide a way to check if any target has yet been initialized and also because LLVM's global state seems quite messy from an outside perspective so keeping track of it manually seemed really tricky if not impossible
from inkwell.
One possible soution might be to generate a ZST from those target initializers which is required to be passed into the EE creation method, which would ensure at least one initializer has been called (so long as the user can't create the ZST themselves)
from inkwell.
Yeah I've noticed this happens inside of
Lines 497 to 502 in 949634d
FWIW error string returned by LLVM in that particular case is "Unable to find target for this triple (no targets are registered)"
... but comparing them would be a horrible idea and I shouldn't even think about that :)
Another interesting place is implementation of Clone
itself:
Lines 1323 to 1325 in 949634d
That one says it calls verify to make sure that actual cloning doesn't segfault, but then if verify itself segfaults, what's the difference? Although removing it doesn't fix the issue either...
from inkwell.
As far as I can tell, calling initialize_native
multiple times is no-op, as LLVM should already know whether target has been previously initialised.
As such, I wonder if it would make sense and be simpler to just call it as part of create_jit_execution_engine
so that user wouldn't need to remember to do so?
from inkwell.
Hmm maybe. You can only run a JIT with a native target, right?
from inkwell.
As far as I understand, yeah. (Same for interpreter engine I guess.)
from inkwell.
Related Issues (20)
- ORC support HOT 1
- Const struct member access HOT 1
- Segfault when using `module.create_jit_execution_engine()` HOT 2
- Named keys on debug struct types HOT 1
- Adding get_allocated_type, is_terminator and is_conditional to InstructionValue HOT 1
- Add a function to add llvm ir directly HOT 1
- after importing LLVM IR, a segmentation fault occurs when calling its internal method HOT 2
- Restricting build_*_gep to make it safer. HOT 1
- Add more constants for dwarf flags HOT 2
- Implement `Clone + Copy` for `ContextRef` HOT 2
- Support for `llvm::orc2::LLJit` HOT 1
- Solution: Inkwell Rust LLVM_SYS not set VSCODE
- `UnsafeFunctionPointer::Args` as a convienence. HOT 2
- [...]/libllvm_sys-af2874cb0b33780b.rlib: error adding symbols: file format not recognized HOT 1
- Support LLVM 18.1
- `Context::metadata_string` doc example returns an error
- rename `build_bitcast` to `build_bit_cast` HOT 1
- Wrong thread-safety trait implementing on LLVMString HOT 3
- Add set_opaque_pointers to Context
- Can't find Polly :( (tried the other posted issue too ) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inkwell.