GNOME Bugzilla – Bug 169827
weather applet leaks on opening prefs
Last modified: 2005-08-10 23:47:46 UTC
The weather applet seems to be leaking 100-200 kb of memory every time I open the prefs dialog. I checked by looking at the RSS value in gnome-system-monitor, and also by running it under valgrind. I found one possible cause in that weather_location_free() didn't free location->coordinates. I added this and valgrind doesn't report that leak any more. This seems to have caused the applet to lose it's location when I open the prefs dialog though, so it has a bad side effect. It still uses 100-200kb more every time I open the prefs though. Some of it seems to be caused by a leak in the neon http method, and I've filed a separate bug for that. Backtraces of the leaks: ==17270== 6861 bytes in 629 blocks are definitely lost in loss record 179 of 233 ==17270== at 0x1B909292: malloc (vg_replace_malloc.c:130) ==17270== by 0x1BF27EB5: xmlStrndup (xmlstring.c:45) ==17270== by 0x1BF27F19: xmlStrdup (xmlstring.c:71) ==17270== by 0x1BF4F29B: xmlTextReaderValue (xmlreader.c:3356) ==17270== by 0x80589C0: gweather_xml_parse_name (gweather-xml.c:192) ==17270== by 0x8058EE5: gweather_xml_parse_node (gweather-xml.c:453) ==17270== by 0x8058EB8: gweather_xml_parse_node (gweather-xml.c:461) ==17270== by 0x80592B7: gweather_xml_load_locations (gweather-xml.c:505) ==17270== by 0x805020F: gweather_pref_run (gweather-pref.c:358) ==17270== by 0x1BA0847A: marshal_VOID__USER_DATA_STRING (bonobo-ui-component.c:221) ==17270== by 0x1C1B5D34: g_closure_invoke (gclosure.c:437) ==17270== by 0x1C0F23CC: bonobo_closure_invoke_va_list (bonobo-types.c:415) ==17270== by 0x1C0F25BE: bonobo_closure_invoke (bonobo-types.c:478) ==17270== by 0x1BA09270: impl_Bonobo_UIComponent_execVerb (bonobo-ui-component.c:158) ==17270== by 0x1C0F3071: _ORBIT_skel_small_Bonobo_UIComponent_execVerb (Bonobo-common.c:332) ==17270== by 0x1C18E70B: ORBit_c_stub_invoke (poa.c:2627) ==17270== by 0x1C0F5A3F: Bonobo_UIComponent_execVerb (Bonobo-stubs.c:544) ==17270== by 0x1BA10173: impl_emit_verb_on (bonobo-ui-engine.c:1533) ==17270== by 0x1C1CA774: g_cclosure_marshal_VOID__POINTER (gmarshal.c:601) ==17270== by 0x1C1B5F98: g_type_class_meta_marshal (gclosure.c:514) ==17270== 19232 (32 direct, 19200 indirect) bytes in 2 blocks are definitely lost in loss record 195 of 233 ==17270== at 0x1B909292: malloc (vg_replace_malloc.c:130) ==17270== by 0x1CB78754: ne_calloc (ne_alloc.c:64) ==17270== by 0x1CB7421B: ne_add_response_header_handler (ne_request.c:629) ==17270== by 0x1CB74389: ne_request_create (ne_request.c:532) ==17270== by 0x1CB71E93: http_transfer_start (http-neon-method.c:2210) ==17270== by 0x1CB72196: do_open (http-neon-method.c:2360) ==17270== by 0x1BE6FF9E: gnome_vfs_open_uri_cancellable (gnome-vfs-cancellable-ops.c:57) ==17270== by 0x1BE7CE1D: _gnome_vfs_job_execute (gnome-vfs-job.c:964) ==17270== by 0x1BE7B52B: thread_routine (gnome-vfs-job-slave.c:64) ==17270== by 0x1BE8B573: thread_entry (gnome-vfs-thread-pool.c:186) ==17270== by 0x1C227C13: g_thread_create_proxy (gthread.c:561) ==17270== by 0xD8BB16: start_thread (in /lib/tls/libpthread-2.3.4.so) ==17270== by 0xCD8D7D: clone (in /lib/tls/libc-2.3.4.so) and ==17270== 104067 bytes in 6487 blocks are definitely lost in loss record 230 of 233 ==17270== at 0x1B909292: malloc (vg_replace_malloc.c:130) ==17270== by 0x1C214985: g_malloc (gmem.c:137) ==17270== by 0x1C2238C3: g_strdup (gstrfuncs.c:90) ==17270== by 0x805390A: weather_location_new (weather.c:125) ==17270== by 0x8058B75: gweather_xml_parse_location (gweather-xml.c:295) ==17270== by 0x8059030: gweather_xml_parse_node (gweather-xml.c:382) ==17270== by 0x8058EB8: gweather_xml_parse_node (gweather-xml.c:461) ==17270== by 0x8058EB8: gweather_xml_parse_node (gweather-xml.c:461) ==17270== by 0x80592B7: gweather_xml_load_locations (gweather-xml.c:505) ==17270== by 0x805020F: gweather_pref_run (gweather-pref.c:358) ==17270== by 0x1BA0847A: marshal_VOID__USER_DATA_STRING (bonobo-ui-component.c:221) ==17270== by 0x1C1B5D34: g_closure_invoke (gclosure.c:437) ==17270== by 0x1C0F23CC: bonobo_closure_invoke_va_list (bonobo-types.c:415) ==17270== by 0x1C0F25BE: bonobo_closure_invoke (bonobo-types.c:478) ==17270== by 0x1BA09270: impl_Bonobo_UIComponent_execVerb (bonobo-ui-component.c:158) ==17270== by 0x1C0F3071: _ORBIT_skel_small_Bonobo_UIComponent_execVerb (Bonobo-common.c:332) ==17270== by 0x1C18E70B: ORBit_c_stub_invoke (poa.c:2627) ==17270== by 0x1C0F5A3F: Bonobo_UIComponent_execVerb (Bonobo-stubs.c:544) ==17270== by 0x1BA10173: impl_emit_verb_on (bonobo-ui-engine.c:1533) ==17270== by 0x1C1CA774: g_cclosure_marshal_VOID__POINTER (gmarshal.c:601) This last one seems to have been fixed by the following patch, but with the mentioned side effect: diff -u -p -r1.106 weather.c --- weather.c 24 Feb 2005 09:01:53 -0000 1.106 +++ weather.c 10 Mar 2005 12:23:26 -0000 @@ -251,6 +251,7 @@ void weather_location_free (WeatherLocat g_free (location->code); g_free (location->zone); g_free (location->radar); + g_free (location->coordinates); g_free (location); }
And the side effect seems to have been caused by running the applet under valgrind. Commiting with Davyd's permission. Leaving the report open to track the gweather-xml.c leak
Closing. Don't see these any more.
sorry. i should have closed this one ages ago. :D