FHEM Forum

FHEM => Sonstiges => Thema gestartet von: vbs am 02 Januar 2019, 16:05:40

Titel: 14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: vbs am 02 Januar 2019, 16:05:40
Ich habe seit meinem MapleCUL häufig auch folgende Warning im Log (so 20mal pro Tag):

2019.01.02 03:18:03.788 1: PERL WARNING: Use of uninitialized value $bitReverse in concatenation (.) or string at ./FHEM/14_CUL_TCM97001.pm line 244.
2019.01.02 03:18:03.788 1: stacktrace:
2019.01.02 03:18:03.788 1:     main::__ANON__                      called by ./FHEM/14_CUL_TCM97001.pm (244)
2019.01.02 03:18:03.788 1:     main::checkCRCKW9010                called by ./FHEM/14_CUL_TCM97001.pm (1465)
2019.01.02 03:18:03.788 1:     main::CUL_TCM97001_Parse            called by fhem.pl (3806)
2019.01.02 03:18:03.788 1:     main::Dispatch                      called by ./FHEM/00_CUL.pm (948)
2019.01.02 03:18:03.788 1:     main::CUL_Parse                     called by ./FHEM/00_CUL.pm (832)
2019.01.02 03:18:03.788 1:     main::CUL_Read                      called by fhem.pl (3610)
2019.01.02 03:18:03.788 1:     main::CallFn                        called by ./FHEM/16_STACKABLE.pm (73)
2019.01.02 03:18:03.788 1:     main::STACKABLE_Parse               called by fhem.pl (3806)
2019.01.02 03:18:03.788 1:     main::Dispatch                      called by ./FHEM/00_CUL.pm (948)
2019.01.02 03:18:03.789 1:     main::CUL_Parse                     called by ./FHEM/00_CUL.pm (832)
2019.01.02 03:18:03.789 1:     main::CUL_Read                      called by fhem.pl (3610)
2019.01.02 03:18:03.789 1:     main::CallFn                        called by fhem.pl (727)


Listings meiner Devices hier zu finden (um Doppelungen zu vermeiden):
https://forum.fhem.de/index.php/topic,95216.0.html
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: vbs am 18 Januar 2019, 11:20:32
Gibt's hier schon Neuigkeiten? Hab die Warnings ziemlich häufig.
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: vbs am 19 Januar 2019, 10:17:17
Hier nochmal Logs von heute mit einer weiteren Warning. Meine Version ist ein paar Tage alt (hab gerade erste geupdatet):
2019.01.19 10:14:38.765 1 : PERL WARNING: Use of uninitialized value $bitReverse in concatenation (.) or string at ./FHEM/14_CUL_TCM97001.pm line 153.
2019.01.19 10:14:38.765 1 : stacktrace:
2019.01.19 10:14:38.766 1 : main::__ANON__ called by ./FHEM/14_CUL_TCM97001.pm (153)
2019.01.19 10:14:38.766 1 : main::checksum_W174 called by ./FHEM/14_CUL_TCM97001.pm (822)
2019.01.19 10:14:38.766 1 : main::CUL_TCM97001_Parse called by fhem.pl (3806)
2019.01.19 10:14:38.767 1 : main::Dispatch called by ./FHEM/00_CUL.pm (948)
2019.01.19 10:14:38.767 1 : main::CUL_Parse called by ./FHEM/00_CUL.pm (832)
2019.01.19 10:14:38.767 1 : main::CUL_Read called by ./FHEM/98_apptime.pm (205)
2019.01.19 10:14:38.767 1 : main::apptime_getTiming called by ./FHEM/98_apptime.pm (165)
2019.01.19 10:14:38.768 1 : main::CallFn called by ./FHEM/16_STACKABLE.pm (73)
2019.01.19 10:14:38.768 1 : main::STACKABLE_Parse called by fhem.pl (3806)
2019.01.19 10:14:38.768 1 : main::Dispatch called by ./FHEM/00_CUL.pm (948)
2019.01.19 10:14:38.768 1 : main::CUL_Parse called by ./FHEM/00_CUL.pm (832)
2019.01.19 10:14:38.768 1 : main::CUL_Read called by ./FHEM/98_apptime.pm (205)
2019.01.19 10:14:38.768 1 : main::apptime_getTiming called by ./FHEM/98_apptime.pm (165)
2019.01.19 10:14:38.769 1 : main::CallFn called by fhem.pl (727)

2019.01.19 10:14:38.769 1 : PERL WARNING: Use of uninitialized value $bitReverse in concatenation (.) or string at ./FHEM/14_CUL_TCM97001.pm line 176.
2019.01.19 10:14:38.769 1 : stacktrace:
2019.01.19 10:14:38.770 1 : main::__ANON__ called by ./FHEM/14_CUL_TCM97001.pm (176)
2019.01.19 10:14:38.770 1 : main::checkCRC called by ./FHEM/14_CUL_TCM97001.pm (901)
2019.01.19 10:14:38.770 1 : main::CUL_TCM97001_Parse called by fhem.pl (3806)
2019.01.19 10:14:38.770 1 : main::Dispatch called by ./FHEM/00_CUL.pm (948)
2019.01.19 10:14:38.770 1 : main::CUL_Parse called by ./FHEM/00_CUL.pm (832)
2019.01.19 10:14:38.771 1 : main::CUL_Read called by ./FHEM/98_apptime.pm (205)
2019.01.19 10:14:38.771 1 : main::apptime_getTiming called by ./FHEM/98_apptime.pm (165)
2019.01.19 10:14:38.771 1 : main::CallFn called by ./FHEM/16_STACKABLE.pm (73)
2019.01.19 10:14:38.771 1 : main::STACKABLE_Parse called by fhem.pl (3806)
2019.01.19 10:14:38.771 1 : main::Dispatch called by ./FHEM/00_CUL.pm (948)
2019.01.19 10:14:38.772 1 : main::CUL_Parse called by ./FHEM/00_CUL.pm (832)
2019.01.19 10:14:38.772 1 : main::CUL_Read called by ./FHEM/98_apptime.pm (205)
2019.01.19 10:14:38.772 1 : main::apptime_getTiming called by ./FHEM/98_apptime.pm (165)
2019.01.19 10:14:38.772 1 : main::CallFn called by fhem.pl (727)
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: vbs am 19 Januar 2019, 14:25:15
Naja noch zwei  ;D (jetzt auf aktueller Version)
2019.01.19 14:22:37.883 1 : PERL WARNING: Use of uninitialized value $bitReverse in concatenation (.) or string at ./FHEM/14_CUL_TCM97001.pm line 965.
2019.01.19 14:22:37.883 1 : stacktrace:
2019.01.19 14:22:37.884 1 : main::__ANON__ called by ./FHEM/14_CUL_TCM97001.pm (965)
2019.01.19 14:22:37.884 1 : main::CUL_TCM97001_Parse called by fhem.pl (3877)
2019.01.19 14:22:37.884 1 : main::Dispatch called by ./FHEM/00_CUL.pm (948)
2019.01.19 14:22:37.884 1 : main::CUL_Parse called by ./FHEM/00_CUL.pm (832)
2019.01.19 14:22:37.884 1 : main::CUL_Read called by ./FHEM/98_apptime.pm (205)
2019.01.19 14:22:37.884 1 : main::apptime_getTiming called by ./FHEM/98_apptime.pm (165)
2019.01.19 14:22:37.884 1 : main::CallFn called by ./FHEM/16_STACKABLE.pm (73)
2019.01.19 14:22:37.884 1 : main::STACKABLE_Parse called by fhem.pl (3877)
2019.01.19 14:22:37.884 1 : main::Dispatch called by ./FHEM/00_CUL.pm (948)
2019.01.19 14:22:37.884 1 : main::CUL_Parse called by ./FHEM/00_CUL.pm (832)
2019.01.19 14:22:37.885 1 : main::CUL_Read called by ./FHEM/98_apptime.pm (205)
2019.01.19 14:22:37.885 1 : main::apptime_getTiming called by ./FHEM/98_apptime.pm (165)
2019.01.19 14:22:37.885 1 : main::CallFn called by fhem.pl (737)
2019.01.19 14:22:37.885 1 : PERL WARNING: Use of uninitialized value $bitUnreverse in concatenation (.) or string at ./FHEM/14_CUL_TCM97001.pm line 966.
2019.01.19 14:22:37.885 1 : stacktrace:
2019.01.19 14:22:37.885 1 : main::__ANON__ called by ./FHEM/14_CUL_TCM97001.pm (966)
2019.01.19 14:22:37.885 1 : main::CUL_TCM97001_Parse called by fhem.pl (3877)
2019.01.19 14:22:37.885 1 : main::Dispatch called by ./FHEM/00_CUL.pm (948)
2019.01.19 14:22:37.886 1 : main::CUL_Parse called by ./FHEM/00_CUL.pm (832)
2019.01.19 14:22:37.886 1 : main::CUL_Read called by ./FHEM/98_apptime.pm (205)
2019.01.19 14:22:37.886 1 : main::apptime_getTiming called by ./FHEM/98_apptime.pm (165)
2019.01.19 14:22:37.886 1 : main::CallFn called by ./FHEM/16_STACKABLE.pm (73)
2019.01.19 14:22:37.886 1 : main::STACKABLE_Parse called by fhem.pl (3877)
2019.01.19 14:22:37.886 1 : main::Dispatch called by ./FHEM/00_CUL.pm (948)
2019.01.19 14:22:37.886 1 : main::CUL_Parse called by ./FHEM/00_CUL.pm (832)
2019.01.19 14:22:37.886 1 : main::CUL_Read called by ./FHEM/98_apptime.pm (205)
2019.01.19 14:22:37.887 1 : main::apptime_getTiming called by ./FHEM/98_apptime.pm (165)
2019.01.19 14:22:37.887 1 : main::CallFn called by fhem.pl (737)
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: pejonp am 20 Januar 2019, 11:23:01
Hallo vbs,

welche Version von 14_CUL_TCM97001.pm hast du.

ich habe diese Version

14_CUL_TCM97001.pm     18090 2018-12-30 07:24:59Z bjoernh


und das steht an dieser Zeilennummer ein define

...
963        my @a = split("", $msg);
.        my $bitReverse = undef;
.        my $bitUnreverse = undef;
.        my $x = undef;
.        my $bin3;
.        my $hlen = length($msg);
.        my $blen = $hlen * 4;
970        my $bitData = unpack("B$blen", pack("H$hlen", $msg));
....


Vielleicht noch einmal ein Update machen und FHEM durchstarten (fhem/linux).

pejonp
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: vbs am 20 Januar 2019, 11:39:55
Ja, sorry nicht so schlau von mir, aber ich kann nicht mehr genau sagen, welche Version ich hatte. :/

Aber kann es recht leicht finden. Es geht in allen Fällen immer um diese Schleifen, in denen an eine undef-Variable ein String angehängt werden soll.

        my $bitReverse = undef;
        my $bitUnreverse = undef;
...
        foreach $x (@a) {
           $bitReverse = $bitReverse . substr(reverse($bin3),0,4);
           $bitUnreverse = $bitUnreverse . sprintf( "%b", hex( substr($bin3,0,4) ) );
        }


Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: pejonp am 20 Januar 2019, 15:11:44
@vbs
Mit Version bekommst du die Version raus.

Ich habe in der TCM... nachgesehen und an der zeilennummer diese stringvarable nicht gefunden, deshalb denke ich das die Datei defekt ist. Einfach nochmal ein Update oder ggg. Vorher die Datei versichern und löschen.

Pejonp


Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: vbs am 20 Januar 2019, 17:27:42
Also ich hatte bis eben die Revision 16274, jetzt die aktuelle.

Ist mir ein Rätsel, dass der String bei dir nicht vorkommt. Ich denke meine Datei ist heil.

Such bitte nochmal nach "my $bitReverse = undef;". Das Muster, welches die Warning erzeugt, findet sich vielen Stellen im Code.
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: pejonp am 20 Januar 2019, 19:49:07
Zitat von: vbs am 20 Januar 2019, 17:27:42
Also ich hatte bis eben die Revision 16274, jetzt die aktuelle.

Ist mir ein Rätsel, dass der String bei dir nicht vorkommt. Ich denke meine Datei ist heil.

Such bitte nochmal nach "my $bitReverse = undef;". Das Muster, welches die Warning erzeugt, findet sich vielen Stellen im Code.

Bei my "my $bitReverse = undef;". sollte eigentlich keine fehlermeldung kommen da richtig definiert.
Wie hast du verbose eingestellt ?

Pejonp
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: vbs am 20 Januar 2019, 19:52:06
Nee nee, die Warning kommt nicht beim Anlegen der Variable... sondern später wenn versucht wird, einen String an undef anzuhängen. Daher die Meldung:
PERL WARNING: Use of uninitialized value $bitReverse in concatenation (.) or string at ./FHEM/14_CUL_TCM97001.pm line 176.
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: bjoernh am 20 Januar 2019, 20:29:31
Aber du hast jetzt schon die letzte Version, oder?
Ich habs leider noch nicht gefunden. Habe die Meldung bei mir nicht  :(
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: vbs am 20 Januar 2019, 20:42:24
Hm, ich glaube, wir haben hier irgendwie ein Missverständnis. Ich sag nochmal, was ich glaube:

Also im Code gibt es viele Stellen, an denen ein String zusammen gebaut wird. Die sehen immer ungefähr so aus:

  my $bitReverse = undef;
  ...
  foreach $x (@a) {
     my $bin3=sprintf("%04b",hex($x));
    $bitReverse = $bitReverse . reverse($bin3);
  }

Es geht um diese Zeile "    $bitReverse = $bitReverse . reverse($bin3); "

Es wird also versucht einen String (reverse($bin3)) an $bitReverse anzuhängen. Diese Variable ist jedoch mit "undef" initialisiert. Das erzeugt Warnings (vermtl. je nach Perl-Konfiguration).

Im Anhang mal ein Patch, bei dem ich ein paar Stellen gefixt habe, die bei mir aufgetreten sind. Aber ich denke, es gibt noch mehr.

EDIT:
Sorry, Patch vergessen...  :o
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: bjoernh am 20 Januar 2019, 20:48:45
OK, glaube ich habs...

Ich teste das mal und checke es dann ein.
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: vbs am 21 Januar 2019, 10:51:09
Hab nochmal zwei Stellen bei mir gefunden. Soll ich die posten oder hast du die jetzt schon händisch rausgeflöht?
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: bjoernh am 21 Januar 2019, 18:20:11
Probiers mal nach dem Update aus. Ich habe es denke ich überall geändert.
Titel: Antw:14_CUL_TCM97001: Use of uninitialized value $bitReverse in concatenation
Beitrag von: vbs am 21 Januar 2019, 21:44:44
Sieht soweit gut aus, danke dir!