5

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?

Slaus
  • 1,804
  • 4
  • 25
  • 38
  • difficult to help without any code. Can you boil this down to a small reproducible example and include it here? – Sam Miller Feb 23 '11 at 15:20
  • If you go up the call stack a bit eventually you will get to the point where you can figure out what caused the problem, e.g,. which field in a struct – jrh May 28 '21 at 16:14

1 Answers1

9

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.

Karl Bielefeldt
  • 45,012
  • 10
  • 59
  • 90