[bug #27975] Infinite loop for -exec [..] {} +

View: New views
6 Messages — Rating Filter:   Alert me  

[bug #27975] Infinite loop for -exec [..] {} +

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


URL:
  <http://savannah.gnu.org/bugs/?27975>

                 Summary: Infinite loop for -exec [..] {} +
                 Project: findutils
            Submitted by: jay
            Submitted on: Sun 08 Nov 2009 11:04:20 PM GMT
                Category: None
                Severity: 4 - Important
              Item Group: Wrong result
                  Status: None
                 Privacy: Public
             Assigned to: jay
         Originator Name: Elias Pipping
        Originator Email: pipping.elias@...
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None
           Fixed Release: None

    _______________________________________________________

Details:

Hi,

I've come across a situation in which find will enter an infinite loop when
it shouldn't. I've written a script to reproduce the issue, loop.sh, that I'm
attaching together w/ the output, out.

The problem occurs when find is run on a file that cannot be opened for
reading as well as a large number of file (the order matters).

The problem will only occur when -exec [..] {} + is used, not w/ -exec [..]
{} \; or -print0 | xargs.

The problem will not occur if the number of files is too small (6664 does it
for me, if you're unable to reproduce the issue w/ my script, please try
something greater than that) or if the above-mentioned file is missing.

This is probably related to bug #27328 (I've had segfaults w/ slightly
different invocations earlier as well, I find myself unable to come up w/ a
test case that doesn't involve the 2G directory I ran it on, for that,
though)

-- Elias





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27975>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #27975] Infinite loop for -exec [..] {} +

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Additional Item Attachment, bug #27975 (project findutils):

File name: out                            Size:1 KB
File name: loop.sh                        Size:0 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27975>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #27975] Infinite loop for -exec [..] {} +

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #27975 (project findutils):

                  Status:                    None => Need Info              

    _______________________________________________________

Follow-up Comment #1:

I've attached a patch (against the current git head) to bug #27328.  Could
you let me know if it resolves this problem too?


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27975>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #27975] Infinite loop for -exec [..] {} +

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #2, bug #27975 (project findutils):

Your patch appears to fix this indeed.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27975>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #27975] Infinite loop for -exec [..] {} +

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #27975 (project findutils):

                  Status:               Need Info => In Progress            

    _______________________________________________________

Follow-up Comment #3:

Thanks for the fast feedback.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27975>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




[bug #27975] Infinite loop for -exec [..] {} +

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Update of bug #27975 (project findutils):

                  Status:             In Progress => Fixed                  

    _______________________________________________________

Follow-up Comment #4:

I've applied and pushed the patch now.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?27975>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/