Opened 11 years ago

Closed 11 years ago

#6036 closed defect (fixed)

Xlib: unexpected async reply (sequence 0x2b)!

Reported by: Ben Dailey <ben@…> Owned by: danielk
Priority: major Milestone: 0.22
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

After the mythtv-vid merge r19417 playing back almost all recording causes the front end to hang with error: Xlib: unexpected async reply (sequence 0x2b)! from my research this is a threading issue. r19416 does not demonstrate this issue. If I run mythfrontend under gdb the lock up does not occur also running with "-v all" seems to cause the issue not occur as well. Command run is "exec /usr/bin/mythfrontend -l /var/log/mythtv/frontend.log -v important,general,playback,libav"

MythTV Version : 19417M
MythTV Branch : trunk
Library API : 0.22.20081222-1
Network Protocol : 43
QT Version : 4.4.2
Options compiled in:

linux debug using_alsa using_backend using_dvb using_frontend using_mheg using_opengl_video using_opengl_vsync using_qtwebkit using_x11 using_xrandr using_xv using_xvmc using_xvmc_opengl using_bindings_perl using_bindings_python using_opengl using_ffmpeg_threads using_mheg using_xvmc_pbuffer

Attached: configure output, frontend log, and gdbcommands files I tried to use for debug. Please let me know how I can help or what other information would be helpful.

Attachments (16)

mythtvconfigure.txt (1.7 KB) - added by Ben Dailey <ben@…> 11 years ago.
frontend.log (7.1 KB) - added by Ben Dailey <ben@…> 11 years ago.
gdbcommands (287 bytes) - added by Ben Dailey <ben@…> 11 years ago.
gdb.txt (38.9 KB) - added by Ben Dailey <ben@…> 11 years ago.
gdb.frontend.log (10.9 KB) - added by Ben Dailey <ben@…> 11 years ago.
gdb_no_openglvsync.txt (20.3 KB) - added by Ben Dailey <ben@…> 11 years ago.
frontend_no_openglvsync.log (7.9 KB) - added by Ben Dailey <ben@…> 11 years ago.
gdb_openglvsync.txt (20.3 KB) - added by Ben Dailey <ben@…> 11 years ago.
frontend_openglvsync.log (7.1 KB) - added by Ben Dailey <ben@…> 11 years ago.
6036-dbg-v1.patch (520 bytes) - added by danielk 11 years ago.
debugging patch
6036-dbg-v2.patch (2.8 KB) - added by danielk 11 years ago.
Another debugging patch
6036-dbg-v3.patch (6.3 KB) - added by danielk 11 years ago.
updated version
gdb_v3patched.txt (96.0 KB) - added by Ben Dailey <ben@…> 11 years ago.
frontend_v3patched.log (7.1 KB) - added by Ben Dailey <ben@…> 11 years ago.
frontend_r19580.log (6.8 KB) - added by Ben Dailey <ben@…> 11 years ago.
unexpected async reply log
gdb_r19580.txt (79.5 KB) - added by Ben Dailey <ben@…> 11 years ago.
unexpected async reply backtrace

Download all attachments as: .zip

Change History (38)

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: mythtvconfigure.txt added

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: frontend.log added

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: gdbcommands added

comment:1 Changed 11 years ago by eric.bosch@…

I am experiencing the same thing... It is not consistent, I am having the same failure about 50% of the time, but I can't identify any specific conditions that cause it.

comment:2 Changed 11 years ago by danielk

Milestone: unknown0.22
Owner: changed from Isaac Richards to danielk
Status: newassigned

Do you have OpenGL V-Sync enabled? Does the problem go away when you disable it?

comment:3 Changed 11 years ago by Ben Dailey <ben@…>

I have tried with both OpenGL V-Sync enabled and disabled in Playback settings with the same results. I haven't tried with it disabled as a configure switch. I would it be helpful to disable it before building?

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: gdb.txt added

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: gdb.frontend.log added

comment:4 Changed 11 years ago by eric.bosch@…

I have just experienced this same error during dvd playback except it was sequence 0x32

comment:5 Changed 11 years ago by danielk

(In [19506]) Refs #6036. Adds X11 lock in 3 instances which were overlooked.

comment:6 Changed 11 years ago by danielk

Ben, please try the latest sources before trying to disable it at compile time. I found three other problems in the code which could result in an async reply (other than the known problem when using V-Sync.) One of them would be applicable in your setup.

BTW The first log is missing at least one line of debug output. If it was cut-n-pasted from the console, it's possible the Xlib error message overwrote it, if it was logged to a file, the missing line could be a clue...

comment:7 Changed 11 years ago by Ben Dailey <ben@…>

OK after much more testing and trying to come up with a reliable way to reproduce the problem I think I may have some hints or at least observations. I can confirm for with absolute certainty that the problem occurs with and with out opengl vsync turned on at run time. I was able to come up with backtraces for opengl vsync on and off. I have attached the logs and backtraces (Actual files no copy and paste). OK observations: No reliable way to reproduce, but I would startx, then launch gdb and run mythtfrontend. As soon as the frontend started I would connect via telnet and issue "jump livetv".

Every time I got the "Xlib: unexpected async reply (sequence 0x2b)!" error message and the frontend would hang the following message was always missing from the log output: "VDP: LoadBestPreferences?(1920x1088, 29.97)"

Please include all output in bug reports.
MythTV Version : 19512
MythTV Branch : trunk
Library API : 0.22.20081222-1
Network Protocol : 43
QT Version : 4.4.2
Options compiled in:

linux debug using_alsa using_backend using_dvb using_frontend using_mheg using_opengl_video using_opengl_vsync using_qtwebkit using_x11 using_xrandr using_xv using_xvmc using_xvmc_opengl using_bindings_perl using_bindings_python using_opengl using_ffmpeg_threads using_mheg using_xvmc_pbuffer

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: gdb_no_openglvsync.txt added

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: frontend_no_openglvsync.log added

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: gdb_openglvsync.txt added

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: frontend_openglvsync.log added

comment:8 Changed 11 years ago by Mitch

I'm facing the same errors. I haven't either found a way to easily reproduce and i need to start the frontend several times after which at some random time it will start successfully. Please let me know if there is some way to assist in debugging this. I'm not using opengl with vsync or even menu rendering.

Changed 11 years ago by danielk

Attachment: 6036-dbg-v1.patch added

debugging patch

comment:9 Changed 11 years ago by danielk

Ben, can you tell me if the attached patch has any effect?

comment:10 Changed 11 years ago by eric.bosch@…

Sorry to jump in here, but I've tested this patch. It does seem to eliminate the problem after several tests. I am continuing to test and will let you know if I have a recurrence of the lock.

comment:11 Changed 11 years ago by anonymous

After applying the attached patch I can no longer recreate the unexpected async reply. Thanks.

comment:12 Changed 11 years ago by Ben Dailey <ben@…>

Sorry that last comment was from me (Ben).

Changed 11 years ago by danielk

Attachment: 6036-dbg-v2.patch added

Another debugging patch

Changed 11 years ago by danielk

Attachment: 6036-dbg-v3.patch added

updated version

comment:13 Changed 11 years ago by danielk

(In [19573]) Refs #6036. Some additional X11 locking.

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: gdb_v3patched.txt added

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: frontend_v3patched.log added

comment:14 Changed 11 years ago by danielk

(In [19574]) Refs #6036. Revert [19573], I'll apply more conservative version of this later.

comment:15 Changed 11 years ago by danielk

(In [19575]) Refs #6036. Revert part of [19574], some extra stuff snuck in to the previous revert.

comment:16 Changed 11 years ago by danielk

(In [19576]) Refs #6036. Fixes a bug spotted in gdb_v3patched.txt

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: frontend_r19580.log added

unexpected async reply log

Changed 11 years ago by Ben Dailey <ben@…>

Attachment: gdb_r19580.txt added

unexpected async reply backtrace

comment:17 Changed 11 years ago by Mitch

Todays SVN is still facing this problems so i'm assuming these patches never went in ? I'm still using version 1 patch above succesfully as it's the easiest to apply and doesn't affect any other files when i'm doing daily SVN pulls.

comment:18 Changed 11 years ago by danielk

Status: assignedinfoneeded

Ben, it looks like in the latest backtrace the problem is originating within the nvidia OpenGL driver. What driver version and hardware are you using?

comment:19 Changed 11 years ago by danielk

(In [19633]) Refs #6036. Removing MythApplication? class, it didn't function as intended and so just acts as cruft.

comment:20 Changed 11 years ago by danielk

(In [19634]) Refs #6036. Temporary fix for playback startup problem.

This slows down playback startup if you are using the Qt paint engine for MythUI hand have compiled in either opengl-video playback or opengl vsync and is an ineligant fix, but it does appear to address the X Async Reply playback startup problem for those affected.

comment:21 Changed 11 years ago by Ben Dailey <ben@…>

(--) PCI:*(1:0:0) nVidia Corporation NV34 FX 5200? rev 161, Mem @ 0xfd000000/24, 0xe8000000/27, BIOS @ 0xfe9e0000/17 (II) Module glx: vendor="NVIDIA Corporation" (II) NVIDIA GLX Module 173.14.15 Fri Oct 31 16:29:34 PST 2008 (II) LoadModule?: "nvidia"

I have seen no issues since changeset 19634.

Thanks, Ben

comment:22 Changed 11 years ago by danielk

Resolution: fixed
Status: infoneededclosed
Note: See TracTickets for help on using tickets.