After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 683627 - Memory leak in style_data_lookup
Memory leak in style_data_lookup
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkStyleContext
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-09-08 15:19 UTC by Xan Lopez
Modified: 2012-09-13 21:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
stylecontext: fix a StyleData refleak (1.13 KB, patch)
2012-09-13 17:50 UTC, Cosimo Cecchi
committed Details | Review

Description Xan Lopez 2012-09-08 15:19:36 UTC
There's a large-ish leak in here, reported lots of times in a short valgrind run:

==11032== 1,424 (48 direct, 1,376 indirect) bytes in 2 blocks are definitely lost in loss record 14,567 of 14,916
==11032==    at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==11032==    by 0x7B16E7B: standard_malloc (gmem.c:85)
==11032==    by 0x7B16F04: g_malloc (gmem.c:159)
==11032==    by 0x7B2F8B4: g_slice_alloc (gslice.c:1003)
==11032==    by 0x7B2F8F3: g_slice_alloc0 (gslice.c:1029)
==11032==    by 0x71AE1C7: style_data_new (gtkstylecontext.c:478)
==11032==    by 0x71AF0D0: style_data_lookup (gtkstylecontext.c:981)
==11032==    by 0x71B4119: _gtk_style_context_validate (gtkstylecontext.c:3169)
==11032==    by 0x71B42C3: _gtk_style_context_validate (gtkstylecontext.c:3209)
==11032==    by 0x71B42C3: _gtk_style_context_validate (gtkstylecontext.c:3209)
==11032==    by 0x71B42C3: _gtk_style_context_validate (gtkstylecontext.c:3209)
==11032==    by 0x72B91CB: gtk_window_show (gtkwindow.c:4826)
==11032==    by 0x442CD2: ephy_window_show (ephy-window.c:3829)
==11032==    by 0x7A78407: g_cclosure_marshal_VOID__VOID (gmarshal.c:85)
==11032==    by 0x7A75B14: g_type_class_meta_marshal (gclosure.c:970)
==11032==    by 0x7A7545F: g_closure_invoke (gclosure.c:777)
==11032==    by 0x7A92BD3: signal_emit_unlocked_R (gsignal.c:3481)
==11032==    by 0x7A92147: g_signal_emit_valist (gsignal.c:3300)
==11032==    by 0x7A92690: g_signal_emit (gsignal.c:3356)
==11032==    by 0x7299461: gtk_widget_show (gtkwidget.c:4038)
Comment 1 Cosimo Cecchi 2012-09-13 15:57:09 UTC
Can also reproduce with Nautilus, confirming.
Comment 2 Cosimo Cecchi 2012-09-13 17:50:48 UTC
Created attachment 224251 [details] [review]
stylecontext: fix a StyleData refleak

We were failing to unref the style data in some code paths.
Comment 3 Cosimo Cecchi 2012-09-13 21:01:58 UTC
Attachment 224251 [details] pushed as f57778e - stylecontext: fix a StyleData refleak

Pushed to master.