From: Bernhard B. <Ber...@gm...> - 2015-03-09 10:32:00
|
> Gesendet: Dienstag, 21. Oktober 2014 um 23:41 Uhr > Von: "Bernhard Bitsch" <Ber...@gm...> > An: lcd...@li... > Betreff: [lcd4linux] Some issues found > > Hi, > > I hope someone reads this. The development isn't really engaged in this project, I suspect from the state of the home page. > > I'm using LCD4Linux since a while as part of my IPFire appliance on an ALIX board. > LCD4Linux isn't running continously on my system, because from a while to a while I noticed performance losses with the program active. Of course the display of system parameters on a LCD is just a nice addon to my system, but not really necessary. > > In the last days we discussed a new config for the Pearl (DPF) display. Unfortunately this config caused very high load ( CPU usage about 80%-90%! ). > First idea was, the use of exec plugin gives that high load. But just a config with 2 static text rows made the same effect! > > > Further investigation showed two problems: > > 1) The high load is produced by the update parameter for the text widget class ( =0 -->static, one shot ). Changing the value to just 10 removes that load. Is this issue known? If yes, does exist a patch for this? > > 2) Trying to eliminate some exec functions ( they just read some info from a file ) by using the File::readline function did not succeed. The files read do not contain a EOL character, thus the function does return the empty string. > Looking at the sources of the plugin showed, that a EOL is mandatory. Why? Furthermore the maximum line length is set to 80. The rest of the line is eaten up. > This behaviour is not necessary. fgets stops at EOF, also. Thus a one line file without EOL char could be read also. > I found further issues with this code. > The code for reading is: > char value[80], val2[80]; > .... > fgets(val2, sizeof(val2), fp); <--- read 80 chars at most > size = strcspn(val2, "\r\n"); <--- search for EOL, if not found size is >=80 > strncpy(value, val2, size); <--- only valid if size <=80 > value[size] = '\0'; <--- only valid for size <80 > > > - Bernhard > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://p.sf.net/sfu/Zoho > _______________________________________________ > Lcd4linux-users mailing list > Lcd...@li... > https://lists.sourceforge.net/lists/listinfo/lcd4linux-users > |