FS#18881 - [grep] version 2.6.2 hangs when issuing a pm-suspend
Attached to Project:
Arch Linux
Opened by Tomas M. (eldragon) - Tuesday, 30 March 2010, 12:34 GMT
Last edited by Allan McRae (Allan) - Saturday, 03 April 2010, 07:54 GMT
Opened by Tomas M. (eldragon) - Tuesday, 30 March 2010, 12:34 GMT
Last edited by Allan McRae (Allan) - Saturday, 03 April 2010, 07:54 GMT
|
Details
Description:
when issuing a pm-suspend, grep 2.6.2 in testing hangs, cpu usage at 100% . killing it continues the suspend process. the command being run is grep -vxFf /var/run/pm-utils/pm-suspend/ storage/parameters.rm /var/run/pm-utils/pm-suspend/storage/parameters taken from the system monitor grep 2.6.1 works ok. |
This task depends upon
Closed by Allan McRae (Allan)
Saturday, 03 April 2010, 07:54 GMT
Reason for closing: Fixed
Additional comments about closing: grep-2.6.3 in [testing]
Saturday, 03 April 2010, 07:54 GMT
Reason for closing: Fixed
Additional comments about closing: grep-2.6.3 in [testing]
"grep -vxFf foo bar" should write all lines of bar to stdout, which do not occur in foo.
if the first line of foo is empty, the new version of grep hangs. the old version didn't show this behavior.
that's the reason why pm-suspend fails ....
"grep -Ff foo bar" will hang if foo contains an empty line.
---------------------
I can trigger it with LANG='de_DE.utf8' but it doesn't happen with LC_ALL=C.
The blocking occurs in kwsearch.c (relevant commit: 6d952beebdac1d8f31ba20abb12a756a9877e50d ), if I revert that specific patch the blocking is gone but now the output is incorrect, so this doesn't seem to seems to be source of the error.
$ src/grep -Ff <(printf '\na') <(printf 'a\nb')
a
$ LC_ALL=C src/grep -Ff <(printf '\na') <(printf 'a\nb')
a
b
---------------------
Regards,
Raphael Kimmig
Paolo Bonzini wrote:
> I just posted a patch to fix this and add it to the testsuite.
>
>
> Paolo
@@ -219,9 +219,9 @@
remove_parameters() {
local p
if [ "$1" = "all" ]; then
- echo '' > "$PARAMETERS.new"
+ :>"$PARAMETERS.new"
else
- echo '' > "$PARAMETERS.rm"
+ :>"$PARAMETERS.rm"
for p in "$@"; do
echo "$p" >> "$PARAMETERS.rm"
done
grep -Ff foo bar will then just match every line of bar.
i guess that's not intended.
Confirmed upstream that this is intended. pm-utils needs fix. File a separate bug report for that.