Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] bad regexp in sof-kernel-log-check.sh #1159

Closed
plbossart opened this issue Feb 14, 2024 · 3 comments · Fixed by #1160
Closed

[BUG] bad regexp in sof-kernel-log-check.sh #1159

plbossart opened this issue Feb 14, 2024 · 3 comments · Fixed by #1160

Comments

@plbossart
Copy link
Member

plbossart commented Feb 14, 2024

Describe the bug
sof-test shows a set of "grep: warning: stray \ before :"

This is root caused to this regexp:

cd2eab8 (Keqiao Zhang          2022-09-22 14:46:43 +0800 262) ignore_str="$ignore_str"'|mei_me 0000:00:16\..\: .+'

the last \: is problematic.

To Reproduce

journalctl --priority=err | grep -vE "|mei_me 0000:00:16\..\: .+"
grep: warning: stray \ before :

Expected behavior
no warnings

Detail Info
* SOF-TEST: 65951c4 ("kmod: fix hda-sdw-bpt dependency")

@marc-hb
Copy link
Collaborator

marc-hb commented Feb 15, 2024

I found this in koalaman/shellcheck#2573

The interpretation of an ordinary character preceded by an unescaped ( '' ) is undefined, except for: [...]"
grep is giving a warning since 3.8

Ubuntu 22.04 has grep 3.7

Could you drop the antislash and send a PR?

@plbossart
Copy link
Member Author

root@fedora:~/sof-test# grep --version
grep (GNU grep) 3.11
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others; see
<https://git.savannah.gnu.org/cgit/grep.git/tree/AUTHORS>.

grep -P uses PCRE2 10.42 2022-12-11

I don't know if dropping the backslash is the right solution. Is : an 'ordinary' character?

@marc-hb
Copy link
Collaborator

marc-hb commented Feb 15, 2024

Is : an 'ordinary' character?

Yes. Why? Because the "stray " error message says so :-)

Also, because it's not in that list: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04

plbossart added a commit to plbossart/sof-test that referenced this issue Feb 16, 2024
Newer versions of grep complain about a regexp using a stray backslash
in a regexp.

Closes: thesofproject#1159
Signed-off-by: Pierre-Louis Bossart <[email protected]>
marc-hb pushed a commit that referenced this issue Feb 16, 2024
Newer versions of grep complain about a regexp using a stray backslash
in a regexp.

Closes: #1159
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants