Re: Help with NIF upgrade implementation
Mikael Pettersson <[email protected]>
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <CAM43=SOPYRn3Gonn27uQgpCssRnrKfG52i2DPmHL_=BJrwajcA@mail.gmail.com> |
On Fri, Sep 11, 2020 at 6:58 PM Sverker Eriksson <[email protected]> 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.