[Bug 787307] Re: ls --color can't be interrupted when processing large directory

Launchpad Bug Tracker 787307 at bugs.launchpad.net
Tue Jun 12 17:23:24 UTC 2012


Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: coreutils (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to coreutils in Ubuntu.
https://bugs.launchpad.net/bugs/787307

Title:
  ls --color can't be interrupted when processing large directory

Status in “coreutils” package in Ubuntu:
  Confirmed

Bug description:
  Binary package hint: coreutils

  When listing a large directory with --color, ls can't be interrupted
  with Ctrl-C or other signals.

  To reproduce:

  - Make a directory, /huge/dir, containing lots of files (I used about
  400000 files)

  - ls -l --color /huge/dir

  - ls sits there for a bit while reading the directory and stat'ing all
  the files.  Try hitting Ctrl-C.  ls does not exit.  Ctrl-Z, Ctrl-\
  also do not work.  Only SIGKILL works.

  The problem appears to be that when --color is active, ls handles all
  signals, so that it can reset the terminal before exiting.  When a
  signal such as SIGINT arrives,  ls just sets a flag (e.g.
  `interrupt_signal') and at some later time calls `process_signals' to
  process it appropriately (by exiting).  However, it seems that
  `process_signals' is not called while looping over the entries in a
  single directory; it is only called once output starts to be produced.
  The effect is that `ls' cannot be interrupted.

  This should be easy to fix by calling `process_signals' from more
  places.  Since it normally just tests a flag and returns, the overhead
  should be negligible.

  This is ls from coreutils-8.5-1ubuntu6 on Ubuntu natty 11.04.

  ProblemType: Bug
  DistroRelease: Ubuntu 11.04
  Package: coreutils 8.5-1ubuntu6
  ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
  Uname: Linux 2.6.38-8-generic i686
  Architecture: i386
  Date: Mon May 23 22:31:36 2011
  ProcEnviron:
   LANGUAGE=en_US:en
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: coreutils
  UpgradeStatus: Upgraded to natty on 2011-04-30 (23 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/787307/+subscriptions




More information about the foundations-bugs mailing list