[serialization] using serialization in shared library plugin
hello, i have big problem using boost::serialization under windows xp (vs2005sp). the thing is: there is a main application and there are .dll as plugins. i'd like to use boost::serialization from within the plugin, but i get segmentation faults immeadiately when boost_serialization.*.dll is loaded into memory. i traced it to some static_register and then i lost the trace. my guess is that the library tries to allocate some memory, but our own allocator is not loaded and initialized yet... do you have, please, some recommendations how to use the serialization in this way? many thanks in advance, mojmir
Mojmir Svoboda schrieb:
hello,
i have big problem using boost::serialization under windows xp (vs2005sp). the thing is: there is a main application and there are .dll as plugins. i'd like to use boost::serialization from within the plugin, but i get segmentation faults immeadiately when boost_serialization.*.dll is loaded into memory.
Is it possible that you have a managed application? There is a bug in vs2005 which happens with singletons in dlls (only for mixed code). I have made a few tests a long time ago with the beta version of VS2008 and there it works. Best regards Hansjörg
Mixing managed and native code is sometimes complicated. If you are going
to use static variables, try to put them inside static functions, so you
will delay
the constructor execution. You must also take extra steps when you configure
your application: try to set your application subsystem to "NOT SET" and
leave
an empty entrypoint. If the problem persist, try to link boost with static
linkage
or with other linker config. Also check out msdn about this topic.
Isaac Lascasas.
--------------------------------------------------
From: "Hansi"
Mojmir Svoboda schrieb:
hello,
i have big problem using boost::serialization under windows xp (vs2005sp). the thing is: there is a main application and there are .dll as plugins. i'd like to use boost::serialization from within the plugin, but i get segmentation faults immeadiately when boost_serialization.*.dll is loaded into memory.
Is it possible that you have a managed application? There is a bug in vs2005 which happens with singletons in dlls (only for mixed code). I have made a few tests a long time ago with the beta version of VS2008 and there it works.
Best regards
Hansjörg
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
I don't know which version of boost you're using. This has been addressed in version 1.36 - hopefully in a definitive way. The new documentation includes a discussion on this issue. Robert Ramey Mojmir Svoboda wrote:
hello,
i have big problem using boost::serialization under windows xp (vs2005sp). the thing is: there is a main application and there are .dll as plugins. i'd like to use boost::serialization from within the plugin, but i get segmentation faults immeadiately when boost_serialization.*.dll is loaded into memory.
i traced it to some static_register and then i lost the trace. my guess is that the library tries to allocate some memory, but our own allocator is not loaded and initialized yet...
do you have, please, some recommendations how to use the serialization in this way?
many thanks in advance, mojmir
good morning Robert,
* Robert Ramey
I don't know which version of boost you're using.
oh sorry, i am using "almost" 1.35 concerning serialization. the thing is: i have 1.33.1 in work, but i am unable to make the serialization work. so i mixed the two sources, i replaced boost/archive and boost/serialization by those from 1.35.0. i cannot upgrade whole boost to 1.35.0, because when i do it crashes compiler (i do not have time to investigate right now) - i'll try with 1.36.0 and cross my fingers. right now i am trying mix of 1.33.1 and 1.36.0 aaaand... it works :)) the library loads without any problems. okay, i am the happiest man now - it came just in time. many thanks, Robert! Mojmir //ps: perhaps when you're in the right mood, you could decorate these with some ifndef BOOST_NO_TYPEID detail\shared_count_132.hpp(122) : error C2039: 'type_info' : is not a member of 'std' detail\shared_count_132.hpp(272) : error C2039: 'type_info' : is not a member of 'std' detail\shared_count_132.hpp(444) : error C2039: 'type_info' : is not a member of 'std' detail\shared_ptr_132.hpp(327) : error C2039: 'type_info' : is not a member of 'std' why there is another shared_ptr anyway?
participants (4)
-
Hansi
-
Isaac Lascasas
-
Mojmir Svoboda
-
Robert Ramey