Community
Participate
Working Groups
When running valgrind with Eclipse 4.20 (simple operations, debug a Java snippet and switch perspectives), one of the reported leaks is: ==45117== 2,040 (1,632 direct, 408 indirect) bytes in 102 blocks are definitely lost in loss record 1,070 of 38,924 ==45117== at 0x4C2B017: malloc (vg_replace_malloc.c:380) ==45117== by 0x2E3BD68D: g_malloc (in /usr/lib64/libglib-2.0.so.0.5600.1) ==45117== by 0x2E3D4C8D: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.5600.1) ==45117== by 0x3478396D: gtk_tree_path_new (gtktreemodel.c:594) ==45117== by 0x3479433C: gtk_tree_store_get_path (gtktreestore.c:600) ==45117== by 0x3CC9D581: Java_org_eclipse_swt_internal_gtk_GTK_gtk_1tree_1model_1get_1path (in /home/sandreev/eclipses/eclipse4_20SDK_m20210407/configuration/org.eclipse.osgi/222/0/.cp/libswt-pi3-gtk-4944r15.so) I've checked all callers of GTK.gtk_tree_model_get_path(), the only code which maybe sometimes doesn't free the output is found in Tree.calculateWidth(). In particular, there is a return statement before the call that should be freeing the resulting path. Unfortunately I've been unable to create a snippet that showcases the memory leak, so I can't be 100% certain.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/180602
The early return was added in 2009: https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=093c579a4ffd9551acb901bba9617e7aa776989d I've set 3.8 as affected, though I'm sure earlier versions are also affected. 3.8 should be "low enough" though, at least for me/Andrey.
Assuming the leak in gtk_tree_model_get_path() is covered by bug 573573. I was unable to create an SWT snippet where the early return branch of Tree.calculateWidth() is executed.