apache / incubator-graphar

An open source, standard data file format for graph data storage and retrieval.
https://graphar.apache.org/
Apache License 2.0
217 stars 46 forks source link

[Bug][C++]: Add PropertyGroup with empty property vector would make VertexInfo/EdgeInfo dump failed #392

Closed acezen closed 6 months ago

acezen commented 6 months ago

Is there an existing issue for this?

Current Behavior

terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted at 1709802400 (unix time) try "date -d @1709802400" if you are using GNU date PC: @ 0x0 (unknown) SIGABRT (@0x3f5002387ff) received by PID 2328575 (TID 0x7f043b7fe640) from PID 2328575; stack trace: @ 0x7f044ab3f046 (unknown) @ 0x7f044874f520 (unknown) @ 0x7f04487a39fc pthread_kill @ 0x7f044874f476 raise @ 0x7f04487357f3 abort @ 0x7f04489fab9e (unknown) @ 0x7f0448a0620c (unknown) @ 0x7f0448a051e9 (unknown) @ 0x7f0448a05959 gxx_personality_v0 @ 0x7f044b467e5b libunwind_Unwind_RaiseException @ 0x7f0448a064cb __cxa_throw @ 0x7f04489fa7ac (unknown) @ 0x7f0448aa3fef std::__cxx11::basic_string<>::_M_assign() @ 0x7f04473ea6e1 Yaml::ScalarImp::SetData() @ 0x7f04473e627c Yaml::Node::operator=() @ 0x7f04473b62d7 GraphArchive::EdgeInfo::Dump() @ 0x7f04473b6725 GraphArchive::EdgeInfo::Save()

Expected Behavior

Minimal Reproducible Example

auto pg = CreatePropertyGroup({}, FileType::CSV);
auto vertex_info = CreateVertexInfo("label", 100, {pg});
vertex_info->dump();

Environment

Link to GraphAr Logs

No response

Further Information

No response