memory leaks under wayland
Gimp, babl, gegl upstream, Linux
Description of the bug
Wayland compositor for GNOME causes lots of leaks in Gimp. Xorg works ok.
memory leak of VIRT, RES, SHR whilst calling gimp_polygon_select_tool_cursor_update
Memory is being leaked inside a gimp process. It includes virtual memory size. Which grows quite quickly. Don't know a tool to debug which call is increasing it so fast. As of actual reserved process memory. It's being leaked 1-2MiB per gimp_polygon_select_tool_cursor_update. Shared memory is also growing.
It's strange that massif tool of valgrind. It shows only 166MiB of heap memory being allocated. Whilst htop showed >1GiB of RES memory. And SHM wasn't that big as well to account for a difference between RES and heap memory (as of massif report).
Reproduction
Is the bug reproducible? Always
Reproduction steps:
- Open up GIMP
- Create a new image with default parameters
- Move a mouse across canvas
- VIRT memory should grow about 100-200MiB per second
- Create a path with free select tool.
- Move a mouse across canvas
- RES memory should grow 20-100MiB per second
- SHR memory sometimes grows with almost the same speed as RES, sometimes much slower
- It allows to fill 7GiB of RAM with a consequent linux hangup
- After 300-700 MiB of memory leaked
- Switch to another window
- It usually crashes the application with a segfault inside some call to wayland compsitor
…
Expected result:
Actual result:
Additional information
RES memory grows 1-2MiB per breakpoint hit inside gdb at the position below.
#0 0x000055d76fcbf226 in gimp_polygon_select_tool_cursor_update (tool=0x55d772f94100, coords=0x7ffc9dcf6900, state=GDK_MOD1_MASK, display=0x55d772f84c50) at ../app/tools/gimppolygonselecttool.c:224
#1 0x000055d76fcdc14f in gimp_tool_cursor_update (tool=0x55d772f94100, coords=0x7ffc9dcf6900, state=GDK_MOD1_MASK, display=0x55d772f84c50) at ../app/tools/gimptool.c:1230
#2 0x000055d76fcf1ca3 in tool_manager_cursor_update_active (gimp=0x55d7710a62e0, coords=0x7ffc9dcf6900, state=GDK_MOD1_MASK, display=0x55d772f84c50) at ../app/tools/tool_manager.c:480
#3 0x000055d76ff0eb78 in gimp_display_shell_update_cursor (shell=0x55d773c3f130, display_coords=0x7ffc9dcf6880, image_coords=0x7ffc9dcf6900, state=GDK_MOD1_MASK, update_software_cursor=1) at ../app/display/gimpdisplayshell-tool-events.c:1858
#4 0x000055d76ff0d6da in gimp_display_shell_canvas_tool_events (canvas=0x55d7722bea80, event=0x55d7748a0150, shell=0x55d773c3f130) at ../app/display/gimpdisplayshell-tool-events.c:1207
#5 0x00007f2fadcecc6f in () at /usr/lib/libgtk-3.so.0
#6 0x00007f2fae26ed3a in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#7 0x00007f2fae25c88e in () at /usr/lib/libgobject-2.0.so.0
#8 0x00007f2fae25ff1c in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#9 0x00007f2fae2617f0 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#10 0x00007f2fada557f6 in () at /usr/lib/libgtk-3.so.0
#11 0x00007f2fadb9cab5 in () at /usr/lib/libgtk-3.so.0
#12 0x00007f2fadba012c in gtk_main_do_event () at /usr/lib/libgtk-3.so.0
#13 0x00007f2fad8b18c4 in () at /usr/lib/libgdk-3.so.0
#14 0x00007f2fad880f04 in () at /usr/lib/libgdk-3.so.0
#15 0x00007f2fae1823fe in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#16 0x00007f2fae184211 in () at /usr/lib/libglib-2.0.so.0
#17 0x00007f2fae185123 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#18 0x000055d76f9b5953 in app_run