Boost logo

Boost :

From: Ashok Thirumurthi (athirumurthi.news_at_[hidden])
Date: 2005-10-28 19:36:47

Dear Boost,

The following call stack leads to an access violation when I link a VC 7.1 DLL to the release build of the boost signals 1_33_0 DLL. In comparison, there is no access violation when I link to the debug build of the same library. Similarly, when I add the signals source to my own release DLL, there is no access violation. I attempted to disable all compiler optimizations in msvc.jam as follows. However, after running bjam -a in signals\build and installing the output, the AV still occurs.

    # 8.0 deprecates some of the options
    if ! [ MATCH ^([67].*) : $(version) ]
        # flags msvc.compile CFLAGS $(condition)/<optimization>speed : /O2 ;
        # flags msvc.compile CFLAGS $(condition)/<optimization>space : /O1 ;
        flags MANIFEST : "mt -manifest " ;
        flags OUTPUTRESOURCE : "-outputresource:" ;
        # flags msvc.compile CFLAGS $(condition)/<optimization>speed : /Ogity /O2 /Gs ;
        # flags msvc.compile CFLAGS $(condition)/<optimization>space : /Ogisy /O1 /Gs ;

Note that I have a default installation of Visual Studio 2003. How can I alter the release build to avoid the access violation? More information:

Access violation reading location 0x00000004
(*((k2).content)).__vfptr is 0x00000000

 bool operator()(const any& k1, const any& k2) const
    if (k1.type() == typeid(front_type))
      return !(k2.type() == typeid(front_type));
    if (k1.type() == typeid(back_type))
      return false;
> if (k2.type() == typeid(front_type))
      return false;
    if (k2.type() == typeid(back_type))
      return true;

> Colorado.dll!boost::signals::detail::any_bridge_compare<std::less<int>,int>::operator()(const boost::any & k1={...}, const boost::any & k2={...}) Line 54 + 0xc C++
  Colorado.dll!boost::detail::function::function_obj_invoker2<boost::signals::detail::any_bridge_compare<std::less<int>,int>,bool,boost::any,boost::any>::invoke(boost::detail::function::any_pointer function_obj_ptr={...}, boost::any a0={...}, boost::any a1={...}) Line 119 + 0x1b C++
  Colorado.dll!boost::signal0<bool,boost::last_value<bool>,int,std::less<int>,boost::function<bool __stdcall(void),std::allocator<void> > >::signal0<bool,boost::last_value<bool>,int,std::less<int>,boost::function<bool __stdcall(void),std::allocator<void> > >(const boost::last_value<bool> & c={...}, const std::less<int> & comp={...}) Line 198 + 0x85 C++

Do these observations suggest how I might successfully handle this callback from the release boost DLL? Thanks in advance,

- Ashok Thirumurthi

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