Boost Users :
Subject: Re: [Boost-users] double free when both shared library and executable linked to boost libraries
From: John Maddock (boost.regex_at_[hidden])
Date: 2015-01-09 04:30:13
> Unfortunately I was not able to pinpoint the specific boost library
> that caused the double free using address sanitizer. As you mentioned
> the double free occurs during program exit routine and all I see is
> that some std::string object is being freed.
> In this case I do have access to both the main executable and the
> plugins so I can choose how they are compiled to avoid this error. It
> would still be good to figure out how I can compile the main
> executable to be robust to how the shared library plugins are
> compiled. I will try compiling boost with hidden visibility to see if
> it resolves this issue. Is this the correct way to achieve that?:
> ./b2 link=static threading=multi cxxflags='-fPIC -fvisibility=hidden
> -fvisibility-inlines-hidden' install
You don't want -fPIC in there for a static link do you?
> Aren't there some boost libraries that force symbols to have default
> visibility? If so, setting -fvisibility=hidden won't change that.
Not sure about that - a quick grep suggests that where they do they set
visibility to "default" which I think means "same as command line" ?
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net