nouveau: fix crash during fence emission
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Sun, 25 Sep 2011 14:01:19 +0000 (16:01 +0200)
committerMarcin Slusarz <marcin.slusarz@gmail.com>
Sun, 25 Sep 2011 17:18:45 +0000 (19:18 +0200)
commit65b8eea0644fdb7e9150d0e98c06d7f8ba6d5302
treeae9caf5b26b4e06bb99ad31828081b73690a0f77
parenta4d72189b271664501338cc93107845f3d40ae54
nouveau: fix crash during fence emission

Fence emission can flush the push buffer, which through flush_notify
unreferences recently emitted fence. If ref count is increased after
fence emission, unreference deletes the fence, which causes SIGSEGV.

Backtrace:
nouveau_fence_del
nouveau_fence_ref
nouveau_fence_next
nouveau_pushbuf_flush
MARK_RING
nv50_screen_fence_emit
nouveau_fence_emit
nv50_flush

This bug manifested as an assertion failure in nouveau_fence.c, because
SIGSEGV handler tried to shutdown the application and used messed up
fence.

This issue was reported by Maxim Levitsky.

Note: This is a candidate for the 7.11 branch.
src/gallium/drivers/nouveau/nouveau_fence.c