<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1519912327569_153508" dir="ltr">When I load more than 2 nifs in an app, I get total undefined defined behavior depending which nif loaded first. Like everything is totally messed up.<br><br>Example:<br><br>LD_PRELOAD="/nif1,so /nif2.so" rebar3 shell<br><br>nif1 works, nif2 is totally messed ,and randomly segfaults or gives errorneous results.<br><br>LD_PRELOAD="/nif2,so /nif1.so" rebar3 shell<br><br>Now nif2 works, and nif1 is erroneous.<br><br><br>Iv noticed this behavior before I recall, but now its resulted in so much frustration. Things were crashing in C++ boost side like <br><br></div><div id="yui_3_16_0_ym19_1_1519912327569_153508" dir="ltr">mystruct v = boost::value_initialized<decltype(v)>();  <br><br>Crash here with "<span style="color: rgb(51, 51, 51); font-family: arial; font-size: 14px; white-space: pre-wrap;" id="yui_3_16_0_ym19_1_1519912327569_153693">terminate called after throwing an instance of 'std::bad_alloc'".

Switch the order of the nifs and it works fine.</span></div></div></body></html>