Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost serialization assertion fail

I use boost's binary serialization and it worked well until now. I have std::list of pointers to serialize for output (oarchive) but serialization fails inside object's serialize() function with MSVC's dialog:

R6010 -abort() has been called

and such string is printed into console window:

Assertion failed: 0 == static_cast<int>(t) || 1 == static_cast<int>(t), file c:\program files\boost\boost_1_44\boost\archive\basic_binary_oprimitive.hpp, line 91

what does it mean?

Project is pretty big, sources are distributed so I cannot post it's code here, but I tried to simulate this error within simple project - there it works fine what is strange.

P.S. I use boost 1.44 with MSVC2010EE on Windows XP. When I click "retry" on "Debug Error!" window debugger shows arrow on the code line next to serialization archive << myList; line - I mean it seems like error occurred at some destructor or something. When I make changes inside objects serialize() function - they will be applied just when I rebuild whole project (clean before compiling) - but if I just compile it (where IDE shows that all sources which include changed header are recompiled) - no changes will happen at runtime since last version (I tried with printf()) - that's strange. Could I occasionally set some critical definitions or something?

like image 986
Slaus Avatar asked Feb 23 '11 14:02

Slaus


1 Answers

The line in question says:

// trap usage of invalid uninitialized boolean which would
// otherwise crash on load.

It looks like at some point you are trying to serialize a bool that hasn't been initialized. Without further code we can't help you find which one.

like image 162
Karl Bielefeldt Avatar answered Sep 30 '22 00:09

Karl Bielefeldt