Skip to contentSkip to conversation

New: [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player

Bug 82517 [email protected] 1 participant 10 messages Aug 12, 2014 – Aug 15, 2014

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=82517

Priority: medium
Bug ID: 82517
Assignee: [email protected]
Summary: [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from
ruvd_destroy, when closing a Tab with accelerated video player
Severity: normal
Classification: Unclassified
OS: Linux (All)
Reporter: [email protected]
Hardware: x86-64 (AMD64)
Status: NEW
Version: git
Component: Drivers/Gallium/radeonsi
Product: Mesa

Created attachment 104510
--> https://bugs.freedesktop.org/attachment.cgi?id=104510&action=edit
GDB backtrace of the crash in the VDPAU module

This is NOT bug 82428, I have the patch from attachment 104443 applied!

When closing a tab in a browser (Iceweasel/Firefox 31 in my case), that contains a Flash video player, that uses VDPAU for accelerated playback, I see the following crash:

Quoted 3 lines

Program received signal SIGSEGV, Segmentation fault.
0x00007f76ed331f57 in map_msg_fb_buf (dec=0x7f76fa66b6f0) at ../../../../../../src/gallium/drivers/radeon/radeon_uvd.c:125
125 ptr = dec->ws->buffer_map(buf->cs_handle, dec->cs, PIPE_TRANSFER_WRITE);

This takes the plugin-container process down with it. Which means it's mostly annoying.

The attached file contains a full backtrace with GDB attached to the plugin-container process.

My stack is (base: Debian Testing):
GPU: Hawaii PRO [Radeon R9 290] (ChipID = 0x67b1)
Linux: Git:~agdf5/linux:drm-next-3.17-rebased-on-fixes:fa78380797 (calls itself 3.16-rc6)
Firmware: <http://people.freedesktop.org/~agd5f/radeon_ucode/ucode.tar.gz>

Quoted 8 lines
9e05820da42549ce9c89d147cf1f8e19  /lib/firmware/updates/3.16.0-rc6-citadel/radeon/hawaii_ce.bin
c8bab593090fc54f239c8d7596c8d846  /lib/firmware/updates/3.16.0-rc6-citadel/radeon/hawaii_mc.bin
3618dbb955d8a84970e262bb2e6d2a16  /lib/firmware/updates/3.16.0-rc6-citadel/radeon/hawaii_me.bin
c000b0fc9ff6582145f66504b0ec9597  /lib/firmware/updates/3.16.0-rc6-citadel/radeon/hawaii_mec.bin
0643ad24b3beff2214cce533e094c1b7  /lib/firmware/updates/3.16.0-rc6-citadel/radeon/hawaii_pfp.bin
ba6054b7d78184a74602fd81607e1386  /lib/firmware/updates/3.16.0-rc6-citadel/radeon/hawaii_rlc.bin
11288f635737331b69de9ee82fe04898  /lib/firmware/updates/3.16.0-rc6-citadel/radeon/hawaii_sdma.bin
284429675a5560e0fad42aa982965fc2  /lib/firmware/updates/3.16.0-rc6-citadel/radeon/hawaii_smc.bin

libdrm: 2.4.56-1
LLVM: SVN:trunk/r215347 (3.6 snapshot)
libclc: Git:master/5b48f170c8
Mesa: Git:master/4c16e6a8e0 + patch from attachment 104443
DDX: Git:master/fbf575cb01 + patch from
<http://lists.x.org/archives/xorg-driver-ati/2014-August/026534.html>
X: 2:1.16.0-1 (1.16.0)

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

[Bug 82517] [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player

https://bugs.freedesktop.org/show_bug.cgi?id=82517

--- Comment #1 from Kai <[email protected]> ---
Oh, I just found another way to trigger this: open any past broadcast on Twitch with a "t" URL parameter, ie. t=3h03m48s, appended. Apparently vlVdpDecoderDestroy get's called from Flash before jumping to the target time code as well.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

[Bug 82517] [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82517

--- Comment #2 from Christian König <[email protected]> --- Can you try setting VDPAU_TRACE and VDPAU_TRACE_FILE and get me the order in which flash calls those functions?

That just sounds like flash wants to use a decoder after destroying it and we don't handle that correctly.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

[Bug 82517] [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82517

--- Comment #3 from Kai <[email protected]> --- Created attachment 104514
--> https://bugs.freedesktop.org/attachment.cgi?id=104514&action=edit
VDPAU_TRACE of the crash.

(In reply to comment #2)

Quoted 5 lines

Can you try setting VDPAU_TRACE and VDPAU_TRACE_FILE and get me the order in which flash calls those functions?

That just sounds like flash wants to use a decoder after destroying it and we don't handle that correctly.

Sure, attached you find the log (I didn't find a way to just pass those variables to plugin-container, so I passed it to the parent iceweasel process).

Steps to get that log:
1. Start Iceweasel (aka Firefox) with the environment variables
2. Open a Twitch broadcast at some point within
3. Observed crash
4. Closed Browser.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw

[Bug 82517] [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82517

--- Comment #4 from Christian König <[email protected]> --- (In reply to comment #3)

Quoted 2 lines

Created attachment 104514 [details]
VDPAU_TRACE of the crash.

That log doesn't seems to be complete, it ends in the middle of tracing a vdp_decoder_render call.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

[Bug 82517] [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82517

--- Comment #5 from Kai <[email protected]> --- Created attachment 104518
--> https://bugs.freedesktop.org/attachment.cgi?id=104518&action=edit
Full VDPAU trace and no crash, when a YouTube video is running in the background

(In reply to comment #4)

Quoted 6 lines

(In reply to comment #3)

Quoted 2 lines

Created attachment 104514 [details]
VDPAU_TRACE of the crash.

That log doesn't seems to be complete, it ends in the middle of tracing a vdp_decoder_render call.

I noticed that as well, though I forgot to mention it in my previous post, but I tried it several times and the log always ends somewhere in the middle. If you have any idea how I can capture the whole log, let me know. (Or maybe you can reproduce it on your end? Just pick one recored broadcast from Twitch, e.g.
<http://www.twitch.tv/carbotanimations/b/557380266?t=1h01m> and it should segfault)

Another observation I made: if you run a YouTube video in the backgrund in parallel to e.g. opening
<http://www.twitch.tv/carbotanimations/b/557380266?t=1h01m>, then suddenly Flash is not crashing. I traced VDPAU with a YT video running in the background and attached the file to this post.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

[Bug 82517] [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82517

Christian König <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED

--- Comment #6 from Christian König <[email protected]> --- (In reply to comment #5)

Quoted 4 lines

(Or maybe you can reproduce it on your end? Just pick one recored broadcast from Twitch, e.g.
<http://www.twitch.tv/carbotanimations/b/557380266?t=1h01m> and it should segfault)

Took me a while, but I was able to reproduce the problem and take a complete log.

Quoted 5 lines

Another observation I made: if you run a YouTube video in the backgrund in parallel to e.g. opening
<http://www.twitch.tv/carbotanimations/b/557380266?t=1h01m>, then suddenly Flash is not crashing. I traced VDPAU with a YT video running in the background and attached the file to this post.

No wonder that it crashes, what flash does here is destroying the device first and then trying to destroy the decoder who depends on the device:

vdp_device_destroy(1)
vdp_decoder_destroy(2)

Sounds like a bug in flash to me, but on the other hand the VDPAU state tracker shouldn't crash, but just return an error here.

Going to take a look into the code if we can't fix that somehow.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw

[Bug 82517] [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82517

--- Comment #7 from Christian König <[email protected]> --- Created attachment 104563
--> https://bugs.freedesktop.org/attachment.cgi?id=104563&action=edit
Possible fix.

That patch does the trick for me, please test.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

[Bug 82517] [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82517

Kai <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Kai <[email protected]> --- (In reply to comment #7)

Quoted 4 lines

Created attachment 104563 [details] [review]
Possible fix.

That patch does the trick for me, please test.

Yes, the patch works for me as well. Thank you!

Since you've already commited the patch
(<http://cgit.freedesktop.org/mesa/mesa/commit/?id=6fb42ee7a632e181160ac4be234b30e50a1b91d5>)
I don't think a Tested-by will be needed here anylonger.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw

[Bug 82517] [RADEONSI,VDPAU] SIGSEGV in map_msg_fb_buf called from ruvd_destroy, when closing a Tab with accelerated video player

In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=82517

Christian König <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED

--- Comment #9 from Christian König <[email protected]> --- Thanks for testing, sounds like we can close this now.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel