Bug 102502 - [bisected] Kodi crashes since commit 707d2e8b - gallium: fold u_trim_pipe_prim call from st/mesa to drivers
Summary: [bisected] Kodi crashes since commit 707d2e8b - gallium: fold u_trim_pipe_pri...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 17.2
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords: bisected, have-backtrace, regression
Depends on:
Blocks:
 
Reported: 2017-08-31 23:01 UTC by Alexandre Demers
Modified: 2017-09-07 00:06 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Alexandre Demers 2017-08-31 23:01:11 UTC
I noticed Kodi 17 crashing in the last few weeks. Kodi spits the following backtrace when segfaulting:

Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `/usr/lib/kodi/kodi.bin'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007fe6734f8670 in __memcpy_ssse3 () from /usr/lib/libc.so.6
[Current thread is 1 (Thread 0x7fe67aa4a540 (LWP 7020))]
[...]
Thread 1 (Thread 0x7fe67aa4a540 (LWP 7020)):
#0  0x00007fe6734f8670 in __memcpy_ssse3 () from /usr/lib/libc.so.6
#1  0x00007fe6374624fd in u_upload_data (upload=0x55d0709e65d0, min_out_offset=0, size=4294967288, alignment=4, data=0x55d070d61130, out_offset=0x55d070af4424, outbuf=0x55d070af4428) at ../../../.././src/gallium/auxiliary/util/u_upload_mgr.c:267
#2  0x00007fe637465444 in u_vbuf_upload_buffers (mgr=0x55d070af3c10, start_vertex=0, num_vertices=0, start_instance=0, num_instances=1) at ../../../.././src/gallium/auxiliary/util/u_vbuf.c:990
#3  0x00007fe637465fcf in u_vbuf_draw_vbo (mgr=0x55d070af3c10, info=0x7ffc5a42e7e0) at ../../../.././src/gallium/auxiliary/util/u_vbuf.c:1265
#4  0x00007fe6373aa746 in cso_draw_vbo (cso=0x55d070b27e70, info=0x7ffc5a42e7e0) at ../../../.././src/gallium/auxiliary/cso_cache/cso_context.c:1730
#5  0x00007fe63717a503 in st_draw_vbo (ctx=0x55d070ac5d10, prims=0x7ffc5a42e8c0, nr_prims=1, ib=0x0, index_bounds_valid=1 '\001', min_index=0, max_index=4294967295, tfb_vertcount=0x0, stream=0, indirect=0x0) at ../../.././src/mesa/state_tracker/st_draw.c:255
#6  0x00007fe63711d71a in vbo_draw_arrays (ctx=0x55d070ac5d10, mode=7, start=0, count=0, numInstances=1, baseInstance=0, drawID=0) at ../../.././src/mesa/vbo/vbo_exec_array.c:486
#7  0x00007fe63711df1e in vbo_exec_DrawArrays (mode=7, start=0, count=0) at ../../.././src/mesa/vbo/vbo_exec_array.c:641
#8  0x000055d06dff63d9 in CGUIFontTTFGL::LastEnd() ()
#9  0x000055d06dfb6772 in CGUITextLayout::Render(float, float, float, unsigned int, unsigned int, unsigned int, float, bool) ()
#10 0x000055d06df26367 in CGUIControl::DoRender() ()
#11 0x000055d06df3c8a0 in CGUIControlGroupList::Render() ()
#12 0x000055d06df26367 in CGUIControl::DoRender() ()
#13 0x000055d06df3c8a0 in CGUIControlGroupList::Render() ()
#14 0x000055d06df26367 in CGUIControl::DoRender() ()
#15 0x000055d06df38c2e in CGUIControlGroup::Render() ()
#16 0x000055d06df26367 in CGUIControl::DoRender() ()
#17 0x000055d06df38c2e in CGUIControlGroup::Render() ()
#18 0x000055d06df26367 in CGUIControl::DoRender() ()
#19 0x000055d06df38c2e in CGUIControlGroup::Render() ()
#20 0x000055d06df26367 in CGUIControl::DoRender() ()
#21 0x000055d06df38c2e in CGUIControlGroup::Render() ()
#22 0x000055d06df26367 in CGUIControl::DoRender() ()
#23 0x000055d06df38c2e in CGUIControlGroup::Render() ()
#24 0x000055d06df26367 in CGUIControl::DoRender() ()
#25 0x000055d06dfc4ddf in CGUIWindow::DoRender() ()
#26 0x000055d06dfce19c in CGUIWindowManager::RenderPass() const ()
#27 0x000055d06dfce565 in CGUIWindowManager::Render() ()
#28 0x000055d06e1940fe in CApplication::Render() ()
#29 0x000055d06e2632ab in CXBApplicationEx::Run(CFileItemList&) ()
#30 0x000055d06de9705a in XBMC_Run ()
#31 0x000055d06d9143ac in main ()
############# END STACK TRACE ###############


After investigation and bisection, I ended up with:
707d2e8b3e53c761720adaca7137b242dff344b6 is the first bad commit
commit 707d2e8b3e53c761720adaca7137b242dff344b6
Author: Marek Olšák <marek.olsak@amd.com>
Date:   Sun Apr 9 15:57:45 2017 +0200

    gallium: fold u_trim_pipe_prim call from st/mesa to drivers
    
    Most drivers don't need it and shouldn't need it because it can't be used
    in some cases (indirect draws, primitive restart, count from streamout).
    
    Reviewed-by: Brian Paul <brianp@vmware.com>

:040000 040000 91dbfe3f2d3d2d6c3a5169dd76d07a7f5812c2f5 c876ef71cf4d79da0e099ad4e695cf529118d498 M	src
Comment 1 Alexandre Demers 2017-09-02 13:58:49 UTC
It seems this change (commit 707d2e8b) is responsible for a segfault on launch. However, even when reverting priror to 707d2e8b, Kodi will segfault when launching a stream. I'm investigating this other bug, they may be related.
Comment 2 Alexandre Demers 2017-09-05 17:16:30 UTC
The other segfault has been reported as bug 102530. However, they seem unrelated. Also, bug 102530 may aleready have been fixed, but I can't confirm until the current bug is fixed or the patch is reverted (I'll try the later when I'll get back home).
Comment 3 Dieter Nützel 2017-09-06 18:04:55 UTC
Hello Alexandre,

have you verified, that Marek's patch (fix) for this works?

[Mesa-dev] [PATCH] st/mesa: skip draw calls with pipe_draw_info::count == 0
https://lists.freedesktop.org/archives/mesa-dev/2017-September/168319.html

Greetings,
Dieter
Comment 4 Alexandre Demers 2017-09-06 18:23:46 UTC
(In reply to Dieter Nützel from comment #3)
> Hello Alexandre,
> 
> have you verified, that Marek's patch (fix) for this works?
> 
> [Mesa-dev] [PATCH] st/mesa: skip draw calls with pipe_draw_info::count == 0
> https://lists.freedesktop.org/archives/mesa-dev/2017-September/168319.html
> 
> Greetings,
> Dieter

No, I was not aware of that patch (could have been linked here). I'll test it later today.
Comment 5 Alexandre Demers 2017-09-07 00:06:30 UTC
Marek's patch fixes the bug. Thanks. Add my tested-by if needed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.