Boost logo

Boost :

Subject: Re: [boost] "peer reviewed" - Rights and responsibilities of maintainers
From: Gavin Lambert (boost_at_[hidden])
Date: 2018-10-17 02:36:23

Mere moments ago, quoth I:
> It's not inherently impossible for it to happen; the code can be inlined
> with only that variable being used as an external symbol pointing into
> unloaded memory.  Which might not even crash when run on an OS that
> doesn't free the pages immediately (or at all).

FWIW (and again I have to confess ignorance of the specific code in
question, and of how the Linux dynamic linker behaves), if some symbol
*has* been marked with BOOST_SYMBOL_VISIBLE then I wonder if something
like this could explain why things apparently work on Windows but not Linux:

Code is inlined with separate (hidden) instantiations in each shared
library, which internally refers to some shared (visible) external
symbol. During load, the dynamic linker happens to pick the one in the
library which you later unload first; then the method in the
still-loaded library is called and tries to access this
no-longer-existing symbol.

Although I assume that this would probably only occur if you tried to
unload the libraries in the wrong order. It shouldn't be possible if
you unload strictly in reverse order of load.

Boost list run by bdawes at, gregod at, cpdaniel at, john at