<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[PySide6 crash: NULL deref in SignalManager::retrieveMetaObject via stale QTableWidgetItem wrapper (address reuse) — 6.10.2 and 6.11.1]]></title><description><![CDATA[<p dir="auto">Environment: Windows 11, Python 3.13.11, PySide6 6.10.2 and 6.11.1 (identical behavior on both), QtWebEngine in use.</p>
<p dir="auto">Summary: A large PySide6 application hits a recurring, sporadic access violation (0xC0000005). Several independent first-chance full dumps (WinDbg/cdb) show an identical signature.</p>
<p dir="auto">Crash signature:</p>
<pre><code>0xC0000005, read at address 0x0
pyside6_abi3!PySide::SignalManager::retrieveMetaObject+0x24
  mov rcx, qword ptr [rax]     ; rax = 0
</code></pre>
<p dir="auto">PySide::retrieveMetaObject(obj) returns NULL and the result is dereferenced without a null check at +0x24.</p>
<p dir="auto">Root cause (from the dumps): the object passed in is a STALE QTableWidgetItem Python wrapper living at a reused address. QTableWidgetItem is not a QObject, so retrieveMetaObject legitimately returns NULL — but it is dereferenced unconditionally, so the process crashes. The wrapper has refcnt 1 and an empty instance <strong>dict</strong>, and a full-heap scan of the dump finds NO Python reference to it — i.e. the only holder is shiboken's wrapper cache (BindingManager). The C++ QTableWidgetItem was freed and its address later reused by a fresh QObject/QTimer allocation; the pointer map then returns the dead wrapper for the new object. This looks like the same family as shiboken issue #74 / PYSIDE-38 (unreleased association -&gt; address reuse -&gt; wrong-type wrapper).</p>
<p dir="auto">Trigger: it only reproduces on-screen, during re-entrant widget/item destruction while a QtWebEngine compositor is active (heavy page/table rebuilds right after opening a view). It is NOT reproducible headless — every normal destruction path (clear / clearContents / setRowCount / removeRow / takeItem / deleteLater / shiboken.delete) invalidates the item wrappers correctly.</p>
<p dir="auto">Second, separate finding: shiboken6.invalidate() appears to be a NO-OP on 6.11.1 (and 6.10.2). Calling it on a QTableWidgetItem (or even a QObject) leaves shiboken6.isValid() True and does not remove the binding-map entry:</p>
<pre><code>from PySide6 import QtWidgets
import shiboken6
app = QtWidgets.QApplication([])
t = QtWidgets.QTableWidget(1, 1)
t.setItem(0, 0, QtWidgets.QTableWidgetItem("x"))
it = t.item(0, 0)
shiboken6.invalidate(it)
print(shiboken6.isValid(it), it.text())   # -&gt; True x   (expected: invalidated)
</code></pre>
<p dir="auto">This matters because the natural workaround — explicitly invalidating item wrappers before destroying the table/view — is unavailable if invalidate() does nothing.</p>
<p dir="auto">Questions:</p>
<ol>
<li>Is this a known BindingManager wrapper-invalidation gap under re-entrant destruction with QtWebEngine active?</li>
<li>Is shiboken6.invalidate() expected to be a no-op in 6.11.x, or is that itself a bug? If it is a no-op, what is the supported way to force-invalidate a QTableWidgetItem wrapper before its C++ object is destroyed?</li>
<li>Should this be filed on <a href="http://bugreports.qt.io" target="_blank" rel="noopener noreferrer nofollow ugc">bugreports.qt.io</a>? I have several independent first-chance full dumps (~1.8 GB each) plus the cdb analyses available on request.</li>
</ol>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.qt.io/topic/164861/pyside6-crash-null-deref-in-signalmanager-retrievemetaobject-via-stale-qtablewidgetitem-wrapper-address-reuse-6.10.2-and-6.11.1</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Jul 2026 20:28:57 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164861.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 07 Jul 2026 03:51:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PySide6 crash: NULL deref in SignalManager::retrieveMetaObject via stale QTableWidgetItem wrapper (address reuse) — 6.10.2 and 6.11.1 on Sun, 12 Jul 2026 05:11:20 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the clarification.</p>
<p dir="auto">I understand that <code>shiboken6.invalidate()</code> is internal and that its behavior for classes with generated wrapper classes should not be treated as a separate public-API bug.</p>
<p dir="auto">I will prepare a standalone reproducer without application-specific code. The target is to demonstrate the stale <code>QTableWidgetItem</code> wrapper and native-address reuse independently of the full application. I will also include the complete native call stack in text form, showing the callers leading to <code>PySide::SignalManager::retrieveMetaObject()</code>.</p>
<p dir="auto">Once the reproducer and sanitized stack information are ready, I will file the issue in the Qt bug tracker and link the ticket here.</p>
]]></description><link>https://forum.qt.io/post/839113</link><guid isPermaLink="true">https://forum.qt.io/post/839113</guid><dc:creator><![CDATA[Mane]]></dc:creator><pubDate>Sun, 12 Jul 2026 05:11:20 GMT</pubDate></item><item><title><![CDATA[Reply to PySide6 crash: NULL deref in SignalManager::retrieveMetaObject via stale QTableWidgetItem wrapper (address reuse) — 6.10.2 and 6.11.1 on Tue, 07 Jul 2026 19:23:09 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">That's intriguing !<br />
Would it be possible for you to provide a reproducer script ?<br />
All in all, I think it's worth bringing it to the big tracker since you have proof of trigger.</p>
]]></description><link>https://forum.qt.io/post/839040</link><guid isPermaLink="true">https://forum.qt.io/post/839040</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 07 Jul 2026 19:23:09 GMT</pubDate></item><item><title><![CDATA[Reply to PySide6 crash: NULL deref in SignalManager::retrieveMetaObject via stale QTableWidgetItem wrapper (address reuse) — 6.10.2 and 6.11.1 on Tue, 07 Jul 2026 07:03:17 GMT]]></title><description><![CDATA[<p dir="auto">You can create a bug report ( see <a href="https://wiki.qt.io/Qt_for_Python/Reporting_Bugs" target="_blank" rel="noopener noreferrer nofollow ugc">https://wiki.qt.io/Qt_for_Python/Reporting_Bugs</a> ), but we would need a minimal example to reproduce. At the very least, a stack trace with function calls/source files in text form is needed to see why retrieveMetaObject() is called for a non-QObject. Generally, no guarantees can be given as to how WebEngine interacts with CPython, though.</p>
<p dir="auto">invalidate() is an internal function that should not be used; it invalidates only for classes for which no generated "wrapper class" exists (in shiboken terms), that is, classes with no virtual functions.</p>
]]></description><link>https://forum.qt.io/post/839036</link><guid isPermaLink="true">https://forum.qt.io/post/839036</guid><dc:creator><![CDATA[friedemannkleint]]></dc:creator><pubDate>Tue, 07 Jul 2026 07:03:17 GMT</pubDate></item></channel></rss>