Mesa如何回收图形资源?

时间:2018-11-30 05:44:36

标签: memory-leaks opengl-es egl mesa wayland

我有一个运行在带有DRM和Mesa的英特尔调试板上的系统。

此图形系统使用Wayland / Weston和Mesa。

并且应用程序是使用OpenGL ES 2.0开发的。

现在,我发现有时候,如果应用程序崩溃了,那么Weston也将崩溃。

通过检查Weston的coredump,我发现使用了一些无效的内存地址。

但是当我与Valgrind一起运行Weston时,没有任何关于无效内存访问的报告。

因此,我正在考虑在客户端崩溃时是否存在台面共享内存泄漏。

例如,一个应用程序绘制一个缓冲区,并将其提交给Weston,此后,该应用程序崩溃,并且mesa回收了此应用程序分配的所有缓冲区。但是,韦斯顿不知道这一点,它使用了已提交的缓冲区并崩溃了。

那些事情会发生吗?而我该如何生存呢?

Core was generated by `weston --config=/usr/lib/weston/weston.ini --backend=/usr/lib/weston/ias-backen'.
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
#0  0x00007fec68911b09 in raise (sig=5) at ../sysdeps/unix/sysv/linux/pt-raise.c:36
36      ../sysdeps/unix/sysv/linux/pt-raise.c: No such file or directory.
(gdb) bt
#0  0x00007fec68911b09 in raise (sig=5) at ../sysdeps/unix/sysv/linux/pt-raise.c:36
#1  <signal handler called>
#2  0x00007fec685904b8 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55
#3  0x00007fec6859358a in __GI_abort () at abort.c:89
#4  0x00007fec685ca90b in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7fec686c68a0 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#5  0x00007fec685d4896 in malloc_printerr (action=3, str=0x7fec686c2d31 "free(): invalid pointer", ptr=<optimized out>, ar_ptr=<optimized out>) at malloc.c:5000
#6  0x00007fec685d507e in _int_free (av=0x7fec688fbb40 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:3861
#7  0x00007fec655d320d in intel_miptree_release (mt=mt@entry=0x18884a8)
    at src/mesa/drivers/dri/i965/intel_mipmap_tree.c:1036
#8  0x00007fec655d32a7 in intel_miptree_reference (dst=0x18884a8, src=0x1870170)
    at src/mesa/drivers/dri/i965/intel_mipmap_tree.c:989
#9  0x00007fec655dc640 in intel_set_texture_image_mt (brw=brw@entry=0x7fec69a44040, image=image@entry=0x185c050, internal_format=<optimized out>, mt=<optimized out>)
    at src/mesa/drivers/dri/i965/intel_tex_image.c:180
#10 0x00007fec655dc952 in intel_image_target_texture_2d (ctx=<optimized out>, target=3553, texObj=0x1888080, texImage=0x185c050, image_handle=<optimized out>)
    at src/mesa/drivers/dri/i965/intel_tex_image.c:426
#11 0x00007fec653544ff in _mesa_EGLImageTargetTexture2DOES (target=3553, image=0x185fb60)
    at src/mesa/main/teximage.c:3194
#12 0x00007fec660a2d27 in gl_renderer_attach_egl (format=<optimized out>, buffer=0x1889130, es=<optimized out>) at ../src/gl-renderer.c:1450
#13 gl_renderer_attach (es=<optimized out>, buffer=0x1889130) at ../src/gl-renderer.c:1919
#14 0x000000000040fdb5 in weston_surface_attach (buffer=0x1889130, surface=0x13ad650) at ../src/compositor.c:2266
#15 weston_surface_commit_state (surface=surface@entry=0x13ad650, state=state@entry=0x13ad778) at ../src/compositor.c:3190
#16 0x000000000041036f in weston_surface_commit (surface=surface@entry=0x13ad650) at ../src/compositor.c:3262
#17 0x00000000004104c7 in surface_commit (client=<optimized out>, resource=<optimized out>) at ../src/compositor.c:3289
#18 0x00007fec6835ad04 in ffi_call_unix64 () from /usr/lib/libffi.so.6
#19 0x00007fec6835a7fa in ffi_call () from /usr/lib/libffi.so.6
#20 0x00007fec696ff7ba in wl_closure_invoke (closure=<optimized out>, flags=<optimized out>, target=0x13ad940, opcode=6, data=0x13acd70) at ../src/connection.c:935
#21 0x00007fec696fc517 in wl_client_connection_data (fd=<optimized out>, mask=<optimized out>, data=0x13acd70) at ../src/wayland-server.c:407
#22 0x00007fec696fdd32 in wl_event_loop_dispatch (loop=0x11a7460, timeout=timeout@entry=-1) at ../src/event-loop.c:423
#23 0x00007fec696fc6b5 in wl_display_run (display=display@entry=0x11a7380) at ../src/wayland-server.c:1281
#24 0x00000000004092d1 in main (argc=1, argv=<optimized out>) at ../src/main.c:1049
(gdb)

0 个答案:

没有答案