Bug 437665

Summary: When switching to HTML, QtWebkit ASSERTION FAILED: resource->url() == url.string()
Product: [Applications] trojita Reporter: Stefan de Konink <stefan>
Component: CoreAssignee: Trojita default assignee <trojita-bugs>
Status: RESOLVED UPSTREAM    
Severity: normal    
Priority: NOR    
Version First Reported In: git   
Target Milestone: ---   
Platform: Other   
OS: Linux   
URL: https://bugreports.qt.io/browse/QTBUG-94015
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Stefan de Konink 2021-05-25 14:10:26 UTC
SUMMARY

When switching to HTML for a specific message I end up with a crash in QtWebkit.

Forbidden per policy: QUrl("trojita-imap://ssl.gstatic.com/ui/v1/icons/mail/icons2.png")
ASSERTION FAILED: resource->url() == url.string()
/var/tmp/portage/dev-qt/qtwebkit-5.212.0_pre20200309-r1/work/qtwebkit-5.212.0-alpha4/Source/WebCore/loader/cache/CachedResourceLoader.cpp(625) : WebCore::CachedResourceHandle<WebCore::CachedResource> WebCore::CachedResourceLoader::requestResource(WebCore::CachedResource::Type, WebCore::CachedResourceRequest&)
Comment 1 Jan Kundrát 2021-05-25 14:17:55 UTC
Since you're on Gentoo, a rebuild should be possible. Can you patch https://github.com/qtwebkit/qtwebkit/blob/qtwebkit-5.212.0-alpha4/Source/WebCore/loader/cache/CachedResourceLoader.cpp#L625 so that it prints out both resource->url() and url.string()? This could be a new webkit disliking our `data:` URL scheme, but that part of Trojita has not been modified for years...
Comment 2 Stefan de Konink 2021-05-25 14:26:48 UTC
Sure but Webkit takes a while to recompile ;) I'm on it.
Comment 3 Jan Kundrát 2021-05-25 14:50:03 UTC
If you've got debug symbols (and if these variables have not been optimized away), setting up a breakpoint and printing them via the debugger (perhaps via something insane like foo.url().string().data()) might do the trick as well, but it usually won't do that for me.
Comment 5 Jan Kundrát 2021-05-25 19:42:26 UTC
That looks like a bug in webkit, then. I was afraid that perhaps there was something on our part, passing back a QNetworkReply with a different URL or something, but this probably is straight from a QNetworkAccessManager, I think. Anyway, I just don't think this is a bug in Trojita. Thanks for the quick turnaround with details, and feel free to Cc me on a bugreport upstream in case they need help carving out a reproducer basd on Trojita's code -- but you can probably just as well save the HTML message, load that via a QtWebkit widget thingy, and watch it crash. Or if that URL is in a non-HTML part, perhaps in a stylesheet in another MIME part, that might be harder to debug.
Comment 6 Stefan de Konink 2021-05-25 21:09:08 UTC
Thanks Jan, added the upstream URL.