Reply
Thread Tools
Posts: 3,074 | Thanked: 12,961 times | Joined on Mar 2010 @ Sofia,Bulgaria
#51
Originally Posted by reinob View Post
in size_request_cb()

according to http://developer.gnome.org/pango/sta...rocessing.html, the object returned by pango_context_get_metrics has to be freed by the caller (pango_font_metrics_unref).

This is not the case. You can do it right after calculating "height".
Nice catch, thanks. Will fix that ASAP and will upload the new version in -devel repo.

Meh, I wonder how is that possible, less than 1000 lines of code and so much bugs
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer

 

The Following 3 Users Say Thank You to freemangordon For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#52
Originally Posted by freemangordon View Post
Meh, I wonder how is that possible, less than 1000 lines of code and so much bugs
Well, that's what you get with code using thousands of libraries, where each function uses (directly or indirectly) malloc() all over the place. Freeing unnecessary memory *at the time when it makes sense* it extremely hard.

People using java or such languages just ignore the problem, generally causing memory bloat but with a not-my-problem-just-buy-more-RAM-attitude.

People using C have to know exactly what they're doing *when they are writing the program*. If you debug something afterwards you end up like you (and me now) trying to figure out possible/plausible memory leaks, without really having the "static" overview that one would have (had) while writing the program.

I'll see if I can find other stuff, but you'll never achieve that 100%-certainty feeling that the program has no leaks (not to speak about the various libraries it uses..)
 

The Following 3 Users Say Thank You to reinob For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#53
another one (not a leak but a source of getting a segmentation fault).

In gboolean alarm_snooze() you have

Code:
struct alarm *a;

a->snooze_timeout_tag = 0;
do I need to make it more explicit?
 

The Following 5 Users Say Thank You to reinob For This Useful Post:
Posts: 3,074 | Thanked: 12,961 times | Joined on Mar 2010 @ Sofia,Bulgaria
#54
@reinob - I know pretty well what you mean. Though my question was more something like "Who TF has allowed that guy to write code in such important OS daemon? Who and how reviewed and tested that?"

Well, there is a way, I am going to use some heavy weaponry today. I hope valgrind works on n900 as it is supposed to .

BTW I have the feeling that alamUI is not the only systemui plugin to leak memory. And that systemUI is not the only daemon to leak. Otherwise I can't explain to myself increasing swap usage (at least here) over the time.
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer

 

The Following 5 Users Say Thank You to freemangordon For This Useful Post:
Posts: 3,074 | Thanked: 12,961 times | Joined on Mar 2010 @ Sofia,Bulgaria
#55
Originally Posted by reinob View Post
another one (not a leak but a source of getting a segmentation fault).

In gboolean alarm_snooze() you have

Code:
struct alarm *a;

a->snooze_timeout_tag = 0;
do I need to make it more explicit?
LOL!!! Now, who allowed me to write code in such important daemon
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer

 

The Following 3 Users Say Thank You to freemangordon For This Useful Post:
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#56
Originally Posted by freemangordon View Post
BTW I have the feeling that alamUI is not the only systemui plugin to leak memory. And that systemUI is not the only daemon to leak. Otherwise I can't explain to myself increasing swap usage (at least here) over the time.
Yes, mee too.
My swap usage is increasing day by day. If I would not have extended size of swap on SD it would fill up completely (almost ).
Thanks for investigating!
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 3,074 | Thanked: 12,961 times | Joined on Mar 2010 @ Sofia,Bulgaria
#57
New version pushed in CSSU-devel repo with fixes for the last spotted bugs.

@reinob - lots of thanks pal.
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer

 

The Following 10 Users Say Thank You to freemangordon For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#58
Originally Posted by peterleinchen View Post
Yes, mee too.
My swap usage is increasing day by day. If I would not have extended size of swap on SD it would fill up completely (almost ).
Thanks for investigating!
Just coded this (perl) on the way home. It checks every $INTERVAL seconds and reports changes (positive or negative, above $THRESHOLD) in the memory use (VSZ output from ps) of a list of daemons (edit the file to add/delete some more).

Initial version, it works, but there's a lot we can do starting from this:

Code:
#!/usr/bin/perl

use strict;
use warnings;

my @watch = (
    "/sbin/dsme",
    "/sbin/dsme-server",
    "/usr/bin/pulseaudio",
    "/usr/bin/Xorg",
    "/usr/bin/dbus-daemon",
    "/usr/bin/systemui",
    "/usr/bin/hildon-status-menu",
    "/usr/bin/hildon-home",
    "/usr/bin/hildon-desktop",
    "/usr/sbin/browserd"
);

my %initial = ();

# percentage VSZ has to change to report
my $THRESHOLD = 0.0;

# will check once every $INTERVAL seconds
my $INTERVAL = 4;

while(1) {
    my %current = ();

    open(FH, "ps -eo vsz,command |");

    while(<FH>) {
	chomp;
	my @fields = split;
	my $vsz = $fields[0];
	my $cmd = $fields[1];
    
	# print "vsz($vsz) cmd($cmd)\n";

        foreach my $daemon (@watch) {
	    if($daemon eq $cmd) {
    		$current{$cmd} += $vsz;
    	    }
        }
    }

    if(%initial) {
	foreach my $daemon (keys %current) {
	    my $vsz0 = $initial{$daemon};
	    my $vsz1 = $current{$daemon};

	    my $mvar = (100.0 *($vsz1 - $vsz0)) / $vsz0;

	    if(abs($mvar) > $THRESHOLD) {
		    my $sign = "+";
		    
		    if($vsz1 < $vsz0) {
			$sign = "-";
		    }
		    
		    my $now = localtime;
		    print "[$now] $daemon, $vsz0 -> $vsz1 ($sign)\n";
	    }
	}
	
	# remove next line if absolute (from start) values are wanted
	%initial = %current;
    } else {
	print "Initializing..\n";
	%initial = %current;
    }

    close(FH);
    sleep($INTERVAL);
}
 

The Following 8 Users Say Thank You to reinob For This Useful Post:
Posts: 3,074 | Thanked: 12,961 times | Joined on Mar 2010 @ Sofia,Bulgaria
#59
@reinob - this script need busybox-power, ain't?

However, I would say that for now it seems alarmui does not leak anymore. On the other hand swipe unlock (aka tklock) systemui plugin seems to leak 48k on 2-3 unlocks

Unfortunately there is no x86 binary, only ARM, so I am not sure I want to start REing that. A rewrite might be much easier to be done than RE.


EDIT:
Code:
apt-cache show osso-systemui-tklock
Package: osso-systemui-tklock
Priority: optional
Section: misc
Installed-Size: 76
Please someone with better english/soft skills than mine send her an email asking for some help. Lets hope email is still valid

EDIT2:
I removed the email, google is watching us . Get it by executing apt-cache show on your device
__________________
Never fear. I is here.

720p video support on N900,SmartReflex on N900,Keyboard and mouse support on N900
Nothing is impossible - Stable thumb2 on n900

Community SSU developer
kernel-power developer and maintainer


Last edited by freemangordon; 2012-11-16 at 19:40.
 

The Following 8 Users Say Thank You to freemangordon For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#60
Originally Posted by freemangordon View Post
@reinob - this script need busybox-power, ain't?
Don't know. Didn't check if ps -e -o field1,field2 works on stock busybox. Anyway, it's not like I plan to put it in extras or something

However, I would say that for now it seems alarmui does not leak anymore. On the other hand swipe unlock (aka tklock) systemui plugin seems to leak 48k on 2-3 unlocks

Unfortunately there is no x86 binary, only ARM, so I am not sure I want to start REing that. A rewrite might be much easier to be done than RE.
I have no experience with RE on ARM (maybe it's about time! , and 48k doesn't sound like much. I think hildon-desktop and hildon-home may be better targets. If I ever have a whole week off (no work, no family I'll see what I can do..
 

The Following 5 Users Say Thank You to reinob For This Useful Post:
Reply

Tags
alarm clock, nokia n9

Thread Tools

 
Forum Jump


All times are GMT. The time now is 04:41.