Closed romankspb closed 12 months ago
Same thing here
Edit: Here it works again, did they solve it?
Protocol error means that Qt or mesa and your compositor haven't agreed between each other...
Version 4.9.5 work fine, problem on 4.9.6 still persist
tdesktop doesn't talk to Wayland directly so I'm not sure anything could be done on tdesktop level
Considering that 4.9.5 works, you can still do something on tdesktop level :)
I'm not sure what we can do? Your log just says protocol error and that's it. I can't reproduce. Maybe you got a system update with a new bug in mesa.
I am using 4.9.6, possibly it has worked when I turned on the Advanced > Experimental settings > External video player
, which I currently turned off and it still works.
Maybe the client has detected your OpenGL is broken and disabled it. Check whether OpenGL works in the log.txt.
No, I haven't updated my system. I just updated tdesktop to 4.9.6. Nothing more
@romankspb so far I believe you should report to Qt, mesa or GNOME. Not sure where exactly, I guess you have to look at your compositor's log for a better error.
I have same bug experience when playing video
❯ ~/Downloads/Telegram/Telegram
QPainter::begin: Paint device returned engine == 0, type: 2
QWidget::render: Cannot render with an inactive painter
qt.core.qobject.connect: QObject::connect: No such signal QPlatformNativeInterface::systemTrayWindowChanged(QScreen*)
qt.gui.imageio.jpeg: Corrupt JPEG data: premature end of data segment
(Telegram:8845): Gtk-WARNING **: 00:06:53.557: Theme parsing error: <data>:1:0: Expected a valid selector
qt.gui.imageio.jpeg: Corrupt JPEG data: premature end of data segment
qt.gui.imageio.jpeg: Corrupt JPEG data: premature end of data segment
qt.gui.imageio.jpeg: Corrupt JPEG data: premature end of data segment
[libvpx-vp9 @ 0x7f40d4465000] v1.11.0
[libvpx-vp9 @ 0x7f40d4465000] v1.11.0
[libvpx-vp9 @ 0x7f40d4465400] v1.11.0
[libvpx-vp9 @ 0x7f40d4465400] v1.11.0
The Wayland connection experienced a fatal error: Protocol error
And starting video chat or audio call
❯ ~/Downloads/Telegram/Telegram
QPainter::begin: Paint device returned engine == 0, type: 2
QWidget::render: Cannot render with an inactive painter
qt.core.qobject.connect: QObject::connect: No such signal QPlatformNativeInterface::systemTrayWindowChanged(QScreen*)
(Telegram:9060): Gtk-WARNING **: 00:07:03.129: Theme parsing error: <data>:1:0: Expected a valid selector
qt.gui.imageio.jpeg: Corrupt JPEG data: premature end of data segment
The Wayland connection experienced a fatal error: Protocol error
The crashes started happens after update Telegram to 4.9.6 version and continued on 4.9.7 version. Please check working of Telegram application on Fedora Rawhide.
I'm not sure what we can do? Your log just says protocol error and that's it. I can't reproduce. Maybe you got a system update with a new bug in mesa.
I am 200% sure that the telegram update is to blame
in /etc/gdm3/custom.conf uncomment WaylandEnable=false this helped
this is a funny one because videos actually play fine. the issue is when you open first a video it crashes. try this:
1) open a photo 2) then open a video (it will play fine) 3) in that session opening videos will work 4) leave app and re-open try opening a video first, crash again
let me know if this works for people commented here.
I am 200% sure that the telegram update is to blame
Without a more verbose error, a way for contributors to reproduct (sorry, I still can't reproduce that in a VM, perhaps that's hardware-dependent) or a bisection by someone affected to find the offending commit, I don't think anything could be done
Fedora 38, Telegram 4.9.7, the same error
Fedora 38, Telegram 4.9.7, the same error
It fixed after set WaylandEnable=false in /etc/gdm/custom.conf and reboot thanks @sbrener1610
Without a more verbose error, a way for contributors to reproduct (sorry, I still can't reproduce that in a VM, perhaps that's hardware-dependent) or a bisection by someone affected to find the offending commit, I don't think anything could be done
I don't know what are you mean by verbose error
, but I recorded video which prove that downgrade Telegram helps workaround this issue: https://youtu.be/Xn8VUCCjWCI
I don't know what are you mean by
verbose error
I mean something more detailed than just 'protocol error'
I mean something more detailed than just 'protocol error'
Can you guide me? Or maybe exist step by step instruction?
Can you guide me? Or maybe exist step by step instruction?
I have no idea how to get a better error, sorry. Help on this from the community would be highly appreciated.
I made trace file before switching to WaylandEnable=false
strace -o telegram.trace -v -f -s 1024 ./Telegram
Maybe some from the trace file could be useful ?
For example
11278 futex(0x7fde7e915274, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, FUTEX_BITSET_MATCH_ANY <unfinished ...>
11305 recvmsg(9, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\1\0\0\0\0\0<\0E\0\0\0\0\0\0\0%\0\0\0exported surface had an invalid role\0\0\0\0", iov_len=1768}, {iov_base="", iov_len=2328}], msg_iovlen=2, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_CMSG_CLOEXEC) = 60
11305 futex(0x7fde7e915274, FUTEX_WAKE_PRIVATE, 2147483647 <unfinished ...>
11278 <... futex resumed>) = 0
11305 <... futex resumed>) = 1
11305 write(2, "The Wayland connection experienced a fatal error: Protocol error\n", 65 <unfinished ...>
11278 futex(0x7fde7e915218, FUTEX_WAKE_PRIVATE, 1) = 0
11305 <... write resumed>) = 65
11305 exit_group(1 <unfinished ...>
strace shows kernel syscalls what is completely useless given that this doesn't seem to be a bug with kernel syscalls
That seem to a bug with communicating between Qt and compositor so perhaps compositor logs may have an evidence. Although this may require enabling some debug logging on compositor side and how to enable it only your compositor devs know...
The best way is for someone affected to do git bisect
on Telegram sources and find the commit that added the bug. That would perhaps be the fastest way to the fix.
The same issue (crash on joining/starting a video call or opening video) started happening for me after the Telegram update. I'm not on Qt (i confused Qt with KDE here), but also using Wayland (swaywm/wlroots). Unfortunately I can't git bisect right now, but can try later tonight.
video call? hm, video call and media viewer are using opengl so I wonder whether disabling opengl helps?
Disabling OpenGL doesn't help, sadly. I also confirmed that the issue was introduced between Telegram 4.9.5 (works) and 4.9.6 (doesnt work).
Have you restarted the client after disabling OpenGL?
Yes, as prompted
Out of the 4.9.5 -> 4.9.6 commits only a few touch wayland-related code, the main suspect being this sumbodule update: https://github.com/telegramdesktop/tdesktop/commit/289257dd0f2642901cacf52ae91ed21731611233
Maybe someone who has the issue can try building before and after this commit to see if it's it?
There's only a call to xdg_toplevel_show_window_menu on right click at titlebar and xdg-decoration check on application startup. There's no custom Wayland code on window open afaik, so it should be some change in high-level code that triggers some bug in Qt. So it could be literally any commit.
Not strictly relevant to Telegram, but relevant to this issue: since about the same time (can't say exactly) screenshare in all other programs has broken for me as well. I can't screenshare in chrome/firefox etc. Might be a coincidence though.
How can we get what protocol error exactly happens? I guess answering that question would simplify things a lot.
Building in debug mode and setting a breakpoint might give more details that are not printed to stdout?
Where would you set breakpoint though?
Whereever the error is printed and then track it back from there.
I don't think we can get something helpful with a breakpoint from here? It writes the line from the event loop, not where the error actually happens. https://github.com/qt/qtwayland/blob/v6.5.2/src/client/qwaylanddisplay.cpp#L75
I see. Then I guess we need some debug options in wayland/qt/qtwayland/compisotor etc? Like WAYLAND_DEBUG=1
Launching Telegram with WAYLAND_DEBUG=1
works and prints this (only showing the last few messages):
[2614717.648] -> zwp_idle_inhibit_manager_v1@47.create_inhibitor(new id zwp_idle_inhibitor_v1@62, wl_surface@28)
[2614717.762] -> zxdg_exporter_v2@43.export_toplevel(new id zxdg_exported_v2@45, wl_surface@28)
[2614717.764] -> wl_display@1.sync(new id wl_callback@67)
[2614717.805] wl_display@1.error(zxdg_exporter_v2@43, 0, "surface must be an xdg_surface")
The Wayland connection experienced a fatal error: Protocol error
Yeah, try running with that
Full log of me opening telegram 4.9.6, clicking on a dialog and pressing the "call" button wayland_debug.log
The offending line zxdg_exporter_v2@33.export_toplevel(new id zxdg_exported_v2@35, wl_surface@66)
looks suspiciosly like the commit you mentioned "xdg_toplevel_show_window_menu"
No, it's nowhere related. That's Qt's QWaylandXdgSurface::externWindowHandle() which is used for portal communicaion.
Looks like display sleep inhibition is created before native window is fully created. Apparently it was silently not working before on Wayland but now it started crashing for some reason.
Since you can't reproduce the issue, how do we verify that the fix is working? Would you like me to build from source and test once it's pushed?
If you can test from sources then yes. If you can't then probably pushing updates with fix attempts until we find the right fix.
I can build fine. I just couldn't do git bisect to find the issue since each build takes 10+ minutes on my machine, and it's the middle of a workday.
Try this then: https://github.com/desktop-app/lib_base/pull/213
Not sure it would help though, I actually fail to understand how that happens. The error looks like inhibitor creation happens after this line but before this line, that's impossible given that all this code is in one function.
If it won't help then I guess we have to unimplement display sleep prevention on Wayland in order to fix the crash.
Ok, I'm like 20 minutes into compiling Qt, will report back as soon as I can
Steps to reproduce
Expected behaviour
Playing video
Actual behaviour
Telegram Desktop application hang with error message
The Wayland connection experienced a fatal error: Protocol error
Operating system
Fedora release 38 (Thirty Eight)
Version of Telegram Desktop
4.9.6
Installation source
Static binary from official website
Crash ID
No response
Logs