quotient-im / Quaternion

A Qt-based IM client for Matrix
https://matrix.org/ecosystem/clients/quaternion/
GNU General Public License v3.0
645 stars 108 forks source link

Click on a room in the room list crashes client #265

Closed TurBoss closed 6 years ago

TurBoss commented 6 years ago

Hello:

If I click on a room in the room list Quaternion stops working

ASSERT failure in splitMediaId: "mediaId should have a form 'serverName/localMediaId' (without apostrophes)", file /home/turboss/Sources/Quaternion/lib/connection.cpp, line 306
Aborted (core dumped)

Thanks

TurBoss commented 6 years ago

only happends on #lain:matrix.org , #quaternion:matrix.org

KitsuneRal commented 6 years ago

May I ask you to share the stacktrace for the coredump? Looks quite puzzling why anything happened on double-clicking the room avatar at all - it's not handled (not yet, at least).

TurBoss commented 6 years ago

Hello:

How can I give you this logs?

Thank you

TurBoss commented 6 years ago
libqmatrixclient.jobs: "GetContentThumbnailJob" status 100 : "Error transferring https://springrts.com/_matrix/media/r0/thumbnail/atauno.com/arTKTcpxTBsoESxJARrukaSE?width=25&height=25 - server replied: Bad Gateway"
libqmatrixclient.jobs: "GetContentThumbnailJob" will take retry 1 in 5 s
ASSERT failure in splitMediaId: "mediaId should have a form 'serverName/localMediaId' (without apostrophes)", file /home/turboss/Sources/Quaternion/lib/connection.cpp, line 306
The program has unexpectedly finished.
The process was ended forcefully.
/home/turboss/Sources/build-Quaternion-Desktop_Qt_5_10_0_GCC_64bit-Default/quaternion crashed.
KitsuneRal commented 6 years ago

That's quite enough (for better or worse). Sorry for inconvenience; apparently, the freshly committed code is broken.

TurBoss commented 6 years ago

Thank you so much for the quick reply and fixes

ptman commented 6 years ago

I just got this with 2973b0b8b8a7196f1735a65f5a93929811058b99

KitsuneRal commented 6 years ago

@ptman, same request as above - can you put here last 10 lines of logs?

ptman commented 6 years ago

Sure:

qrc:///qml/chat.qml:13:50: Unable to assign [undefined] to bool
libqmatrixclient.jobs: "GetContentThumbnailJob" stopped without ready network reply
ASSERT failure in splitMediaId: "mediaId should have a form 'serverName/localMediaId' (without apostrophes)", file Quaternion/lib/connection.cpp, line 306
zsh: abort      ./quaternion

Channel is #_ircnet_#matrix-irc:irc.snt.utwente.nl

KitsuneRal commented 6 years ago

Hm, this time it doesn't tell a lot (but thanks for revealing another non-critical issue in QML). But I'll try to shake it a bit more.

ptman commented 6 years ago

Do you get the same behaviour if you join that room?

KitsuneRal commented 6 years ago

Just joined it without problems. Can you share first 20 lines of the coredump backtrace?

KitsuneRal commented 6 years ago

Ok, I can figure in theory why you might get a crash - please update to eb1c751467cb76dd7d303b908ef9ff651390f3a4 and check again. If it still crashes, I'd still appreciate a backtrace.

ptman commented 6 years ago

Still crashes =(

qrc:///qml/chat.qml:13:50: Unable to assign [undefined] to bool
ASSERT failure in splitMediaId: "mediaId:matrix.org/_matrix/content/QGtlZ2FuOm1hdHJpeC5vcmcgZMiBXLrEZiQnSvyXcrdautg.aW1hZ2UvanBlZw==.jpegdoesn't look like "serverName/localMediaId"", file Quaternion/lib/connection.cpp, line 307
zsh: abort      ./quaternion
KitsuneRal commented 6 years ago

Can you get a backtrace from the coredump?

KitsuneRal commented 6 years ago

Just a sidenote: judging by the URL instead of mediaId passed to this function, there's an attempt to fetch from the content repo by direct link. This is not how Matrix Client-Server API is supposed to work so there's either a bug somewhere or a validation missing at an earlier stage. Unfortunately, without a backtrace it's very hard to figure where this URL comes from.

ptman commented 6 years ago

Ah, I had defaulted to no core dumps. Does this help? How would I build with more debug info? backtrace.txt

KitsuneRal commented 6 years ago

Just what's needed, thanks.

KitsuneRal commented 6 years ago

Ok, this is due to me not reading the spec properly. Indeed using direct links is not forbidden, so Quaternion should support it.

KitsuneRal commented 6 years ago

Upon further investigation - looks like direct links are still frowned upon; moreover, that particular URL (of someone's avatar) leads to a 404. So the easy solution for this particular case would be to simply ignore the incorrect link (without crashing, of course). I guess, the library should support direct links as a special case; Quaternion shouldn't.

KitsuneRal commented 6 years ago

@ptman, try again with the latest master of the lib (or take Quaternion master, and update submodules in it) - the above commit should fix your crash.

ptman commented 6 years ago

yay, no longer crashes, thanks!

KitsuneRal commented 6 years ago

@ptman - just in case, if you don't see avatars anymore, please update again and clean the Quaternion cache. Sorry for inconvenience but the previous fix was incorrect.