<?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 6.11.1: QWebEngineUrlRequestJob.requestBody() causes SIGSEGV for POST requests to custom URL schemes]]></title><description><![CDATA[<p dir="auto">PySide6 QWebEngineUrlRequestJob.requestBody() causes SIGSEGV on POST requests to custom URL schemes</p>
<p dir="auto">The crash happens immediately inside requestBody(), before accessing the returned object.</p>
<p dir="auto"><strong>MRE</strong></p>
<pre><code class="language-py">from __future__ import annotations

import sys

from PySide6 import __version__ as pyside6_ver
from PySide6.QtCore import QByteArray, QBuffer, QIODevice, QTimer, QUrl, qVersion
from PySide6.QtWebEngineCore import (
    QWebEngineUrlScheme,
    QWebEngineUrlSchemeHandler,
    QWebEngineUrlRequestJob,
    QWebEngineProfile,
)

print(f"Python: {sys.version}", flush=True)
print(f"PySide6: {pyside6_ver}", flush=True)
print(f"Qt: {qVersion()}", flush=True)

scheme = QWebEngineUrlScheme(b"mre")
scheme.setFlags(
    QWebEngineUrlScheme.Flag.SecureScheme
    | QWebEngineUrlScheme.Flag.ContentSecurityPolicyIgnored
    | QWebEngineUrlScheme.Flag.FetchApiAllowed
    | QWebEngineUrlScheme.Flag.CorsEnabled
)
scheme.setSyntax(QWebEngineUrlScheme.Syntax.Host)
QWebEngineUrlScheme.registerScheme(scheme)

from PySide6.QtWidgets import QApplication
from PySide6.QtWebEngineWidgets import QWebEngineView


class Handler(QWebEngineUrlSchemeHandler):
    def requestStarted(self, job: QWebEngineUrlRequestJob) -&gt; None:
        print(
            f"{job.requestMethod().data().decode()} {job.requestUrl().toString()}"
        )

        print("before requestBody()", flush=True)
        job.requestBody()
        print("after requestBody()", flush=True)

        buf = QBuffer()
        buf.setData(b'{"ok":true}')
        buf.open(QIODevice.OpenModeFlag.ReadOnly)
        buf.setParent(job)
        job.reply(b"application/json", buf)


app = QApplication(sys.argv)

handler = Handler()
QWebEngineProfile.defaultProfile().installUrlSchemeHandler(
    QByteArray(b"mre"), handler
)

view = QWebEngineView()
view.setHtml(
    """&lt;!DOCTYPE html&gt;
&lt;html&gt;&lt;body&gt;
&lt;p id="status"&gt;waiting...&lt;/p&gt;
&lt;script&gt;
async function run() {
  try {

    document.getElementById('status').innerText = 'POST...';
    r = await fetch('mre://test', {method: 'POST', body: '123'});
    console.log('POST OK', await r.json());
    
    //document.getElementById('status').innerText = 'GET...';
    //let r = await fetch('mre://test', {method: 'GET'});
    //console.log('GET OK', await r.json());

    document.getElementById('status').innerText = 'Both OK';
  } catch(e) {
    document.getElementById('status').innerText = e.toString();
  }
}
setTimeout(run, 1500);
&lt;/script&gt;
&lt;/body&gt;&lt;/html&gt;""",
    baseUrl=QUrl("https://example.com/"),
)
view.resize(600, 400)
view.show()

print("ready", flush=True)
QTimer.singleShot(10000, app.quit)
sys.exit(app.exec())
</code></pre>
<pre><code>/usr/bin/uv run /home/pyxiion/Projects/PxModRim/.venv/bin/python /home/pyxiion/Projects/PxModRim/mre_post_crash.py 
Python: 3.12.13 (main, Jun 11 2026, 04:03:26) [Clang 22.1.3 ]
PySide6: 6.11.1
Qt: 6.11.1
ready
POST mre://test/
before requestBody()

Process finished with exit code 139 (interrupted by signal 11:SIGSEGV)
</code></pre>
<h2>PyQT</h2>
<pre><code class="language-py">"""MRE: PyQt6 QWebEngineUrlSchemeHandler POST requestBody() crash"""
from __future__ import annotations

import sys

from PyQt6.QtCore import QByteArray, QBuffer, QIODevice, QTimer, QUrl, qVersion
from PyQt6.QtWebEngineCore import (
    QWebEngineUrlScheme,
    QWebEngineUrlSchemeHandler,
    QWebEngineUrlRequestJob,
    QWebEngineProfile,
)
from PyQt6 import QtCore

print(f"PyQt6: {QtCore.PYQT_VERSION_STR}", flush=True)
print(f"Qt: {qVersion()}", flush=True)

# Register scheme before QApplication
scheme = QWebEngineUrlScheme(b"mre")
scheme.setFlags(
    QWebEngineUrlScheme.Flag.SecureScheme
    | QWebEngineUrlScheme.Flag.ContentSecurityPolicyIgnored
    | QWebEngineUrlScheme.Flag.FetchApiAllowed
    | QWebEngineUrlScheme.Flag.CorsEnabled
)
scheme.setSyntax(QWebEngineUrlScheme.Syntax.Host)
QWebEngineUrlScheme.registerScheme(scheme)

from PyQt6.QtWidgets import QApplication
from PyQt6.QtWebEngineWidgets import QWebEngineView


class Handler(QWebEngineUrlSchemeHandler):
    def requestStarted(self, job: QWebEngineUrlRequestJob) -&gt; None:
        print(
            f"{job.requestMethod().data().decode()} {job.requestUrl().toString()}",
            file=sys.stderr, flush=True,
        )
        print("before requestBody()", file=sys.stderr, flush=True)
        body = job.requestBody()
        print("after requestBody()", file=sys.stderr, flush=True)

        if body is not None:
            print(f"  body obj: {body}", file=sys.stderr, flush=True)
            print(f"  isOpen: {body.isOpen()}", file=sys.stderr, flush=True)
            if not body.isOpen():
                body.open(QIODevice.OpenModeFlag.ReadOnly)
            raw = body.readAll().data()
            print(f"  body ({len(raw)} bytes): {raw[:200]}", file=sys.stderr, flush=True)

        buf = QBuffer()
        buf.setData(b'{"ok":true}')
        buf.open(QIODevice.OpenModeFlag.ReadOnly)
        buf.setParent(job)
        job.reply(b"application/json", buf)


app = QApplication(sys.argv)

handler = Handler()
QWebEngineProfile.defaultProfile().installUrlSchemeHandler(
    QByteArray(b"mre"), handler
)

view = QWebEngineView()
view.setHtml(
    """&lt;!DOCTYPE html&gt;
&lt;html&gt;&lt;body&gt;
&lt;p id="status"&gt;waiting...&lt;/p&gt;
&lt;script&gt;
async function run() {
  try {
    document.getElementById('status').innerText = 'GET...';
    let r = await fetch('mre://test', {method: 'GET'});
    console.log('GET OK', await r.json());

    document.getElementById('status').innerText = 'POST (empty body)...';
    r = await fetch('mre://test', {method: 'POST'});
    console.log('POST OK', await r.json());

    document.getElementById('status').innerText = 'POST (with body)...';
    r = await fetch('mre://test', {method: 'POST', body: JSON.stringify({hello:'world'})});
    console.log('POST body OK', await r.json());

    document.getElementById('status').innerText = 'All OK ✓';
  } catch(e) {
    document.getElementById('status').innerText = e.toString();
  }
}
setTimeout(run, 1500);
&lt;/script&gt;
&lt;/body&gt;&lt;/html&gt;""",
    baseUrl=QUrl("https://example.com/"),
)
view.resize(600, 400)
view.show()

print("ready", file=sys.stderr, flush=True)
QTimer.singleShot(10000, app.quit)
sys.exit(app.exec())
</code></pre>
<pre><code>/usr/bin/uv run /home/pyxiion/Projects/RimSort/.venv/bin/python /home/pyxiion/Projects/RimSort/mre_post_crash_pyqt6.py 
PyQt6: 6.11.0
Qt: 6.11.1
ready
GET mre://test/
before requestBody()
after requestBody()
  body obj: &lt;PyQt6.QtCore.QIODevice object at 0x7f251b2b6490&gt;
  isOpen: False
  body (0 bytes): b''
POST mre://test/
before requestBody()
after requestBody()
  body obj: &lt;PyQt6.QtCore.QIODevice object at 0x7f251b2b6530&gt;
  isOpen: False
  body (0 bytes): b''
POST mre://test/
before requestBody()
after requestBody()
  body obj: &lt;PyQt6.QtCore.QIODevice object at 0x7f251b2b6490&gt;
  isOpen: False
  body (17 bytes): b'{"hello":"world"}'

Process finished with exit code 0
</code></pre>
<h2>GDB bt</h2>
<pre><code>(gdb) bt
#0  0x00007ffff73723ac in ?? () from /home/pyxiion/Projects/PxModRim/.venv/lib/python3.12/site-packages/PySide6/libpyside6.abi3.so.6.11
#1  0x00007ffff73730b8 in PySide::getWrapperForQObject(QObject*, _typeobject*) () from /home/pyxiion/Projects/PxModRim/.venv/lib/python3.12/site-packages/PySide6/libpyside6.abi3.so.6.11
#2  0x00007ffff618f22c in ?? () from /home/pyxiion/Projects/PxModRim/.venv/lib/python3.12/site-packages/PySide6/QtWebEngineCore.abi3.so
#3  0x00000000018106c3 in cfunction_vectorcall_NOARGS.llvm.10372914493467373164 ()
#4  0x00000000018154f3 in _PyEval_EvalFrameDefault ()
#5  0x000000000181199a in method_vectorcall.llvm ()
#6  0x00007ffff6194c50 in ?? () from /home/pyxiion/Projects/PxModRim/.venv/lib/python3.12/site-packages/PySide6/QtWebEngineCore.abi3.so
#7  0x00007ffff6194d0a in ?? () from /home/pyxiion/Projects/PxModRim/.venv/lib/python3.12/site-packages/PySide6/QtWebEngineCore.abi3.so
#8  0x00007fffe8087dae in ?? () from /home/pyxiion/Projects/PxModRim/.venv/lib/python3.12/site-packages/PySide6/Qt/lib/libQt6WebEngineCore.so.6
</code></pre>
]]></description><link>https://forum.qt.io/topic/164940/pyside6-6.11.1-qwebengineurlrequestjob.requestbody-causes-sigsegv-for-post-requests-to-custom-url-schemes</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 04:28:08 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164940.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Jul 2026 03:34:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PySide6 6.11.1: QWebEngineUrlRequestJob.requestBody() causes SIGSEGV for POST requests to custom URL schemes on Fri, 31 Jul 2026 18:52:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pyxiion">@<bdi>PyXiion</bdi></a> Sure thing<br />
Here is the link: <a href="https://qt-project.atlassian.net/browse/PYSIDE-3409" target="_blank" rel="noopener noreferrer nofollow ugc">https://qt-project.atlassian.net/browse/PYSIDE-3409</a></p>
]]></description><link>https://forum.qt.io/post/839483</link><guid isPermaLink="true">https://forum.qt.io/post/839483</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 31 Jul 2026 18:52:04 GMT</pubDate></item><item><title><![CDATA[Reply to PySide6 6.11.1: QWebEngineUrlRequestJob.requestBody() causes SIGSEGV for POST requests to custom URL schemes on Tue, 28 Jul 2026 22:13:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> sorry, but I can't register at <a href="http://atlassian.com" target="_blank" rel="noopener noreferrer nofollow ugc">atlassian.com</a>, since I'm from Russia. Could you please report it for me?</p>
]]></description><link>https://forum.qt.io/post/839433</link><guid isPermaLink="true">https://forum.qt.io/post/839433</guid><dc:creator><![CDATA[PyXiion]]></dc:creator><pubDate>Tue, 28 Jul 2026 22:13:55 GMT</pubDate></item><item><title><![CDATA[Reply to PySide6 6.11.1: QWebEngineUrlRequestJob.requestBody() causes SIGSEGV for POST requests to custom URL schemes on Tue, 28 Jul 2026 19:08:17 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">Looks like you have found a bug. Please report it along with your example script to the <a href="https://bugreports.qt.io" target="_blank" rel="noopener noreferrer nofollow ugc">bug report system</a>.</p>
<p dir="auto">I can confirm the issue on macOS with the latest release currently available (6.11.1).</p>
]]></description><link>https://forum.qt.io/post/839432</link><guid isPermaLink="true">https://forum.qt.io/post/839432</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 28 Jul 2026 19:08:17 GMT</pubDate></item><item><title><![CDATA[Reply to PySide6 6.11.1: QWebEngineUrlRequestJob.requestBody() causes SIGSEGV for POST requests to custom URL schemes on Tue, 28 Jul 2026 04:03:40 GMT]]></title><description><![CDATA[<p dir="auto">Same crash for 6.10.1, 6.10.3, 6.11.0</p>
]]></description><link>https://forum.qt.io/post/839421</link><guid isPermaLink="true">https://forum.qt.io/post/839421</guid><dc:creator><![CDATA[PyXiion]]></dc:creator><pubDate>Tue, 28 Jul 2026 04:03:40 GMT</pubDate></item></channel></rss>