-
Notifications
You must be signed in to change notification settings - Fork 141
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
XML ubsan fixes #288
XML ubsan fixes #288
Conversation
…string This avoids an extraneous warning when running Serialization code through ubsan which flags increments to a nullptr The relevant condtional check (`++m_bnext < m_bend`) still passes with this change
There's no inheritance so static_cast'ing to a base is incorrect, instead we use reinterpret_cast with the common initial sequence to avoid ubsan failures
This change is broken and causes crashes. |
|
|
I was sort of skeptical of this change. But I didn't have the time/inclination to really investigate it so I merged it. On my local machine All tests still passed. I'll change this back to the way it was. |
Done! |
Yeah, I'd like to apologize for not vetting my changes more carefully. Initially, I was overwhelmed by the size of Serialization and how it was laid out. Going forward in the future, I'll test changes locally a bit more carefully before opening another PR. |
The XML oarchive class generates a few ubsan failures, this PR aims to fix them.
To replicate the failures on develop:
The first failure is that we're incrementing a nullptr in the
increment()
of thexml_escape
iterator because we never assignedm_bnext
to non-null.The second is a static_cast to a Base that we just replace with a reinterpret_cast, trying to utilize the common initial sequence to silence the sanitizer.
We found this in Unordered when adding Serialization support to some of our containers.