Get the latest tech news
Debugging Rustler on Illumos
Welcome to SYSTEM•ILLUMINATION! This is the first illumination I have written and the one that prompted me to start this space. This first session tackles several topics as you join me on the journey I took to debug Rustler misbehaving on OmniOS.
Recently I decided I wanted to delve deeper into the illumos ecosystem; I had briefly used it a couple of years ago for a small server I was running. pid$target::load_nif_error:entry { printf("ERROR: %s\n", copyinstr(arg0)); } To confirm that it was working properly, I traced the user function patch_call_nif_early that is called only in the case everything goes well. $($used)+ #[cfg_attr( all( not(target_family = "wasm"), any( target_os = "linux", target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "haiku", target_os = "illumos", target_os = "netbsd", target_os = "openbsd", target_os = "none", ) ), link_section = ".init_array", )] #[cfg_attr( target_family = "wasm", $crate::__private::attr( any(all(stable, since(1.85)), since(2024-12-18)), link_section = ".init_array", ), )] #[cfg_attr( any(target_os = "macos", target_os = "ios"), link_section = "__DATA,__mod_init_func,mod_init_funcs", )] #[cfg_attr(windows, link_section = ".CRT$XCU")] static __CTOR: unsafe extern "C" fn() = __ctor; ld.so.1(1) is the illumos runtime linker for dynamic objects, and it is responsible for loading the shared library objects like our NIF library.
Or read this on Hacker News