Boost logo

Boost :

Subject: Re: [boost] [system] Header-only Boost.System by default ?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2017-10-10 22:01:43

> Is there any unit-tests or are any open program relying on the
> uniqueness of error_category across modules ?

Yes, all error condition comparisons to error code stops working right
if error categories do not have canonical unique addresses. That affects
ASIO and Filesystem at the very least.

>> And even if the "same address" thing was solvable (which I think it
>> is, although not pretty and it would require interface changes), there
>> is the problem with unloading DLLs/SOs. You'd have to pin every module
>> that contains error categories. Which IMO is a side effect that you
>> really don't expect and want, especially from a header-only library.
> I must be missing something about internal linkage. This problem should
> already exists with the current implementation no ? If you have an
> error_category singleton instance in a TU, then unloading a dll
> containing this TU should also lead to having the error_category refer
> to some incorrect memory location then.
> Do you know of any example code doing this ?

Python loads its modules with RTLD_LOCAL, so multiple copies of Boost,
the STL etc appear in memory. Lots of other programming languages do the
same. ELF is really very broken indeed. MachO and PE deficiencies can at
least be worked around.


ned Productions Limited Consulting

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