Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization] boost::serialization adds huge amounts of exports to resultant Windows PE file
From: Lars Viklund (zao_at_[hidden])
Date: 2010-10-02 01:56:25


On Wed, Sep 29, 2010 at 06:48:55PM -0800, Robert Ramey wrote:
> Chris Yuen wrote:
> > Hey guys,
> >
> > I am using boost::serialization from 1.44.0. One thing that I noticed
> > is that linking statically to the serialization libs will add several
> > hundred exports in the final exe file that I get. Using `dumpbin
> > /exports my_program.exe`
>
> These functions are not explicity called from the library.
> But they ARE called as part of the serialization process. Its
> just that MSVC doesn't see them. So when you compile
> for release, The MSVC Linker strips them out and the
> program won't work anymore. In order to work around
> this, these functions are explicitly exported. This prevents
> MSVC from stripping them out. For more information
> see force_include.hpp

These exported symbols are excellent for provoking bugs in software that
makes assumptions about the maximum reasonable length a symbol should
be able to have.

I had a quite fun hair-tearing experience with a task manager
replacement that overran some buffer due to Boost.S11n, resulting in
instability, bogus output and program crashes.

They are a bit annoying though, as they tend to show up in any crash
reports I get, as they're the only symbols exported that the crash
helper can locate. Took me a couple of post-mortem debugs to look at the
offsets and realize that the names were red herrings.

Now I finally know why they are in my modules in the first place, heh.

-- 
Lars Viklund | zao_at_[hidden]

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