[pybsddb] berkeleydb segfaulting with Python 3.13

Jacob Henner jacobhenner at outlook.com
Wed May 14 19:06:03 CEST 2025


Upon further review, I discovered what happened here. While debugging
the data leak issue I was assessing various versions of Python 3.12 and
3.13 against both libdb 5.3 and 6.2, and at some point the
`BERKELEYDB_LIBDIR` and `BERKELEYDB_INCDIR` became mismatched such that
the former was referring to 6.2 and the latter was referring to 5.3.
After correcting the mismatch the reproducer you provided succeeds
(does not reproduce the issue) on all combinations of (3.13, 3.12) x
(5.3, 6.2), whereas before it was failing when LIBDIR and INCDIR were
misaligned.

Apologies for the noise here. I've confirmed that this instance of
operator error did not impact the assessment of the data leak issue,
and that the data leak issue is reproducible for all of (3.13, 3.12) x
(5.3, 6.2).

On Wed, 2025-05-14 at 16:59 +0200, Jesus Cea wrote:
> On 14/5/25 4:00, Jacob Henner wrote:
> > berkeleydb is segfaulting on Arch Linux amd64, with Python 3.13 and
> > either libdb 6.2.32 or libdb 5.3.28. Both Python 3.13.0 and 3.13.3
> > were 
> > confirmed to be affected. 3.12.10 is not affected.
> 
> I can't reproduce this under Ubuntu, but BerkeleyDB and Python 3.13
> are 
> self-compiled.
> 
> > Stack trace:
> > 
> > #0  0x00007a69663ced7a n/a (libc.so.6 + 0xb8d7a)
> > 
> > #1  0x00007a696637b437 n/a (libc.so.6 + 0x65437)
> > 
> > #2  0x00007a696637c1e4 n/a (libc.so.6 + 0x661e4)
> > 
> > #3  0x00007a6965e9e05a __db_errfile (libdb-6.2.so + 0x12005a)
> > 
> > #4  0x00007a6965e9e634 __db_errx (libdb-6.2.so + 0x120634)
> > 
> > #5  0x00007a6965ec98f5 __env_set_create_dir (libdb-6.2.so +
> > 0x14b8f5)
> > 
> > #6  0x00007a6965f8bbc9 DBEnv_set_lk_detect (_berkeleydb.abi3.so +
> > 0x12bc9)
> 
> This traceback is useful, thanks.
> 
> Lets try to do a minimal reproducible case. Try this code:
> 
> """
> import berkeleydb
> 
> e = berkeleydb.db.DBEnv()
> e.set_lk_detect(berkeleydb.db.DB_LOCK_DEFAULT)
> """
> 
> -- 
> Jesús Cea Avión                         _/_/      _/_/_/       
> _/_/_/
> jcea at jcea.es - https://www.jcea.es/    _/_/    _/_/  _/_/    _/_/ 
> _/_/
> Twitter: @jcea                        _/_/    _/_/         
> _/_/_/_/_/
> jabber / xmpp:jcea at jabber.org  _/_/  _/_/    _/_/          _/_/  _/_/
> "Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
> "My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
> "El amor es poner tu felicidad en la felicidad de otro" - Leibniz

-- 
Jacob Henner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.jcea.es/pipermail/pybsddb/attachments/20250514/60572a79/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.jcea.es/pipermail/pybsddb/attachments/20250514/60572a79/attachment.bin>


More information about the pybsddb mailing list