Boost logo

Boost Users :

Subject: Re: [Boost-users] Trouble with asio using lib pion and boost.function
From: Stephan Menzel (stephan.menzel_at_[hidden])
Date: 2008-11-26 17:06:00

Hi Steven,

> > return static_cast<vtable_type*>(vtable)->invoker
> > }
> > #endif
> >
> > It says the static_cast rises the exception (?!) Damn MS.
> a) Is the error on the static_cast or on reading the function pointer?

Alas, I can't really tell. For the compiler this is one line. But I have to
assume it's coming out of the functor. At least this is what the debug run
looked like.

> b) does it happen consistently?

Yes, every time.

> This could be the 1.36 Boost.Function thread safety regression.
> There is a race condition that can prevent invoker from being
> properly initialized before it is used.

Bad news indeed. But it would have to be something rather platform dependent
such as this. Despite all efforts I couldn't reproduce it on either 64bit or
32bit GNU/Linux boxes I tried.
Alas, it still get's worse. Trying to figure out if an update to 1.37 would be
in place I ran into this:
Apparently boost.asio fails to work in 1.37 on windows. Which is mighty
disappointing, since I hold asio in such high esteem. So is there any other
way of fixing that so I could see if that was it? A patch for 1.36 perhaps?

Apart from this, wouldn't a race condition bound to be a little more hard to
catch? Usually the buggers tend to be rather unreproducable to the point you
doubt they exist.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at