- changed status to resolved
View of containers of `UPCXX_SERIALIZED_FIELDS` crashes in deserialization
Issue #391
resolved
The following program crashes because deserialization miscalculates jump amounts when skipping over sequences of type foo
when foo's serialization is UPCXX_SERIALIZED_[FIELDS|VALUES](args...)
where all args are of trivial type.
Skipping is only instigated by views, so a vector<foo>
alone would not trip this. A view<foo>
, though also a sequence of foo, will also not trip this since view does not invoke serialization_reader::skip_sequence
for non-trivially-serializable types, but skipping a container does.
#include <upcxx/upcxx.hpp>
#include <vector>
struct foo {
char a; int b; char c;
UPCXX_SERIALIZED_FIELDS(a,b,c)
};
int main() {
upcxx::init();
std::vector<foo> data[2]{
{{'a',0xb,0xc},{0xa,'b',0xc},{0xa,0xb,'c'}},
{{'a',0xb,0xc},{0xa,'b',0xc},{0xa,0xb,'c'}}
};
upcxx::rpc(upcxx::rank_me(),
[=](upcxx::view<std::vector<foo>> v) {
foo got = (*++v.begin())[0]; // grab 0'th elt from second vector
UPCXX_ASSERT_ALWAYS(got.a=='a' && got.b==0xb && got.c==0xc);
},
upcxx::make_view(data, data+2)
).wait();
upcxx::finalize();
}
Fix is small and forthcoming.
Comments (2)
-
-
Merge pull request #230 into develop
→ <<cset 4f9292b139a0>>
- Log in to comment
Fixed issue 391
→ <<cset 98a7a259c439>>