[serialization] BCB2006 support

Hallo, Robert. I eventually setup a test environment where I can run tests from both BCB6 and BCB2006, and I'm currently looking into test_delete_pointer's failure. I still see the problem I mentioned a while ago where boost::archive::version_type is being written out as a bool, even though this is not the main problem. What causes the test to fail is bpis_ptr being NULL at line 485 in basic_iarchive.cpp: if(! tracking){ bpis_ptr->load_object_ptr(ar, t, co.file_version); This call obviously generates an access violation. I've yet to figure out why. Any suggestion is welcome :-) Cheers, Nicola Musatti

I certainly appreciate your efforts here. I know first hand that tracking down these errors requires lots of effort and determination!!! I'll take a look and see if I can come up with anything useful to you. Robert Ramey Nicola Musatti wrote:
Hallo, Robert. I eventually setup a test environment where I can run tests from both BCB6 and BCB2006, and I'm currently looking into test_delete_pointer's failure.
I still see the problem I mentioned a while ago where boost::archive::version_type is being written out as a bool, even though this is not the main problem. What causes the test to fail is bpis_ptr being NULL at line 485 in basic_iarchive.cpp:
if(! tracking){ bpis_ptr->load_object_ptr(ar, t, co.file_version);
This call obviously generates an access violation. I've yet to figure out why. Any suggestion is welcome :-)
Cheers, Nicola Musatti
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

There are a couple of places which might be good to look at here. a) iserializer.hpp line # 190 b) iserializer.hpp line # 326 These two areas have borland specific code related to ensure that pointer de-serialization is instantiated. Perhaps borland has been improved so that it works more like other compilers in this regard. You might try tweaking these areas - using workaround borland version ... etc so that the more modern version uses the standard way. Let me know how this works. Robert Ramey Nicola Musatti wrote:
Hallo, Robert. I eventually setup a test environment where I can run tests from both BCB6 and BCB2006, and I'm currently looking into test_delete_pointer's failure.
I still see the problem I mentioned a while ago where boost::archive::version_type is being written out as a bool, even though this is not the main problem. What causes the test to fail is bpis_ptr being NULL at line 485 in basic_iarchive.cpp:
if(! tracking){ bpis_ptr->load_object_ptr(ar, t, co.file_version);
This call obviously generates an access violation. I've yet to figure out why. Any suggestion is welcome :-)
Cheers, Nicola Musatti
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Robert Ramey wrote:
There are a couple of places which might be good to look at here.
a) iserializer.hpp line # 190 b) iserializer.hpp line # 326
These two areas have borland specific code related to ensure that pointer de-serialization is instantiated. Perhaps borland has been improved so that it works more like other compilers in this regard. You might try tweaking these areas - using workaround borland version ... etc so that the more modern version uses the standard way. Let me know how this works.
Thanks for your suggestion, it did prove helpful! I enclose a couple of patches which cause some 30 tests to pass which previously failed. Let me know what you think and if you want me to apply them. Cheers, Nicola Musatti ******Index: basic_text_oprimitive.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/basic_text_oprimitive.hpp,v retrieving revision 1.12 diff -d -u -r1.12 basic_text_oprimitive.hpp --- basic_text_oprimitive.hpp 4 Feb 2006 20:35:35 -0000 1.12 +++ basic_text_oprimitive.hpp 24 May 2006 20:53:36 -0000 @@ -58,6 +58,10 @@ class save_access; +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) && __BORLANDC__ >= 0x580 +class version_type; +#endif + ///////////////////////////////////////////////////////////////////////// // class basic_text_oprimitive - output of prmitives to stream template<class OStream> @@ -84,6 +88,14 @@ os << t; } + #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) && __BORLANDC__ >= 0x580 + void save(const version_type t){ + if(os.fail()) + boost::throw_exception(archive_exception(archive_exception::stream_error)); + os << t.t; + } + #endif + ///////////////////////////////////////////////////////// // fundamental types that need special treatment void save(const bool t){ ******Index: iserializer.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/detail/iserializer.hpp,v retrieving revision 1.30 diff -d -u -r1.30 iserializer.hpp --- iserializer.hpp 12 Feb 2006 05:45:16 -0000 1.30 +++ iserializer.hpp 24 May 2006 21:42:57 -0000 @@ -187,7 +187,7 @@ public: // at least one compiler (CW) seems to require that serialize_adl // be explicitly instantiated. Still under investigation. - #if !defined(__BORLANDC__) + #if ! BOOST_WORKAROUND(__BORLANDC__, < 0x582) void (* const m)(Archive &, T &, const unsigned); boost::serialization::extended_type_info * (* e)(); #endif

Nicola Musatti wrote:
******Index: basic_text_oprimitive.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/basic_text_oprimitive.hpp,v
I think your analysis of the problem is correct - but I think the fix is in the wrong place. Basically, I don't want to take any other than primitive types. I'll look into it. Give me a couple of days
******Index: iserializer.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/detail/iserializer.hpp,v retrieving revision 1.30 diff -d -u -r1.30 iserializer.hpp --- iserializer.hpp 12 Feb 2006 05:45:16 -0000 1.30 +++ iserializer.hpp 24 May 2006 21:42:57 -0000 @@ -187,7 +187,7 @@ public: // at least one compiler (CW) seems to require that serialize_adl // be explicitly instantiated. Still under investigation. - #if !defined(__BORLANDC__) + #if ! BOOST_WORKAROUND(__BORLANDC__, < 0x582) void (* const m)(Archive &, T &, const unsigned); boost::serialization::extended_type_info * (* e)(); #endif
This looks OK - I'll check this into RC_1_34 in the next couple of days. Thanks so much for taking an interest in this. Without your efforts, no progress would have been made here. Robert Ramey

Robert Ramey wrote:
Nicola Musatti wrote:
******Index: basic_text_oprimitive.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/basic_text_oprimitive.hpp,v
I think your analysis of the problem is correct - but I think the fix is in the wrong place. Basically, I don't want to take any other than primitive types. I'll look into it. Give me a couple of days
Certainly. Just keep in mind that there may be other BOOST_STRONG_TYPEDEF related patches needed to fix the remaining problems.
******Index: iserializer.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/detail/iserializer.hpp,v retrieving revision 1.30 diff -d -u -r1.30 iserializer.hpp --- iserializer.hpp 12 Feb 2006 05:45:16 -0000 1.30 +++ iserializer.hpp 24 May 2006 21:42:57 -0000 @@ -187,7 +187,7 @@ public: // at least one compiler (CW) seems to require that serialize_adl // be explicitly instantiated. Still under investigation. - #if !defined(__BORLANDC__) + #if ! BOOST_WORKAROUND(__BORLANDC__, < 0x582) void (* const m)(Archive &, T &, const unsigned); boost::serialization::extended_type_info * (* e)(); #endif
This looks OK - I'll check this into RC_1_34 in the next couple of days.
Thanks so much for taking an interest in this. Without your efforts, no progress would have been made here.
You're welcome. Cheers, Nicola Musatti

Nicola Musatti wrote:
Robert Ramey wrote:
Nicola Musatti wrote:
******Index: basic_text_oprimitive.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/basic_text_oprimitive.hpp,v
I think your analysis of the problem is correct - but I think the fix is in the wrong place. Basically, I don't want to take any other than primitive types. I'll look into it. Give me a couple of days
Certainly. Just keep in mind that there may be other BOOST_STRONG_TYPEDEF related patches needed to fix the remaining problems.
BOOST_STRONG_TYPEDEF has worked well on all platforms except borland. Ideally I would like to see if a borland fix could be integrated into BOOST_STRONG_TYPEDEF itself. This however would require a separate test for BOOST_STRONG_TYPEDEF which I don't have. Robert Ramey

Robert Ramey wrote:
Nicola Musatti wrote:
Robert Ramey wrote:
Nicola Musatti wrote:
******Index: basic_text_oprimitive.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/basic_text_oprimitive.hpp,v
I think your analysis of the problem is correct - but I think the fix is in the wrong place. Basically, I don't want to take any other than primitive types. I'll look into it. Give me a couple of days
Just a quick update: by special-casing class_id_type and class_id_reference_type like I did for version_type I managed to get almost on a par with BCB6. The remaining four regressions appear to be due to something completely different.
BOOST_STRONG_TYPEDEF has worked well on all platforms except borland. Ideally I would like to see if a borland fix could be integrated into BOOST_STRONG_TYPEDEF itself. This however would require a separate test for BOOST_STRONG_TYPEDEF which I don't have.
I see your point. I wonder if a template based approach would be much more complicated. I say this because I can't see what may be causing the compiler to generate a call to the bool overload of operator>> and I fear that finding the magic spell by trial and error might result in a considerable waste of time. Cheers, Nicola Musatti

Robert Ramey wrote:
Nicola Musatti wrote: [...]
******Index: iserializer.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/detail/iserializer.hpp,v retrieving revision 1.30 diff -d -u -r1.30 iserializer.hpp --- iserializer.hpp 12 Feb 2006 05:45:16 -0000 1.30 +++ iserializer.hpp 24 May 2006 21:42:57 -0000 @@ -187,7 +187,7 @@ public: // at least one compiler (CW) seems to require that serialize_adl // be explicitly instantiated. Still under investigation. - #if !defined(__BORLANDC__) + #if ! BOOST_WORKAROUND(__BORLANDC__, < 0x582) void (* const m)(Archive &, T &, const unsigned); boost::serialization::extended_type_info * (* e)(); #endif
This looks OK - I'll check this into RC_1_34 in the next couple of days.
Wait! I just realized that this is not needed and is in fact harmful. The attached patch just substitutes BOOST_WORKAROUND for defined(__BORLANDC__). Cheers, Nicola Musatti ******Index: iserializer.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/detail/iserializer.hpp,v retrieving revision 1.30 diff -d -u -r1.30 iserializer.hpp --- iserializer.hpp 12 Feb 2006 05:45:16 -0000 1.30 +++ iserializer.hpp 25 May 2006 07:43:24 -0000 @@ -187,7 +187,7 @@ public: // at least one compiler (CW) seems to require that serialize_adl // be explicitly instantiated. Still under investigation. - #if !defined(__BORLANDC__) + #if ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) void (* const m)(Archive &, T &, const unsigned); boost::serialization::extended_type_info * (* e)(); #endif @@ -321,7 +321,7 @@ } template<class T, class Archive> -#if !defined(__BORLANDC__) +#if ! BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) BOOST_DLLEXPORT pointer_iserializer<T, Archive>::pointer_iserializer() : archive_pointer_iserializer<Archive>( * boost::serialization::type_info_implementation<T>::type::get_instance()

Robert Ramey wrote:
Nicola Musatti wrote:
******Index: basic_text_oprimitive.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/basic_text_oprimitive.hpp,v
I think your analysis of the problem is correct - but I think the fix is in the wrong place. Basically, I don't want to take any other than primitive types. I'll look into it. Give me a couple of days
It just occurred to me that you may want to consider applying my patch as a stopgap measure to the RC_1_34_0 branch and design a cleaner solution within the changes you are making to HEAD. Either way is fine with me. Cheers, Nicola Musatti

Nicola, I've checked in changes to RC_1_34_0 last 30 may. I believe these changes should fix the issue you detected. But now I'm not sure as I don't remember the results of the previous tests. Note that I made a change in basic_text_oarchive.hpp in lieu of your suggestion for basic_text_oprmitive.hpp. I believe that this is in the correct place. We're still geting errors however so could you please take another look at this? Robert Ramey Nicola Musatti wrote:
Robert Ramey wrote:
There are a couple of places which might be good to look at here.
a) iserializer.hpp line # 190 b) iserializer.hpp line # 326
These two areas have borland specific code related to ensure that pointer de-serialization is instantiated. Perhaps borland has been improved so that it works more like other compilers in this regard. You might try tweaking these areas - using workaround borland version ... etc so that the more modern version uses the standard way. Let me know how this works.
Thanks for your suggestion, it did prove helpful! I enclose a couple of patches which cause some 30 tests to pass which previously failed. Let me know what you think and if you want me to apply them.
Cheers, Nicola Musatti
******Index: basic_text_oprimitive.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/basic_text_oprimitive.hpp,v retrieving revision 1.12 diff -d -u -r1.12 basic_text_oprimitive.hpp --- basic_text_oprimitive.hpp 4 Feb 2006 20:35:35 -0000 1.12 +++ basic_text_oprimitive.hpp 24 May 2006 20:53:36 -0000 @@ -58,6 +58,10 @@
class save_access;
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) && __BORLANDC__ >= 0x580 +class version_type; +#endif + ///////////////////////////////////////////////////////////////////////// // class basic_text_oprimitive - output of prmitives to stream template<class OStream> @@ -84,6 +88,14 @@ os << t; }
+ #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) && __BORLANDC__ >= 0x580 + void save(const version_type t){ + if(os.fail()) + boost::throw_exception(archive_exception(archive_exception::stream_error)); + os << t.t; + } + #endif + ///////////////////////////////////////////////////////// // fundamental types that need special treatment void save(const bool t){
******Index: iserializer.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/detail/iserializer.hpp,v retrieving revision 1.30 diff -d -u -r1.30 iserializer.hpp --- iserializer.hpp 12 Feb 2006 05:45:16 -0000 1.30 +++ iserializer.hpp 24 May 2006 21:42:57 -0000 @@ -187,7 +187,7 @@ public: // at least one compiler (CW) seems to require that serialize_adl // be explicitly instantiated. Still under investigation. - #if !defined(__BORLANDC__) + #if ! BOOST_WORKAROUND(__BORLANDC__, < 0x582) void (* const m)(Archive &, T &, const unsigned); boost::serialization::extended_type_info * (* e)(); #endif
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Robert Ramey wrote:
Nicola,
I've checked in changes to RC_1_34_0 last 30 may. I believe these changes should fix the issue you detected. But now I'm not sure as I don't remember the results of the previous tests.
I've just checked. Your changes cause 30 tests to pass which didn't when I started looking into this. However my proposed patch would have caused 34 more tests to pass. In principle it should be possible to get to a stage where only 4 regressions remain over bcc32 5.6.4 .
Note that I made a change in basic_text_oarchive.hpp in lieu of your suggestion for basic_text_oprmitive.hpp. I believe that this is in the correct place. We're still geting errors however so could you please take another look at this?
I will. Cheers, Nicola Musatti

Nicola Musatti wrote:
Robert Ramey wrote: [...] I've just checked. Your changes cause 30 tests to pass which didn't when I started looking into this. However my proposed patch would have caused 34 more tests to pass. In principle it should be possible to get to a stage where only 4 regressions remain over bcc32 5.6.4 .
Note that I made a change in basic_text_oarchive.hpp in lieu of your suggestion for basic_text_oprmitive.hpp. I believe that this is in the correct place. We're still geting errors however so could you please take another look at this?
The enclosed patch reduces regressions over 5.6.4 to a total of 20. See how you like it. Cheers, Nicola Musatti ******Index: basic_text_oarchive.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/basic_text_oarchive.hpp,v retrieving revision 1.9.2.1 diff -d -u -r1.9.2.1 basic_text_oarchive.hpp --- basic_text_oarchive.hpp 30 May 2006 15:58:22 -0000 1.9.2.1 +++ basic_text_oarchive.hpp 6 Jun 2006 21:07:50 -0000 @@ -97,6 +97,18 @@ * this->This() << x; } + void save_override(const class_id_type & t, int){ + // note:t.t resolves borland ambguity + unsigned char x = t.t; + * this->This() << x; + } + + void save_override(const class_id_reference_type & t, int){ + // note:t.t resolves borland ambguity + unsigned char x = t.t; + * this->This() << x; + } + void save_override(const class_name_type & t, int){ const std::string s(t); * this->This() << s;

Nicola Musatti wrote: [...]
The enclosed patch reduces regressions over 5.6.4 to a total of 20. See how you like it.
My previous patch was buggy. The correct one is attached to this message and is equivalent to my original one: with this applied only four regressions remain with respect to BCB6. Cheers, Nicola Musatti ******Index: basic_text_oarchive.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/archive/basic_text_oarchive.hpp,v retrieving revision 1.9.2.1 diff -d -u -r1.9.2.1 basic_text_oarchive.hpp --- basic_text_oarchive.hpp 30 May 2006 15:58:22 -0000 1.9.2.1 +++ basic_text_oarchive.hpp 7 Jun 2006 06:59:02 -0000 @@ -97,6 +97,18 @@ * this->This() << x; } + void save_override(const class_id_type & t, int){ + // note:t.t resolves borland ambguity + int x = t.t; + * this->This() << x; + } + + void save_override(const class_id_reference_type & t, int){ + // note:t.t resolves borland ambguity + int x = t.t; + * this->This() << x; + } + void save_override(const class_name_type & t, int){ const std::string s(t); * this->This() << s;

Looks like almost all issues re borland 5.82 serialization have been cleared up due to your efforts. Thanks a lot. Just to demonstrate that no good dead goes unpunished, you might want to look into the following. test variant fails - I think this is something in the variant library itself and not addressable from within the serialization libary or tests. test_no_rtti - this has always failed with bcb 5.64 and still fails with 5.82. I had given up hope. But I think I saw it pass with bjam V2. I checked the command line switches and they were different. So I'm wondering if some tweaking of the command line switches might help bcb passing on this test as well as possible others in other libraries. Anyway - thanks again for your hard work and successful results. Robert Ramey

Nicola Musatti, Robert Ramey wrote:
Looks like almost all issues re borland 5.82 serialization have been cleared up due to your efforts.
Thanks a lot.
Just to demonstrate that no good dead goes unpunished, you might want to look into the following.
test variant fails - I think this is something in the variant library itself and not addressable from within the serialization libary or tests.
test_no_rtti - this has always failed with bcb 5.64 and still fails with 5.82. I had given up hope. But I think I saw it pass with bjam V2. I checked the command line switches and they were different.
So I'm wondering if some tweaking of the command line switches might help bcb passing on this test as well as possible others in other libraries.
Anyway - thanks again for your hard work and successful results.
Robert Ramey
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Robert Ramey wrote:
Looks like almost all issues re borland 5.82 serialization have been cleared up due to your efforts.
Thanks a lot.
You're welcome!
Just to demonstrate that no good dead goes unpunished, you might want to look into the following.
test variant fails - I think this is something in the variant library itself and not addressable from within the serialization libary or tests.
This is a general problem. I suspect that Borland support could improve throughout Boost, but it would take a lot of effort!
test_no_rtti - this has always failed with bcb 5.64 and still fails with 5.82. I had given up hope. But I think I saw it pass with bjam V2. I checked the command line switches and they were different.
So I'm wondering if some tweaking of the command line switches might help bcb passing on this test as well as possible others in other libraries.
In a way I hope you're wrong. Tweaking conformance by changing compiler switches is a nightmare I'm not prepared to face :-)
Anyway - thanks again for your hard work and successful results.
It was a rather interesting challenge. It's a pity I have so little time to devote to these things! Cheers, Nicola Musatti
participants (2)
-
Nicola Musatti
-
Robert Ramey