Summary: | xcb_wait_for_reply makes valgrind report memory leaks on Mesa driver | ||
---|---|---|---|
Product: | XCB | Reporter: | Jiancong <94389147> |
Component: | Library | Assignee: | xcb mailing list dummy <xcb> |
Status: | RESOLVED INVALID | QA Contact: | xcb mailing list dummy <xcb> |
Severity: | critical | ||
Priority: | medium | ||
Version: | 1.11 | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Jiancong
2018-02-25 08:28:56 UTC
This means it's not about geom_reply but some other memory allocated by XCB internally. Please try again with debugging symbols available for /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0, so we can see what it's about. I have a similar problem in my project. I build last xcb (version 1.12) and mesa (version 17.2.0-devel) with -ggdb and -fsanitize=address (use gcc sanitizer). Indirect leak of 689436 byte(s) in 19151 object(s) allocated from: #0 0x7f9af0728602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x7f9aec122424 in read_packet /home/filippenko/Soft/libxcb-1.12/src/xcb_in.c:259 #2 0x7f9aec12613a in _xcb_in_read /home/filippenko/Soft/libxcb-1.12/src/xcb_in.c:1012 #3 0x7f9aec11e560 in _xcb_conn_wait /home/filippenko/Soft/libxcb-1.12/src/xcb_conn.c:515 #4 0x7f9aec1238bd in wait_for_reply /home/filippenko/Soft/libxcb-1.12/src/xcb_in.c:516 #5 0x7f9aec123b0a in xcb_wait_for_reply /home/filippenko/Soft/libxcb-1.12/src/xcb_in.c:546 #6 0x7f9ae9faf64e in xcb_dri2_swap_buffers_reply /home/filippenko/Soft/libxcb-1.12/src/dri2.c:893 #7 0x7f9aeec7cbcb in dri2_x11_swap_buffers_msc (lib/libEGL.so.1+0x1bbcb) #8 0x7f9aeec7ccce in dri2_x11_swap_buffers (lib/libEGL.so.1+0x1bcce) #9 0x7f9aeec77e89 in dri2_swap_buffers (lib/libEGL.so.1+0x16e89) #10 0x7f9aeec6b202 in eglSwapBuffers (lib/libEGL.so.1+0xa202) Inside method xcb_wait_for_reply events are added to the linked list, but nobody reads this list. I tried to add a cleanup of this list: ============================================= diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index b01f739..1d1271d 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -869,6 +869,12 @@ dri2_x11_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw, reply = xcb_dri2_swap_buffers_reply(dri2_dpy->conn, cookie, NULL); + xcb_generic_event_t * event = xcb_poll_for_event(dri2_dpy->conn); + while (event) { + free(event); + event = xcb_poll_for_event(dri2_dpy->conn); + } + if (reply) { swap_count = (((int64_t)reply->swap_hi) << 32) | reply->swap_lo; free(reply); =============================================== After that the problem (memory leak) is not observed yet. I'm closing this as invalid since I do not see what the bug is supposed to be. The information provided so far indicates that an event was received from the X11 server, but apparently nothing handles events. That's not a bug in XCB (and I fail to see how an X11 app can work that does not handle any events). Feel free to provide more information (for example what "my app" is exactly), but so far I have to conclude that everything works as intended. Sorry. |
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.