Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [ANNOUNCE]Alarm UI replacement

    Reply
    Page 6 of 12 | Prev |   4     5   6   7     8   | Next | Last
    freemangordon | # 51 | 2012-11-16, 13:38 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to freemangordon For This Useful Post:
    reinob, sifo, Wikiwide

     
    reinob | # 52 | 2012-11-16, 14:00 | Report

    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..)

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to reinob For This Useful Post:
    freemangordon, sixwheeledbeast, Wikiwide

     
    reinob | # 53 | 2012-11-16, 14:03 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 5 Users Say Thank You to reinob For This Useful Post:
    freemangordon, misiak, peterleinchen, sixwheeledbeast, Wikiwide

     
    freemangordon | # 54 | 2012-11-16, 14:11 | Report

    @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.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 5 Users Say Thank You to freemangordon For This Useful Post:
    misiak, nkirk, reinob, sixwheeledbeast, Wikiwide

     
    freemangordon | # 55 | 2012-11-16, 14:16 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 3 Users Say Thank You to freemangordon For This Useful Post:
    misiak, reinob, Wikiwide

     
    peterleinchen | # 56 | 2012-11-16, 14:21 | Report

    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!

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
    reinob, Wikiwide

     
    freemangordon | # 57 | 2012-11-16, 14:42 | Report

    New version pushed in CSSU-devel repo with fixes for the last spotted bugs.

    @reinob - lots of thanks pal.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 10 Users Say Thank You to freemangordon For This Useful Post:
    don_falcone, misiak, nkirk, panjgoori, peterleinchen, pichlo, reinob, sixwheeledbeast, Sourav.dubey, Wikiwide

     
    reinob | # 58 | 2012-11-16, 17:32 | Report

    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);
    }

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 8 Users Say Thank You to reinob For This Useful Post:
    don_falcone, foobar, freemangordon, misiak, peterleinchen, sixwheeledbeast, vi_, Wikiwide

     
    freemangordon | # 59 | 2012-11-16, 19:30 | Report

    @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

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by freemangordon; 2012-11-16 at 19:40.
    The Following 8 Users Say Thank You to freemangordon For This Useful Post:
    foobar, kent_autistic, misiak, nicolai, peterleinchen, reinob, sixwheeledbeast, Wikiwide

     
    reinob | # 60 | 2012-11-16, 19:56 | Report

    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

    Originally Posted by
    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..

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 5 Users Say Thank You to reinob For This Useful Post:
    foobar, peterleinchen, sixwheeledbeast, vi_, Wikiwide

     
    Page 6 of 12 | Prev |   4     5   6   7     8   | Next | Last
vBulletin® Version 3.8.8
Normal Logout