tuxedocomputers / tuxedo-tomte

Magic housekeeping package for TUXEDO books
https://www.tuxedocomputers.com/en/What-is-TUXEDO-Tomte.tuxedo
Other
35 stars 10 forks source link

Infinite loop in `isTextInFile` #44

Open jfschaefer opened 2 days ago

jfschaefer commented 2 days ago

perl -w /usr/bin/tuxedo-tomte configure all ran for me with 100% CPU usage.

I've been digging a bit into the code and the problem seems to be the while loop in isTextInFile.

Specifically, adding a line for logging:

        while( $FH ) {
            printLog("FILE $filename MATCH /$match/", 'TL0', '[WARN]');
            if ( $_ =~ /$match/sm) {
                return (1);
            }
        }

I get the following output:

FILE /etc/modprobe.d/tuxedo_early_load_backlight_control_fix.conf MATCH /softdep nvidia pre: i915/
FILE /etc/modprobe.d/tuxedo_early_load_backlight_control_fix.conf MATCH /softdep nvidia pre: i915/
FILE /etc/modprobe.d/tuxedo_early_load_backlight_control_fix.conf MATCH /softdep nvidia pre: i915/
FILE /etc/modprobe.d/tuxedo_early_load_backlight_control_fix.conf MATCH /softdep nvidia pre: i915/

etc.

/etc/modprobe.d/tuxedo_early_load_backlight_control_fix.conf contains a single line:

softdep nvidia pre: i915

I feel like this should be an easy fix, but I don't know any perl, unfortunately.

jfschaefer commented 2 days ago

Okay, https://github.com/tuxedocomputers/tuxedo-tomte/pull/43 seems to fix it

Emohr-Tuxedo commented 4 hours ago

THX, I will correct it and upload it today

Emohr-Tuxedo commented 2 hours ago

The hotfix is online. Please update Tomte and you might want to delete the logfile:

sudo rm /var/log/tomte/tomte.log

THX again for letting me know

jfschaefer commented 2 hours ago

Great, the new version works. And thanks for mentioning that the log file should be removed (it was 23GB).