[Bug 965341] Re: watch command line utility crashes with segfault when processing binary output

Dave Gilbert ubuntu at treblig.org
Sat Mar 31 23:51:44 UTC 2012


Program received signal SIGSEGV, Segmentation fault.
0x0000000000402aa2 in main (argc=2, argv=0x7fffffffe0d8) at watch.c:541
541     watch.c: No such file or directory.
(gdb) where
#0  0x0000000000402aa2 in main (argc=2, argv=0x7fffffffe0d8) at watch.c:541
(gdb) p argv[0]
$1 = 0x7fffffffe3e4 "/usr/bin/watch"
(gdb) p argv[1]
$2 = 0x7fffffffe3f3 "tail sample.dat"
(gdb) p argv[2]
$3 = 0x0
(gdb) p c
$4 = 8067886
(gdb) p/x c
$5 = 0x7b1b2e
(gdb) 

line 541 is:

                                                }while (c != WEOF && !isprint(c) && c<128
                                                       && wcwidth(c) == 0
                                                       && c != L'\n'
                                                       && c != L'\t'
                   && (c != L'\033' || option_color != 1));

I'm suspicious that the isprint should be an iswprint but it might need a libc spec person to know whether isprint should
be safe.

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

Title:
  watch command line utility crashes with segfault when processing
  binary output

Status in “procps” package in Ubuntu:
  Triaged

Bug description:
  Running the command:

  $ watch 'tail sample.dat'

  where sample.dat contains binary data, causes 'watch' to crash with
  segmentation fault.

  ProblemType: Bug
  DistroRelease: Ubuntu 11.10
  Package: procps 1:3.2.8-10ubuntu5
  ProcVersionSignature: Ubuntu 3.0.0-16.29-generic 3.0.20
  Uname: Linux 3.0.0-16-generic x86_64
  ApportVersion: 1.23-0ubuntu4
  Architecture: amd64
  Date: Mon Mar 26 11:22:09 2012
  InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
  SourcePackage: procps
  UpgradeStatus: No upgrade log present (probably fresh install)

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




More information about the foundations-bugs mailing list