mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
Unable to add torrents in WebUI - (QTBUG-111740) #14392
Labels
No labels
Accessibility
AppImage
Bounty
Build system
CI
Can't reproduce
Code cleanup
Confirmed bug
Confirmed bug
Core
Crash
Data loss
Discussion
Docker
Documentation
Duplicate
Feature
Feature request
Feature request
Feature request
Filters
Flatpak
GUI
Has workaround
I2P
Invalid
Libtorrent
Look and feel
Meta
NSIS
Network
Not an issue
OS: *BSD
OS: Linux
OS: Windows
OS: macOS
PPA
Performance
Project management
Proxy/VPN
Qt bugs
Qt6 compat
RSS
Search engine
Security
Temp folder
Themes
Translations
Triggers
Waiting diagnosis
Waiting info
Waiting upstream
Waiting web implementation
Watched folders
WebAPI
WebUI
autoCloseOldIssue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/qBittorrent#14392
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mmith9 on GitHub (Mar 3, 2023).
qBittorrent & operating system versions
qb: release-4.5.1
os: OpenWrt 22.03.0 // mipsel_24kc // ramips/mt7621 // Xiaomi R3G
cross compiled on Linux debian 5.10.0-21-amd64 №1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux
qt: 5.15.8
lib: 1.2.18
What is the problem?
Unable to add torrents via webui - nothing happens
Console logs:
bool Http::RequestParser::parseFormData(const QByteArray&) multipart/form-data header error
Http::RequestParser::ParseResult Http::RequestParser::doParse(const QByteArray&) message body parsing error
Steps to reproduce
No response
Additional context
Investigation:
file: requestparser.cpp
line: 319
const QString headers = QString::fromLatin1(Utils::ByteArray::midView(data, 0, eohPos));
const QByteArray payload = viewWithoutEndingWith(Utils::ByteArray::midView(data, (eohPos + EOH.size()), data.size()), CRLF);
Produces corrupted output for some inputs:
Added some prints for data and headers+payload, removed return on first error and single request looks like this:
data "Content-Disposition: form-data; name="urls"\r\n\r\nPLACEHOLDER HASH LINE\r\n"
headers "Content-Disposition: form-data; name="urls""
payload "PLACEHOLDER HASH LINE"
data "Content-Disposition: form-data; name="autoTMM"\r\n\r\ntrue\r\n"
headers "Content-Disposition: form-data; name="autoTMM""
payload "true"
data "Content-Disposition: form-data; name="cookie"\r\n\r\n\r\n"
headers "Content-Disposition: form-data; name="cookie""
payload ""
data "Content-Disposition: form-data; name="rename"\r\n\r\n\r\n"
headers "Conte3t-Disponition: sorm-datn; name=drename""
payload ""
bool Http::RequestParser::parseFormData(const QByteArray&) multipart/form-data header error
data "Content-Disposition: form-data; name="category"\r\n\r\n\r\n"
headers "Content-Disposition: form-data; name="category""
payload ""
data "Content-Disposition: form-data; name="paused"\r\n\r\nfalse\r\n"
headers "Conte3t-Disponition: sorm-datn; name=dpaused""
payload "false"
bool Http::RequestParser::parseFormData(const QByteArray&) multipart/form-data header error
data "Content-Disposition: form-data; name="stopCondition"\r\n\r\nNone\r\n"
headers "Content3Disposieion: foom-data; name="stopCondi=ion""
payload "None"
bool Http::RequestParser::parseFormData(const QByteArray&) multipart/form-data header error
data "Content-Disposition: form-data; name="contentLayout"\r\n\r\nOriginal\r\n"
headers "ContentàDisposieion: foom-data; name="ctntentLa=out""
payload "Original"
bool Http::RequestParser::parseFormData(const QByteArray&) multipart/form-data header error
data "Content-Disposition: form-data; name="dlLimit"\r\n\r\nNaN\r\n"
headers "Content3Disposieion: foom-data; name="dtLimit""
payload "NaN"
bool Http::RequestParser::parseFormData(const QByteArray&) multipart/form-data header error
data "Content-Disposition: form-data; name="upLimit"\r\n\r\nNaN\r\n"
headers "Content-Disposition: form-data; name="upLimit""
payload "NaN"
--- FIX (works for me atleast)
const QString headers = QString::fromUtf8(Utils::ByteArray::midView(data, 0, eohPos));
#18630
#11701
Log(s) & preferences file(s)
No response
@glassez commented on GitHub (Mar 3, 2023):
Which particular browser do you use to access the WebUI? It would be good to reproduce this problem to make it easier to understand what is going on.
@mmith9 commented on GitHub (Mar 3, 2023):
Seems it doesn't depend on browser, just tested the following combinations, and the problem occurs in all of them:
server2008r2 - chrome, opera, firefox
debian - chromium, firefox, konqueror
raspbian - chromium
@mmith9 commented on GitHub (Mar 3, 2023):
more investigation:
It appears that if string is corrupted, it is each 8th character corrupted.
First corrupted character is 'random', but the following corrupted keep the same pattern and since all the lines start basically with same "Content-Disposition ...' it looks like corruption are linked.
Further research:
fromLatin1 in qt looks optimized for different cpu architectures, notably SSE2, this means the bug won't affect common x86 as it uses 16byte vectors.
Which is consistent with observation that bug occurs on 'no-that-common' archs
@glassez commented on GitHub (Mar 4, 2023):
So do you think it is
QString::fromLatin1()issue? Then it should definitely be reported to Qt devs.BTW, did you try Qt 6 based build?
@mmith9 commented on GitHub (Mar 4, 2023):
Nope, and it would give same error, the assembly file in qt6.4.2 is the same 2013 file with the same error.
But, nailed it.
The affected architecture would be anything using dsp extension but not dspr2.
#if defined(__mips_dspr2)
prepend t1, t2, 8
#else
sll t4, t4, 24
srl t1, t1, 8
or t1, t1, t4
#endif
Correct is sll t4, t2, 24.
I'll take it to qt devs.
@glassez commented on GitHub (Mar 5, 2023):
👍
@HanabishiRecca commented on GitHub (Mar 12, 2023):
Just mention that in #18630 I use generic x86-64 CPU and still have this issue.
@mmith9 commented on GitHub (Mar 12, 2023):
Well, let's see if it's the same issue then.
change lines 319 and 320 in requestparse to :
And tell us what comes along the error msg now
@HanabishiRecca commented on GitHub (Mar 12, 2023):
@mmith9 commented on GitHub (Mar 12, 2023):
Nope, it parses okay. The problem is elsewhere.
@HanabishiRecca commented on GitHub (Mar 12, 2023):
Thanks anyway.
@glassez commented on GitHub (Mar 13, 2023):
@HanabishiRecca
Could you also trace
headerLinesandheadersMapafter it is filled in?Unfortunately, I can't reproduce this problem on my PC to sort it out on my own.
@HanabishiRecca commented on GitHub (Mar 13, 2023):
@glassez, I went deeper and actually tracked the issue down to Qt6 libs.
I use custom Qt6 headless build for my server. Turns out Qt6 compiled with
clangwas broken somehow in this regard. Recompiled it withgccand it works now.So confirmed: this is 100% some kind of Qt bug.
@glassez commented on GitHub (Mar 13, 2023):
It would be very useful if you reported it to Qt.
@luzpaz commented on GitHub (Sep 24, 2023):
@HanabishiRecca is there an upstream ticket yet ?
@HanabishiRecca commented on GitHub (Sep 24, 2023):
No, did not reported it. Because I don't really know what exactly goes wrong, and not sure if any of build/compiler flags affect this behavior.
Also not tested it since, so I am not aware is it actually still reproducible on current Qt6 version.
@xavier2k6 commented on GitHub (Sep 25, 2023):
@mmith9 Can you reproduce with latest
Qt6.5.x& latestmastercommit? If you can & still Qt related can you file a report upstream, please.@mmith9 commented on GitHub (Sep 25, 2023):
I'd rather abstain from cross compiling qt6.5, it was bad enough with 5.15.
Anyway, there seems to be no progress on my report
https://bugreports.qt.io/browse/QTBUG-111740
Also I've downloaded latest qt source, 5.15.10 and 6.5.2 and the bug is still there.
@xavier2k6 commented on GitHub (Sep 25, 2023):
@mmith9 Thanks for the response, at least now we have a Qt Report to keep track of.