Open Flowdalic opened 3 years ago
Looks like it. Could you try debugging it?
Here is what I have so far:
This appears to only happen if eclean-kernel looks at an initramfs. Here read_version_from_raw()
returns the wrong information:
> /usr/lib/python3.11/site-packages/ecleankernel/file.py(216)read_version_from_raw()
-> return sbuf
(Pdb) p sbuf
b'\x00CIFS VFS Client for Linux\x00fs/smb/client/sess.c\x00OS/2\x00CIFS: %s: OS/2 server\n\x00CIFS: %s: bleft %d\n\x00CIFS: %s: serverOS=%s\n\x00CIFS: %s: serverNOS=%s\n\x00CIFS: %s: serverDomain=%s\n\x00CIFS: %s: Guest login\n\x00CIFS: %s: UID = %llu\n\x00fs/smb/client/cifsglob.h\x00yes\x00no\x00\x00%s: ses '
(Pdb) bt
/usr/lib/python3.11/bdb.py(600)run()
-> exec(cmd, globals, locals)
<string>(1)<module>()
/usr/lib/python-exec/python-exec2(98)<module>()
-> exec(data, new_globals)
<string>(8)<module>()
/usr/lib/python3.11/site-packages/ecleankernel/__main__.py(392)setuptools_main()
-> sys.exit(main(sys.argv[1:]))
/usr/lib/python3.11/site-packages/ecleankernel/__main__.py(237)main()
-> kernels = layout.find_kernels(exclusions=exclusions)
/usr/lib/python3.11/site-packages/ecleankernel/layout/std.py(94)find_kernels()
-> kobj = KernelImage(path)
/usr/lib/python3.11/site-packages/ecleankernel/file.py(112)__init__()
-> self.internal_version = self.read_internal_version()
/usr/lib/python3.11/site-packages/ecleankernel/file.py(163)read_internal_version()
-> verbuf = func(f)
> /usr/lib/python3.11/site-packages/ecleankernel/file.py(216)read_version_from_raw()
-> return sbuf
Looking at read_version_from_raw()
in file.py
the whole approach appears to be fragile and prone to false positives. Which is nicely demonstrated by this issue.
I get
ValueError: embedded null byte
when runningeclean-kernel
version 2.99.3:Using
pdb
shows the null byte:Maybe a bug in
KernelImage.read_internal_version()
?