]> git.ipfire.org Git - thirdparty/pdns.git/commit
lmdb: be sure to abort pending transactions in the correct order. 15175/head
authorMiod Vallat <miod.vallat@powerdns.com>
Wed, 19 Feb 2025 08:54:43 +0000 (09:54 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Wed, 19 Feb 2025 08:54:43 +0000 (09:54 +0100)
commit7b5e66a823785569c0c5b4bd6defaa02a34a2b1d
tree7d8e35a4500f39cdc487e5d5046a21dca77dfbd5
parent085f2db842deec723a97c3c9afdfd3cf7ff46171
lmdb: be sure to abort pending transactions in the correct order.

If the LMDBBackend destructor is invoked while there are still pending
transactions, these need to be aborted, but in the reverse order of
their creation (i.e. abort the innermost transaction first).

The default destructor would abort them in a class field
declaration-dependent order, which may not match the actual cinematic.

We now remember which transaction is the innermost one, so that we can
abort them in the expected order.

This gets rid of "double free or corruption (top)" aborts with glibc,
and Address Sanitizer errors.
modules/lmdbbackend/lmdbbackend.cc
modules/lmdbbackend/lmdbbackend.hh