-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a exception during De-Serialize #8
Comments
I have a similar issue but with a value error.
@vishwabmc Have you solved this ? |
Hi all, |
Got exactly the same issue, any solutions? |
@guozhizou This happened in phosphor-logging code? |
Not phosphor-logging but similar situation with USCiLab/cereal#192 |
On newer libstdc++ implementations, the following backtrace is observed: ``` #2 0x00007ffff7a578b7 in abort () from /usr/lib64/libc.so.6 #3 0x00007ffff7cda2af in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) () from /usr/lib/gcc/x86_64-pc-linux-gnu/14/libstdc++.so.6 #4 0x000055555556ac6f in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::front (this=0x7fffffffd790) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:1315 #5 std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::front (this=0x7fffffffd790) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.h:1315 #6 openpower::pels::src::FRUIdentity::setPartNumber (this=this@entry=0x7fffffffd8a0, partNumber="") at ../extensions/openpower-pels/fru_identity.cpp:216 #7 0x000055555556ae12 in openpower::pels::src::FRUIdentity::FRUIdentity (this=this@entry=0x7fffffffd8a0, partNumber="", ccin="", serialNumber="") at ../extensions/openpower-pels/fru_identity.cpp:102 #8 0x0000555555562aaf in testHWCallout (pn="", ccin="", sn="", expectedPN="", expectedCCIN="", expectedSN="") at ../test/openpower-pels/fru_identity_test.cpp:97 #9 0x00005555555645b0 in FRUIdentityTest_CreateHardwareCalloutTest_Test::TestBody (this=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/basic_string.tcc:242 ``` Fix this by avoiding accessing `front()` when the part number string is empty. While there, do a minor performance optimization to avoid unnecessary string copies, by using `erase` instead of `substr`. Signed-off-by: Patrick Williams <[email protected]> Change-Id: I71cc195596def6ad0cd982e7294e2467beee987c
While trying to De-Serialize a Non-versioned Cereal object from a versioned Cereal code, saw that it raised
std::length_error
exception as opposed to a CerealException and that is indicating an issue in the code that handles the vectors. May be association ?See : USCiLab/cereal#192
The text was updated successfully, but these errors were encountered: