[stable-1.8] Ubsan fixes#1114
Conversation
On tests listed bellow the reserve method is being called before any allocation on the object therefore realloc being called without any previous allocation. Inside realloc _data is being used with the operator '[]', as it is nullptr at that moment it's an undefined behaviour. This patch simply returns a call to alloc if _data is nullptr. This tests fails on PowerPC with Segmentation Fault because of this issue: segment_vector_array_expsize_assign_exceptions_oom_0_none segment_vector_array_expsize_assign_exceptions_oom_0_memcheck segment_vector_array_expsize_capacity_exceptions_oom_0_none segment_vector_array_expsize_capacity_exceptions_oom_0_memcheck segment_vector_array_expsize_modifiers_exceptions_oom_0_none segment_vector_array_expsize_modifiers_exceptions_oom_0_memcheck segment_vector_vector_expsize_assign_exceptions_oom_0_none segment_vector_vector_expsize_assign_exceptions_oom_0_memcheck segment_vector_vector_expsize_capacity_exceptions_oom_0_none segment_vector_vector_expsize_capacity_exceptions_oom_0_memcheck segment_vector_vector_expsize_modifiers_exceptions_oom_0_none segment_vector_vector_expsize_modifiers_exceptions_oom_0_memcheck segment_vector_vector_fixedsize_assign_exceptions_oom_0_none segment_vector_vector_fixedsize_assign_exceptions_oom_0_memcheck Signed-off-by: Lucas A. M. Magalhães lamm@linux.ibm.com
lukaszstolarczuk
left a comment
There was a problem hiding this comment.
Reviewed 1 of 1 files at r2.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @igchor)
Codecov Report
@@ Coverage Diff @@
## stable-1.8 #1114 +/- ##
==============================================
- Coverage 92.18% 92.16% -0.02%
==============================================
Files 34 34
Lines 3658 3665 +7
==============================================
+ Hits 3372 3378 +6
- Misses 286 287 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This fixes following tests under UBSAN: vector_modifiers_type_requirements_0_none vector_parameters_0_none They failed with following error message: "runtime error: reference binding to null pointer of type" This fix is continuation of 41ddc88
karczex
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! all files reviewed, all discussions resolved (waiting on @igchor)
This change is