Robert Gabriel Jakabosky
Robert Gabriel Jakabosky
Looks like a crash from `cr_plugin_sections_reload` during a reload after a rollback. I disabled the signal handler. 1. start host. guest version (1) 2. compile new guest version (2) 3....
I found the problem. 1. host starts with guest version 1 `libraw_guest0.so` 2. re-compile with panic. 3. reload guest version 2 `libraw_guest1.so` 4. panic. 5. rollback "unload" `libraw_guest1.so` 6. reload...
I was thinking it was do to TLS usage causing `dlclose` to not really unload the shared library. But I just found this [stack overflow answer about `-fno-gnu-unique`](https://stackoverflow.com/a/51402034/98107)
I haven't been able to cause a C guest to stay loaded. I was able to load a Rust guest plugin in the `basic_host` c++ sample. The Rust plugin wouldn't...
Final made a Rust plugin that unloads correctly: ```rust use std::os::raw::{c_int, c_void}; #[no_mangle] pub fn cr_main(_ctx: *mut c_void, _cr_op: c_int) -> c_int { //println!("From Rust!"); // this print will prevent...
This problem doesn't happen on Windows. The Rust plugin rollback and reload seem to work just fine. I haven't tested MacOS. Maybe this is a Rust only issue on Linux.
Final made a c++ example that uses TLS destructors that has the same issue: ```c++ #include #include #include "../cr.h" thread_local std::string tls_str("hello tls"); CR_EXPORT int cr_main(struct cr_plugin *ctx, enum cr_op...
Compiling the C++ TLS plugin with `-fno-use-cxa-atexit` flag fixes the unload problem for that plugin. Now to find the same option for Rust plugins. I haven't checked if the TLS...
FYI, found that compiler flag on [this stackoverflow answer](https://stackoverflow.com/a/3815021/98107)
I can't find anyway to disable `__cxa_thread_atexit` usage in Rust. There doesn't seem to be a compiler flag for Rust. Atleast C++ module can avoid the problem. I might look...