[Gelöst]apptime Warnungen im Log

Begonnen von Tommy82, 23 November 2016, 20:26:36

Vorheriges Thema - Nächstes Thema

Tommy82

Hallo,
hab heute seit langem nochmal apptime verwendet und bekomme dazu folgende Meldungen im Log:

2016.11.23 19:59:56.081 1: PERL WARNING: Subroutine HandleTimeout redefined at ./FHEM/98_apptime.pm line 24.
2016.11.23 19:59:56.085 1: PERL WARNING: Subroutine CallFn redefined at ./FHEM/98_apptime.pm line 58.


2016.11.23 20:16:34.771 1: PERL WARNING: Use of uninitialized value in join or string at ./FHEM/98_apptime.pm line 150.

Wo liegt das Problem?

Danke
Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

CoolTux

Die obersten 2 sind voll ok. Heißt nur das er die Subs bei eingelesen hat.
Bei der untersten ist eine nicht definierte Variable wo ein Wert Versucht wird ein zu lesen
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Tommy82

Heißt, ich könnte über stacktrace versuchen das Problem rauszufinden!?
Fhem Cubitruck  Armbian Buster with Linux 5.3.9-sunxi
HM-CC_RT-DN, HM-Sec-RHS,HM-Sec-SD, HM-Sec-SCo,IT1500,1xIT GRR-3500 Fritz!Dect200,Powerline546E,Enigma2 Modul mit 3 Vu+,Wol Modul für WinServer2016 und WinServer 2019,FB6590
Allnetl Wandtablett mit FTUI

CoolTux

Brauchst du nicht. Zeile 150 in apptime gibt es wohl ein join

Tippen auf

my $bla = join(blabla

oder so. Melde es dem Entwickler und gut ist.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

martinp876

sollte behoben sein. Wenn nicht melde dich noch einmal

PatrickR

Mahlzeit!

Das Problem ist leider noch aktuell:


2017.02.20 20:43:56.415 1: PERL WARNING: Use of uninitialized value in join or string at ./FHEM/98_apptime.pm line 150.
2017.02.20 20:43:56.415 1: stacktrace:
2017.02.20 20:43:56.415 1:     main::__ANON__                      called by ./FHEM/98_apptime.pm (150)
2017.02.20 20:43:56.415 1:     main::apptime_CommandDispTiming     called by fhem.pl (1107)
2017.02.20 20:43:56.415 1:     main::AnalyzeCommand                called by fhem.pl (976)
2017.02.20 20:43:56.415 1:     main::AnalyzeCommandChain           called by ./FHEM/01_FHEMWEB.pm (2417)
2017.02.20 20:43:56.415 1:     main::FW_fC                         called by ./FHEM/01_FHEMWEB.pm (873)
2017.02.20 20:43:56.415 1:     main::FW_answerCall                 called by ./FHEM/01_FHEMWEB.pm (523)
2017.02.20 20:43:56.415 1:     main::FW_Read                       called by ./FHEM/98_apptime.pm (104)
2017.02.20 20:43:56.415 1:     main::apptime_getTiming             called by ./FHEM/98_apptime.pm (74)
2017.02.20 20:43:56.415 1:     main::CallFn                        called by fhem.pl (674)



# grep Id 98_apptime.pm
# $Id: 98_apptime.pm 12820 2016-12-18 15:22:37Z martinp876 $

Mal ins Blaue geschossen: Ist vielleicht ein Listenelement undef?

Patrick
lepresenced - Tracking von Bluetooth-LE-Tags (Gigaset G-Tag) mittels PRESENCE

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Rich Cook

CoolTux

#6
Hallo Martin,

Vielleicht geht es so besser

144  +++ if (defined($h->{mAr}) && scalar(@{$h->{mAr}}) > 0){


Ist von Hand geschieben und ungetestet. Kannst Du das bitte einmal testen.


Grüße
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

PatrickR

Habe bei mir mal wie folgt geändert:
$arg = join ("; ", map { $_ // "(undef)" } @{$h->{mAr}});

Ich werde berichten.

Patrick
lepresenced - Tracking von Bluetooth-LE-Tags (Gigaset G-Tag) mittels PRESENCE

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Rich Cook

CoolTux

Was ich nicht verstehe aber auch nicht nachverfolgt habe ist, das in Zeile 144 ja schon geprüft wird ob die Liste einen Inhalt hat.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

PatrickR

Guten Abend!

Zitat von: CoolTux am 20 Februar 2017, 21:18:17
Was ich nicht verstehe aber auch nicht nachverfolgt habe ist, das in Zeile 144 ja schon geprüft wird ob die Liste einen Inhalt hat.

Ich fürchte, der Check in 144 ist bereits vollständig, da $variable im Kontext von if (unter anderem) dann falsch wird, wenn $variable undef ist. Genauso wird scalar(@array) falsch wenn @array keine Elemente enthält. D. h. Martins Variante prüft sogar mehr als Deine.

Zitat
Truth and Falsehood
The number 0, the strings '0' and "" , the empty list () , and undef are all false in a boolean context. All other values are true. Negation of a true value by ! or not returns a special false value. When evaluated as a string it is treated as "" , but as a number, it is treated as 0. Most Perl operators that return true or false behave this way.
(http://perldoc.perl.org/perlsyn.html#Truth-and-Falsehood).

Patrick
lepresenced - Tracking von Bluetooth-LE-Tags (Gigaset G-Tag) mittels PRESENCE

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Rich Cook

PatrickR

lepresenced - Tracking von Bluetooth-LE-Tags (Gigaset G-Tag) mittels PRESENCE

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." - Rich Cook