#1638 process lockup during grep

MSYS
pending
None
Bug
none
Unknown
False
2013-02-11
2012-05-29
No

Using grep with pipe to grep (multiple pipes) causes a lockup of the process.
below i the code that reproduces the lockup, it is a while loop, that runs the greps, not that the input file does not have to exist, the lockup will still happen.
After the process is locked in about a minute after ^c the shell displays \"*** WFSO timed out\" message..

bash.exe\"-3.1$ ./bash -version
GNU bash, version 3.1.17(1)-release (i686-pc-msys)
Copyright (C) 2005 Free Software Foundation, Inc.

to run:
bash dbg.ksh

Discussion

  • Earnie Boyd

    Earnie Boyd - 2012-05-29

    Did you mean to attach a file? There is no dbg.ksh file.

    Also, what OS are you using?

     
  • Peter Pashkov

    Peter Pashkov - 2012-05-29
     
  • Peter Pashkov

    Peter Pashkov - 2012-05-29

    The OS is:
    Microsoft Windows XP Professional Version 2002 Service Pack 3

     
  • Earnie Boyd

    Earnie Boyd - 2012-05-30
    • assigned_to: nobody --> cstrauss
     
  • Earnie Boyd

    Earnie Boyd - 2012-05-30

    I confirm that something is causing an issue, I don't know if it is bash, MSYS or a limitation of Windows. In my testing I used the command line and grep only and was able to lock the system to the point that some of the keyboard keys did not function; such as the Backspace key or any directional key.

     
  • Keith Marshall

    Keith Marshall - 2012-06-11

    FWIW, I cannot reproduce this (with MSYS bash-3.1.17(1) on Windows Vista); the OP's test case runs to completion, with output exactly as I would expect from the given script, through the 51 expected cycles, to normal completion.

     
  • Earnie Boyd

    Earnie Boyd - 2012-06-11

    In that case I'm inclined to close this as a limitation of the OS. What do you think Cesar?

     
  • Peter Pashkov

    Peter Pashkov - 2012-06-11

    This problem never happened using mks toolkit on the same Windows XP machine,
    I also tried busybox ash shell, and works correctly. This is definitely something with the msys bash

     
  • Peter Pashkov

    Peter Pashkov - 2012-06-12

    This problem also reproduced on windows 7, but the script had to run longer to fail.
    On XP 50 cycles is enough, on win7 change the max limit to 500.

     
  • Keith Marshall

    Keith Marshall - 2012-06-13

    Okay. Increasing the final count limit to 500 causes a hang, on Vista, after about 180 cycles. I can kill it, with "kill -9 ...", from a second sh tab in console-2, after using ps to get the PID.

    Removing the "awk ..." from the end of the pipeline allows 501 cycles to run to completion. Adding another row of "grep ..."s, in place of the "awk ...", again causes a hang, (after about 80 cycles).

    I'm wondering if this is specific to grep at all? Seems more to be associated with resource allocation, (and specifically how these resources are subsequently released), when running filters in pipelines; the more filters present, the more rapidly resources are depleted.

     
  • Keith Marshall

    Keith Marshall - 2012-06-13

    > Adding another row of "grep ..."s, in place of the "awk ...",
    > again causes a hang, (after about 80 cycles).

    And, in this failing variant, causing an additional external process to run, between invocations of the pipeline, e.g. by replacing

    echo "`date` DBG1.2 count $count"

    by

    echo "`date` DBG1.2 count $count" > x.out
    cat x.out

    seems to break the resource deadlock, allowing 501 cycles to run to completion.

     
  • Earnie Boyd

    Earnie Boyd - 2012-10-26
    • status: open --> pending
     
  • Earnie Boyd

    Earnie Boyd - 2013-02-11
    • labels: MSYS -->
    • milestone: --> MSYS
    • type: --> Bug
    • resolution: --> none
    • category: --> Unknown
    • patch_attached: --> False
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks