Bug 27437 - pm-suspend hangs on grep in remove_parameters() (pm-utils=1.2.6.1)
Summary: pm-suspend hangs on grep in remove_parameters() (pm-utils=1.2.6.1)
Status: RESOLVED NOTOURBUG
Alias: None
Product: pm-utils
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium major
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-03 02:54 UTC by Joel Hough
Modified: 2010-04-06 10:53 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Proposed patch to fix pm-suspend (378 bytes, text/plain)
2010-04-03 02:54 UTC, Joel Hough
Details

Description Joel Hough 2010-04-03 02:54:24 UTC
Created attachment 34641 [details]
Proposed patch to fix pm-suspend

pm-suspend hangs with the process "grep -vxFf /var/run/pm-utils/pm-suspend/ storage/parameters.rm /var/run/pm-utils/pm-suspend/storage/parameters" taking 100% CPU

An update in grep 2.6.2 broke the -Ff option for pattern files with blank lines causing an infinite loop, and the behavior of -Ff in grep 2.6.3 will match all lines if the pattern file contains a blank line. See http://lists.gnu.org/archive/html/bug-grep/2010-04/msg00037.html

/var/run/pm-utils/pm-suspend/storage/parameters.rm is generated with a leading blank line in pm-utils/functions remove_parameters with a 
echo '' > "$PARAMETERS.rm"
command.

From looking at the source, pm-utils=1.3.0 will also be affected.

See also: http://bugs.archlinux.org/task/18881

Steps to reproduce:
1) Run pm-suspend with grep>=2.6.2 (may only affect multibyte locales per bugfix news at http://savannah.gnu.org/forum/forum.php?forum_id=6274)

Attached is a proposed patch.

For the record, I'm running Arch Linux on an MSI Wind U100.
Comment 1 Joel Hough 2010-04-06 10:53:48 UTC
grep 2.6.3 does not hang and works as expected.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.