🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.rc
Article #3669

Bug#1154542: python-msgpack: Failing autopkgtests: test/test_except.py::test_unpacker_no_refcount_underflow_after_error

#3669
From: Stuart Prescott
Date: Fri, 20 Nov 2026 06:30
84 lines
5111 bytes
Source: python-msgpack
Version: 1.2.1-3
Severity: serious
X-Debbugs-Cc: stuart@debian.org

Dear Maintainer,

The autopkgtest invocation of the upstream unittests fails for
python-msgpack. It fails both on ci.d.n with its mixed testing/unstable
setup and also locally when freshly rebuilt and then immediately run only
against packages from unstable. I've not investigated further as to why
(or how).

//---

  65s =================================== FAILURES ===================================
 65s _______________ test_unpacker_no_refcount_underflow_after_error ________________
 65s 
 65s     def test_unpacker_no_refcount_underflow_after_error() -> None:
 65s         """Regression test (CVE-2026-114613): after a failed skip(), the C
 65s         extension must not drop a stale reference to a previously returned
 65s         object (use-after-free)."""
 65s         up = Unpacker()
 65s         up.feed(packb({"a": [1, 2, 3]}, use_bin_type=True))
 65s         outer = up.unpack()
 65s         inner = outer["a"]
 65s         keep = inner  # safety reference keeping the probe object alive
 65s         gc.collect()
 65s         r1 = sys.getrefcount(inner)
 65s     
 65s         # Two nested fixarray headers then an invalid byte: skip() opens two
 65s         # containers without writing the stack slots, then fails, and the
 65s         # cleanup must not touch the stale slot left by the previous unpack().
 65s         up.feed(b"\x92\x92\xc1")
 65s         with raises(Exception):
 65s             up.skip()
 65s         gc.collect()
 65s     
 65s         assert sys.getrefcount(inner) == r1
 65s         # The parser context must be reusable afterwards: the same operation
 65s         # fails cleanly again (no corrupt-state crash), and after realigning
 65s         # past the rejected byte the unpacker resumes normally.
 65s         with raises(FormatError):
 65s >           up.skip()
 65s 
 65s test/test_except.py:216: 
 65s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 65s msgpack/fallback.py:585: in skip
 65s     self._unpack(EX_SKIP)
 65s msgpack/fallback.py:489: in _unpack
 65s     typ, n, obj = self._read_header()
 65s                   ^^^^^^^^^^^^^^^^^^^
 65s msgpack/fallback.py:396: in _read_header
 65s     self._reserve(1)
 65s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 65s 
 65s self = <msgpack.fallback.Unpacker object at 0x7f5b5e5b2030>, n = 1
 65s raise_outofdata = True
 65s 
 65s     def _reserve(self, n, raise_outofdata=True):
 65s         remain_bytes = len(self._buffer) - self._buff_i - n
 65s     
 65s         # Fast path: buffer has n bytes already
 65s         if remain_bytes >= 0:
 65s             return
 65s     
 65s         if self._feeding:
 65s             self._buff_i = self._buf_checkpoint
 65s >           raise OutOfData
 65s E           msgpack.exceptions.OutOfData
 65s 
 65s msgpack/fallback.py:367: OutOfData
 65s =========================== short test summary info ============================
 65s FAILED test/test_except.py::test_unpacker_no_refcount_underflow_after_error
 65s =================== 1 failed, 130 passed, 2 skipped in 1.77s ===================

---//

The failure above is with Python 3.14 so this is not related to the
on-going work to add Python 3.15 as a supported interpreter (but it will
get in the way of that transition at some stage).

regards
Stuart
Technical Details
Message-ID: <O1qid-d26y-1@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.samoylyk.net!gothmog.csi.it!bofh.it!news.nic.it!robomod
From: Stuart Prescott <stuart@debian.org>
Newsgroups: linux.debian.bugs.rc
Subject: Bug#1154542: python-msgpack: Failing autopkgtests: test/test_except.py::test_unpacker_no_refcount_underflow_after_error
Date: Fri, 20 Nov 2026 07:30:01 +0100
Message-ID: <O1qid-d26y-1@gated-at.bofh.it>
X-Original-To: Debian Bug Tracking System <submit@bugs.debian.org>
X-Mailbox-Line: From debian-bugs-rc-request@lists.debian.org  Fri Nov 20 06:25:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.9
Reply-To: Stuart Prescott <stuart@debian.org>, 1154542@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: stuart@debian.org, team+openstack@tracker.debian.org
X-Debian-Pr-Message: report 1154542
X-Debian-Pr-Package: src:python-msgpack
X-Debian-Pr-Source: python-msgpack
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: reportbug 13.2.0
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-rc@lists.debian.org> archive/latest/838923
List-ID: <debian-bugs-rc.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-rc/>
Approved: robomod@news.nic.it
Lines: 84
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Fri, 20 Nov 2026 17:22:33 +1100
X-Original-Message-ID: <179515575361.805707.2938311381008401321.reportbug@trochilus.nanonanonano.net>