Removed a rare case of SIGSEGV from ydb_incr_s() / ydb_incr_st()
Final Release Note
ydb_incr_s()
/ydb_incr_st()
work correctly when operating on a local variable node. In r1.30, it was possible in rare cases for them to fail with a segmentation violation (SIGSEGV / SIG-11) owing to a regression in the code for [#594 (closed)]. This was only encountered in a development environment and not reported by a user. [#633 (closed)]
Description
This issue was observed first in YDBOcto (see YottaDB/DBMS/YDBOcto#587 (closed) for more details). There are 2 issues captured there. The first one is a YDB issue. The relevant text is pasted below and is tracked now in the YDB repo.
- YDB issue :
ydb_incr_s.c
was modified as part of 623dc00d to do as2pool()
invocation on the return value ofop_add()
. While this is the right thing to do in case the mval returned byop_add()
has theMV_STR
bit set, it is not the right thing to do in case the mval does not have theMV_STR
bit set. Invokings2pool()
on an mval that represents a pure number (MV_INT
orMV_NM
bits are set butMV_STR
bit is not set in themvtype
member) implies we could be looking at garbage values instr.len
andstr.addr
and trying to move that to the stringpool which could cause a SIG-11.
Draft Release Note
ydb_incr_s()
/ydb_incr_st()
work correctly when passed an lvn (local variable node). Previously, due to a regression in #594 (closed), it was possible in rare cases for them to fail with a SIG-11 due to accessing garbage memory locations. [#633 (closed)]