tuxedocomputers / tuxedo-tomte

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

Infinite loop in `isTextInFile` #44

Open jfschaefer opened 1 month ago

jfschaefer commented 1 month 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 1 month ago

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

Emohr-Tuxedo commented 1 month ago

THX, I will correct it and upload it today

Emohr-Tuxedo commented 1 month 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 1 month ago

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