Help with NIF upgrade implementation

Mikael Pettersson mikpelinux@REDACTED
Fri Sep 11 20:56:41 CEST 2020

On Fri, Sep 11, 2020 at 6:58 PM Sverker Eriksson
<sverker.eriksson@REDACTED> wrote:
> One thing to look out for is that dlopen() (depending on OS) may identify the library by its file name only. That is, even if the .so file have been rebuilt with new code dlopen may think it’s the same as the old one already loaded and do nothing.

This matches my experience when adding a NIF to my btree library, and
trying to get upgrades to work.  I ended up having to include a
version number in the NIF's .so file name, and bump that whenever the
NIF code changed, to reliably get the new code mapped and used.
This was on Linux with glibc.

More information about the erlang-questions mailing list