The purpose of this repo is to show two things
- Differences in behavior between MacOS and Linux
- On MacOS the init/fini are called each time the thread load/unloads the module
- On Linux init is called at least once on start and at least once on test ext but also sporatically during test execution
- Segmentation fault when running on Linux
- Note: segmentation fault does not occur 100% of the time
This project contains a dynamic module built as a member of the workspace. This module is not built by cargo run
so you must always issue cargo build
first.
cargo build
cargo run
Linux:
cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/dynamic_module_segfault`
spawn 100 threads for 10000 iteractions
.init
.fini
.init
Segmentation fault (core dumped)