Skip to content

kernbench fails on filenames with spaces or newlines #1231

Open
@kumarsgoyal

Description

@kumarsgoyal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions