[Desktop-packages] [Bug 1123930] Re: memleak in plugins/orientation/gsd-orientation-manager.c
** Branch linked: lp:ubuntu/gnome-settings-daemon -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to gnome-settings-daemon in Ubuntu. https://bugs.launchpad.net/bugs/1123930 Title: memleak in plugins/orientation/gsd-orientation-manager.c Status in Ubuntu on the Nexus 7: New Status in “gnome-settings-daemon” package in Ubuntu: Fix Released Status in “gnome-settings-daemon” source package in Raring: Fix Released Bug description: in plugins/orientation/gsd-orientation-manager.c mpu_timer(), the code is leaking g_build_filename() calls. The implication of this leak is severe since it's called very often. The graph attached show evolution of memory usage of g-s-d over a period of 10h or so and g-s-d leaked 9MB during that time. a proposed patch: --- gsd-orientation-manager.c.orig2013-02-12 12:31:34.0 +0100 +++ gsd-orientation-manager.c 2013-02-13 10:35:19.496823747 +0100 @@ -438,13 +438,19 @@ static gboolean mpu_timer(GsdOrientationManager *manager) { int x, y; static gboolean first = TRUE; + gchar *filename_x = NULL; + gchar *filename_y = NULL; OrientationUp orientation = manager-priv-prev_orientation; if (manager-priv-xrandr_proxy == NULL) return TRUE; - x = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL)); - y = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL)); + filename_x = g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL); + filename_y = g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL); + x = read_sysfs_attr_as_int(filename_x); + y = read_sysfs_attr_as_int(filename_y); + g_free(filename_x); + g_free(filename_y); if (x MPU_THRESHOLD) orientation = ORIENTATION_NORMAL; ProblemType: Bug DistroRelease: Ubuntu 13.04 Package: gnome-settings-daemon 3.6.4-0ubuntu5 ProcVersionSignature: Ubuntu 3.8.0-5.10-generic 3.8.0-rc6 Uname: Linux 3.8.0-5-generic x86_64 ApportVersion: 2.8-0ubuntu4 Architecture: amd64 Date: Wed Feb 13 10:36:35 2013 MarkForUpload: True ProcEnviron: TERM=xterm PATH=(custom, no user) XDG_RUNTIME_DIR=set LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: gnome-settings-daemon UpgradeStatus: Upgraded to raring on 2012-01-31 (378 days ago) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-nexus7/+bug/1123930/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1123930] Re: memleak in plugins/orientation/gsd-orientation-manager.c
This bug was fixed in the package gnome-settings-daemon - 3.6.4-0ubuntu6 --- gnome-settings-daemon (3.6.4-0ubuntu6) raring; urgency=low * debian/patches/nexus_orientation.patch: Fix memory leak when building pathnames, thanks Jean-Baptiste Lallement! (LP: #1123930) -- Jani Monoses jani.mono...@canonical.com Wed, 13 Feb 2013 13:25:19 +0200 ** Changed in: gnome-settings-daemon (Ubuntu Raring) Status: New = Fix Released -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to gnome-settings-daemon in Ubuntu. https://bugs.launchpad.net/bugs/1123930 Title: memleak in plugins/orientation/gsd-orientation-manager.c Status in Ubuntu on the Nexus 7: New Status in “gnome-settings-daemon” package in Ubuntu: Fix Released Status in “gnome-settings-daemon” source package in Raring: Fix Released Bug description: in plugins/orientation/gsd-orientation-manager.c mpu_timer(), the code is leaking g_build_filename() calls. The implication of this leak is severe since it's called very often. The graph attached show evolution of memory usage of g-s-d over a period of 10h or so and g-s-d leaked 9MB during that time. a proposed patch: --- gsd-orientation-manager.c.orig2013-02-12 12:31:34.0 +0100 +++ gsd-orientation-manager.c 2013-02-13 10:35:19.496823747 +0100 @@ -438,13 +438,19 @@ static gboolean mpu_timer(GsdOrientationManager *manager) { int x, y; static gboolean first = TRUE; + gchar *filename_x = NULL; + gchar *filename_y = NULL; OrientationUp orientation = manager-priv-prev_orientation; if (manager-priv-xrandr_proxy == NULL) return TRUE; - x = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL)); - y = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL)); + filename_x = g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL); + filename_y = g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL); + x = read_sysfs_attr_as_int(filename_x); + y = read_sysfs_attr_as_int(filename_y); + g_free(filename_x); + g_free(filename_y); if (x MPU_THRESHOLD) orientation = ORIENTATION_NORMAL; ProblemType: Bug DistroRelease: Ubuntu 13.04 Package: gnome-settings-daemon 3.6.4-0ubuntu5 ProcVersionSignature: Ubuntu 3.8.0-5.10-generic 3.8.0-rc6 Uname: Linux 3.8.0-5-generic x86_64 ApportVersion: 2.8-0ubuntu4 Architecture: amd64 Date: Wed Feb 13 10:36:35 2013 MarkForUpload: True ProcEnviron: TERM=xterm PATH=(custom, no user) XDG_RUNTIME_DIR=set LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: gnome-settings-daemon UpgradeStatus: Upgraded to raring on 2012-01-31 (378 days ago) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-nexus7/+bug/1123930/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1123930] Re: memleak in plugins/orientation/gsd-orientation-manager.c
Added a nexus7 task since it's caused by the distro patch to make orientation sensor work on the Nexus. -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to gnome-settings-daemon in Ubuntu. https://bugs.launchpad.net/bugs/1123930 Title: memleak in plugins/orientation/gsd-orientation-manager.c Status in Ubuntu on the Nexus 7: New Status in “gnome-settings-daemon” package in Ubuntu: New Bug description: in plugins/orientation/gsd-orientation-manager.c mpu_timer(), the code is leaking g_build_filename() calls. The implication of this leak is severe since it's called very often. The graph attached show evolution of memory usage of g-s-d over a period of 10h or so and g-s-d leaked 9MB during that time. a proposed patch: --- gsd-orientation-manager.c.orig2013-02-12 12:31:34.0 +0100 +++ gsd-orientation-manager.c 2013-02-13 10:35:19.496823747 +0100 @@ -438,13 +438,19 @@ static gboolean mpu_timer(GsdOrientationManager *manager) { int x, y; static gboolean first = TRUE; + gchar *filename_x = NULL; + gchar *filename_y = NULL; OrientationUp orientation = manager-priv-prev_orientation; if (manager-priv-xrandr_proxy == NULL) return TRUE; - x = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL)); - y = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL)); + filename_x = g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL); + filename_y = g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL); + x = read_sysfs_attr_as_int(filename_x); + y = read_sysfs_attr_as_int(filename_y); + g_free(filename_x); + g_free(filename_y); if (x MPU_THRESHOLD) orientation = ORIENTATION_NORMAL; ProblemType: Bug DistroRelease: Ubuntu 13.04 Package: gnome-settings-daemon 3.6.4-0ubuntu5 ProcVersionSignature: Ubuntu 3.8.0-5.10-generic 3.8.0-rc6 Uname: Linux 3.8.0-5-generic x86_64 ApportVersion: 2.8-0ubuntu4 Architecture: amd64 Date: Wed Feb 13 10:36:35 2013 MarkForUpload: True ProcEnviron: TERM=xterm PATH=(custom, no user) XDG_RUNTIME_DIR=set LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: gnome-settings-daemon UpgradeStatus: Upgraded to raring on 2012-01-31 (378 days ago) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-nexus7/+bug/1123930/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1123930] Re: memleak in plugins/orientation/gsd-orientation-manager.c
Thanks jibel! We need to stop adding patches without review... Jani, it's your patch, can you have a look to the fix? ** Changed in: gnome-settings-daemon (Ubuntu) Importance: Undecided = High ** Changed in: gnome-settings-daemon (Ubuntu) Assignee: (unassigned) = Jani Monoses (jani) ** Also affects: gnome-settings-daemon (Ubuntu Raring) Importance: High Assignee: Jani Monoses (jani) Status: New -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to gnome-settings-daemon in Ubuntu. https://bugs.launchpad.net/bugs/1123930 Title: memleak in plugins/orientation/gsd-orientation-manager.c Status in Ubuntu on the Nexus 7: New Status in “gnome-settings-daemon” package in Ubuntu: New Status in “gnome-settings-daemon” source package in Raring: New Bug description: in plugins/orientation/gsd-orientation-manager.c mpu_timer(), the code is leaking g_build_filename() calls. The implication of this leak is severe since it's called very often. The graph attached show evolution of memory usage of g-s-d over a period of 10h or so and g-s-d leaked 9MB during that time. a proposed patch: --- gsd-orientation-manager.c.orig2013-02-12 12:31:34.0 +0100 +++ gsd-orientation-manager.c 2013-02-13 10:35:19.496823747 +0100 @@ -438,13 +438,19 @@ static gboolean mpu_timer(GsdOrientationManager *manager) { int x, y; static gboolean first = TRUE; + gchar *filename_x = NULL; + gchar *filename_y = NULL; OrientationUp orientation = manager-priv-prev_orientation; if (manager-priv-xrandr_proxy == NULL) return TRUE; - x = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL)); - y = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL)); + filename_x = g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL); + filename_y = g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL); + x = read_sysfs_attr_as_int(filename_x); + y = read_sysfs_attr_as_int(filename_y); + g_free(filename_x); + g_free(filename_y); if (x MPU_THRESHOLD) orientation = ORIENTATION_NORMAL; ProblemType: Bug DistroRelease: Ubuntu 13.04 Package: gnome-settings-daemon 3.6.4-0ubuntu5 ProcVersionSignature: Ubuntu 3.8.0-5.10-generic 3.8.0-rc6 Uname: Linux 3.8.0-5-generic x86_64 ApportVersion: 2.8-0ubuntu4 Architecture: amd64 Date: Wed Feb 13 10:36:35 2013 MarkForUpload: True ProcEnviron: TERM=xterm PATH=(custom, no user) XDG_RUNTIME_DIR=set LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: gnome-settings-daemon UpgradeStatus: Upgraded to raring on 2012-01-31 (378 days ago) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-nexus7/+bug/1123930/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1123930] Re: memleak in plugins/orientation/gsd-orientation-manager.c
Thanks for the catch, I need to remember why I did not calculate the paths only once, as there should be no need to build the same paths in each timer invocation. -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to gnome-settings-daemon in Ubuntu. https://bugs.launchpad.net/bugs/1123930 Title: memleak in plugins/orientation/gsd-orientation-manager.c Status in Ubuntu on the Nexus 7: New Status in “gnome-settings-daemon” package in Ubuntu: New Status in “gnome-settings-daemon” source package in Raring: New Bug description: in plugins/orientation/gsd-orientation-manager.c mpu_timer(), the code is leaking g_build_filename() calls. The implication of this leak is severe since it's called very often. The graph attached show evolution of memory usage of g-s-d over a period of 10h or so and g-s-d leaked 9MB during that time. a proposed patch: --- gsd-orientation-manager.c.orig2013-02-12 12:31:34.0 +0100 +++ gsd-orientation-manager.c 2013-02-13 10:35:19.496823747 +0100 @@ -438,13 +438,19 @@ static gboolean mpu_timer(GsdOrientationManager *manager) { int x, y; static gboolean first = TRUE; + gchar *filename_x = NULL; + gchar *filename_y = NULL; OrientationUp orientation = manager-priv-prev_orientation; if (manager-priv-xrandr_proxy == NULL) return TRUE; - x = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL)); - y = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL)); + filename_x = g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL); + filename_y = g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL); + x = read_sysfs_attr_as_int(filename_x); + y = read_sysfs_attr_as_int(filename_y); + g_free(filename_x); + g_free(filename_y); if (x MPU_THRESHOLD) orientation = ORIENTATION_NORMAL; ProblemType: Bug DistroRelease: Ubuntu 13.04 Package: gnome-settings-daemon 3.6.4-0ubuntu5 ProcVersionSignature: Ubuntu 3.8.0-5.10-generic 3.8.0-rc6 Uname: Linux 3.8.0-5-generic x86_64 ApportVersion: 2.8-0ubuntu4 Architecture: amd64 Date: Wed Feb 13 10:36:35 2013 MarkForUpload: True ProcEnviron: TERM=xterm PATH=(custom, no user) XDG_RUNTIME_DIR=set LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: gnome-settings-daemon UpgradeStatus: Upgraded to raring on 2012-01-31 (378 days ago) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-nexus7/+bug/1123930/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1123930] Re: memleak in plugins/orientation/gsd-orientation-manager.c
** Patch added: Precalculate the two sysfs paths https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1123930/+attachment/3526378/+files/gsd-debdiff.diff -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to gnome-settings-daemon in Ubuntu. https://bugs.launchpad.net/bugs/1123930 Title: memleak in plugins/orientation/gsd-orientation-manager.c Status in Ubuntu on the Nexus 7: New Status in “gnome-settings-daemon” package in Ubuntu: New Status in “gnome-settings-daemon” source package in Raring: New Bug description: in plugins/orientation/gsd-orientation-manager.c mpu_timer(), the code is leaking g_build_filename() calls. The implication of this leak is severe since it's called very often. The graph attached show evolution of memory usage of g-s-d over a period of 10h or so and g-s-d leaked 9MB during that time. a proposed patch: --- gsd-orientation-manager.c.orig2013-02-12 12:31:34.0 +0100 +++ gsd-orientation-manager.c 2013-02-13 10:35:19.496823747 +0100 @@ -438,13 +438,19 @@ static gboolean mpu_timer(GsdOrientationManager *manager) { int x, y; static gboolean first = TRUE; + gchar *filename_x = NULL; + gchar *filename_y = NULL; OrientationUp orientation = manager-priv-prev_orientation; if (manager-priv-xrandr_proxy == NULL) return TRUE; - x = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL)); - y = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL)); + filename_x = g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL); + filename_y = g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL); + x = read_sysfs_attr_as_int(filename_x); + y = read_sysfs_attr_as_int(filename_y); + g_free(filename_x); + g_free(filename_y); if (x MPU_THRESHOLD) orientation = ORIENTATION_NORMAL; ProblemType: Bug DistroRelease: Ubuntu 13.04 Package: gnome-settings-daemon 3.6.4-0ubuntu5 ProcVersionSignature: Ubuntu 3.8.0-5.10-generic 3.8.0-rc6 Uname: Linux 3.8.0-5-generic x86_64 ApportVersion: 2.8-0ubuntu4 Architecture: amd64 Date: Wed Feb 13 10:36:35 2013 MarkForUpload: True ProcEnviron: TERM=xterm PATH=(custom, no user) XDG_RUNTIME_DIR=set LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: gnome-settings-daemon UpgradeStatus: Upgraded to raring on 2012-01-31 (378 days ago) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-nexus7/+bug/1123930/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp
[Desktop-packages] [Bug 1123930] Re: memleak in plugins/orientation/gsd-orientation-manager.c
** Tags added: patch -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to gnome-settings-daemon in Ubuntu. https://bugs.launchpad.net/bugs/1123930 Title: memleak in plugins/orientation/gsd-orientation-manager.c Status in Ubuntu on the Nexus 7: New Status in “gnome-settings-daemon” package in Ubuntu: New Status in “gnome-settings-daemon” source package in Raring: New Bug description: in plugins/orientation/gsd-orientation-manager.c mpu_timer(), the code is leaking g_build_filename() calls. The implication of this leak is severe since it's called very often. The graph attached show evolution of memory usage of g-s-d over a period of 10h or so and g-s-d leaked 9MB during that time. a proposed patch: --- gsd-orientation-manager.c.orig2013-02-12 12:31:34.0 +0100 +++ gsd-orientation-manager.c 2013-02-13 10:35:19.496823747 +0100 @@ -438,13 +438,19 @@ static gboolean mpu_timer(GsdOrientationManager *manager) { int x, y; static gboolean first = TRUE; + gchar *filename_x = NULL; + gchar *filename_y = NULL; OrientationUp orientation = manager-priv-prev_orientation; if (manager-priv-xrandr_proxy == NULL) return TRUE; - x = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL)); - y = read_sysfs_attr_as_int(g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL)); + filename_x = g_build_filename(manager-priv-sysfs_path, in_accel_x_raw, NULL); + filename_y = g_build_filename(manager-priv-sysfs_path, in_accel_y_raw, NULL); + x = read_sysfs_attr_as_int(filename_x); + y = read_sysfs_attr_as_int(filename_y); + g_free(filename_x); + g_free(filename_y); if (x MPU_THRESHOLD) orientation = ORIENTATION_NORMAL; ProblemType: Bug DistroRelease: Ubuntu 13.04 Package: gnome-settings-daemon 3.6.4-0ubuntu5 ProcVersionSignature: Ubuntu 3.8.0-5.10-generic 3.8.0-rc6 Uname: Linux 3.8.0-5-generic x86_64 ApportVersion: 2.8-0ubuntu4 Architecture: amd64 Date: Wed Feb 13 10:36:35 2013 MarkForUpload: True ProcEnviron: TERM=xterm PATH=(custom, no user) XDG_RUNTIME_DIR=set LANG=en_US.UTF-8 SHELL=/bin/bash SourcePackage: gnome-settings-daemon UpgradeStatus: Upgraded to raring on 2012-01-31 (378 days ago) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-nexus7/+bug/1123930/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp