ltp icon indicating copy to clipboard operation
ltp copied to clipboard

kernbench fails on filenames with spaces or newlines

Open kumarsgoyal opened this issue 8 months ago • 0 comments

When running kernbench on a source tree that contains files with spaces or special characters in their paths, the script prints errors like:

cat: ./tools/testing/selftests/devices/probe/boards/Dell: No such file or directory
cat: Inc.,XPS: No such file or directory
cat: 13: No such file or directory
cat: 9300.yaml.yaml: No such file or directory

This happens due to the unsafe use of:

for i in `find -type f`; do
    cat $i > /dev/null
done

which breaks on such filenames.

🛠️ A fix has been proposed in PR #1230, replacing the loop with a find . -print0 | while read -d '' construct that correctly handles all valid filenames.

kumarsgoyal avatar Apr 07 '25 07:04 kumarsgoyal