python-dmidecode icon indicating copy to clipboard operation
python-dmidecode copied to clipboard

Invalid log level

Open danigm opened this issue 9 months ago • 0 comments

In "src/efi.c" the function "log_append()" is called with a log level "LOG_DEBUG", but the corresponding function in "src/dmilog.c" only allows "LOG_ERR" and "LOG_WARNING". This bug was introduced with a commit in 2022.

Here you can find a reproducer script:

import dmidecode

def replicate_bug():
    # Among other things, this reads BIOS information, thereby
    # triggering python-dmidecode to read /sys/firmware/efi/systab
    try:
        bios_info = dmidecode.bios()
        print("Successfully retrieved BIOS information.")
#        for entry in bios_info.values():
#            print(entry)
    except Exception as e:
        print(f"An error occurred while retrieving the BIOS information: {e}")

if __name__ == "__main__":
    replicate_bug()

This script will produce the following output:

** ERROR **  Failed to save log entry
SMBIOS3: entry point at 0xc7c59000
Successfully retrieved BIOS information.

** COLLECTED WARNINGS **
Wrong DMI structures count: 0 announced, only 68 decoded.
** END OF WARNINGS **

danigm avatar Mar 03 '25 10:03 danigm