This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Segfault using `watch -c` with ANSI escapes in output
- From: Jon Turney <jon dot turney at dronecode dot org dot uk>
- To: The Cygwin Mailing List <cygwin at cygwin dot com>
- Date: Wed, 19 Apr 2017 15:44:02 +0100
- Subject: Re: Segfault using `watch -c` with ANSI escapes in output
- Authentication-results: sourceware.org; auth=none
- References: <CA+kUOanFdr6i3E8=2hTJS+3X7RYY246y6czxiJ_=O=dwpz_daA@mail.gmail.com> <afb2fadc-ce22-8573-6b56-805cd7450298@SystematicSw.ab.ca>
On 18/04/2017 16:10, Brian Inglis wrote:
On 2017-04-18 06:36, Adam Dinwoodie wrote:
I'm seeing a segfault from using `watch -c` with commands that output
ANSI colour sequences, which is a bit sad given the whole point of the
`-c` is to get the ANSI colour sequences to be displayed.
Simple test case:
$ echo -e '\e[0;32mGreen\e[0;0m' >escapes
$ cat escapes # Text is green in my terminal
Green
$ xxd escapes
00000000: 1b5b 303b 3332 6d47 7265 656e 1b5b 303b .[0;32mGreen.[0;
00000010: 306d 0a 0m.
$ watch -c cat escapes
Segmentation fault (core dumped)
Dies on me too:
$ uname -srvmo
CYGWIN_NT-10.0 2.8.0(0.309/5/3) 2017-04-01 20:47 x86_64 Cygwin
$ watch --version
watch from procps-ng 3.3.11
gdb crashes with dumper .core.
$ gdb watch
...
Reading symbols from watch...(no debugging symbols found)...done.
If you install procps-ng-debuginfo for symbols...
(gdb) run -c cat e
Starting program: /usr/bin/watch -c cat e
[New Thread 436.0x19dc]
[New Thread 436.0x1e44]
[New Thread 436.0x834]
[New Thread 436.0x12d0]
[New Thread 436.0x1508]
[New Thread 436.0xa24]
Program received signal SIGSEGV, Segmentation fault.
0x00000001004029b0 in ?? ()
(gdb) bt
#0 0x00000001004029b0 in ?? ()
... you'll see the obvious mistake which has been fixed upstream for a
while [1].
[1] https://gitlab.com/procps-ng/procps/issues/11
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple