[Variant] Assertion fails at variant/detail/visitation_impl.hpp:207
Hello! I'm using boost-1.55 on Linux. When I run a specific testcase, I get an abort at line 207 in the visitation_impl.hpp file. The comment says that "should never be here at runtime". Unfortunately I don't really understand under what circumstances could runtime end up here - could someone explain how? The variant has a recursive element, i.e. looks something like this: struct Resp; struct SR { } struct AR { std::vector<Resp> resp; } typedef variant< SR, recursive_wrapper<AR> > RMType; struct Resp { RMType rm; }
2015-01-30 14:08 GMT+03:00 Attila Rajmund Nohl
Hello!
I'm using boost-1.55 on Linux. When I run a specific testcase, I get an abort at line 207 in the visitation_impl.hpp file. The comment says that "should never be here at runtime". Unfortunately I don't really understand under what circumstances could runtime end up here - could someone explain how? The variant has a recursive element, i.e. looks something like this:
struct Resp;
struct SR { }
struct AR { std::vector<Resp> resp; }
typedef variant< SR, recursive_wrapper<AR> > RMType;
struct Resp { RMType rm; }
Could you please provide a full source code reproducing the error. Otherwise it's extremely hard to examine the issue.
"should never be here at runtime" It means that internal state of variant was broken and the variant variable does not know any more what type does it hold. Usually this means that something really wrong was done with the variant variable:
# 1
boost::variant
2015-01-30 19:23 GMT+01:00 Antony Polukhin
Could you please provide a full source code reproducing the error. Otherwise it's extremely hard to examine the issue.
"should never be here at runtime" It means that internal state of variant was broken and the variant variable does not know any more what type does it hold. Usually this means that something really wrong was done with the variant variable:
# 1 boost::variant
v; std::memset(&v, 120, sizeof(v)); // corrupting data boost::get<int>(v); // assertion "should never be here at runtime" # 2 boost::variant
* v; // uninitialized pointer boost::get<int>(*v); // assertion "should never be here at runtime"
Unfortunately the full source code is over 135K lines and I don't have a minimal example. Other strange bugs happen, so it is perfectly possible that there's some memory corruption :-( Thanks for the hint.
participants (2)
-
Antony Polukhin
-
Attila Rajmund Nohl