delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/04/19/10:44:26

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=dgYqZ1+2LgK2FM5c
eeYwL/jYiFk3Oeet8hGXzYS9T7W9i5AlYLZA58MmtFNi/3Nv37Lp0m0r9tLGMq24
2u4ZhKJMMnwAJzXa5PW8lqCn+OeAUUAJmCQ9fh7eeyUAQN6iAieQJVd+RO4BjpqM
o+ZNkSdwwpKEDqF/EQFOdKhQjr8=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:subject:to:references:from:message-id:date
:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=4zIuem4q5dc8zmn0qugwgk
of+nU=; b=oIbFID83uSRAzqXg+xkavl5QthmG7+6BIGwF591reMVMBgE+kdgQOM
rIVU4qsg9JOZZslHNyiGxwWY5DABSoZL/hKUvKZY9x/Z0+1Qlb5FMyEajI3xmdJq
+bmgHl9JzuiT8Wg3forQudLLgDPZEI5jYVv3izJumj9sxs32QUinE=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=procps, watch, Hx-spam-relays-external:ESMTPA
X-HELO: out1-smtp.messagingengine.com
X-ME-Sender: <xms:uHf3WO5yqLlmlahnhYG39iDzTcjUfxL5lugMZbY0SgRfWfeiv5HPxw>
Subject: Re: Segfault using `watch -c` with ANSI escapes in output
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>
References: <CA+kUOanFdr6i3E8=2hTJS+3X7RYY246y6czxiJ_=O=dwpz_daA AT mail DOT gmail DOT com> <afb2fadc-ce22-8573-6b56-805cd7450298 AT SystematicSw DOT ab DOT ca>
From: Jon Turney <jon DOT turney AT dronecode DOT org DOT uk>
Message-ID: <b314a37f-5ae8-208e-2b0c-ffdfcf892356@dronecode.org.uk>
Date: Wed, 19 Apr 2017 15:44:02 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019