delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/05/26/12:40:32

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=IcBx0f76QWg22Sq1
3Mkjdb/zPUnhrW5Ewt9j7kq8aJ1Zh3vT5ex/saWBr7Ybg8urox8FUeJkMTlAevlT
lSi1aP20/txXXCX2dLA+HwVuXfPKGkTfbPTuVWIJ3inghidXyVMJOHPzKUXFS+Ou
V80pE40OoDcO8E0q7xCaZW+jJNs=
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=877Fn5H6CGtZGquRHWmqz/
4mfis=; b=QwTdSN1o0DbQ9K4ZJjq0iWP3G4S8Q/NAKNCUWP/nXl+qdDAAo/dfCu
3fY1mC/eEHw9rp52H93ntGCVDal5dsSX6JtKkMkU2NVBziLOG6aaSt2Eh+pwmLJQ
8F8a5qlJjRqCkXSr281NmDINrEkCf2eLVAbjIRLSMxfKfNFM9x9PE=
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-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=cygwincom, UD:cygwin.com, cygwin.com, H*r:9.0.019
X-HELO: rgout01.bt.lon5.cpcloud.co.uk
X-OWM-Source-IP: 86.184.210.21 (GB)
X-OWM-Env-Sender: jonturney AT btinternet DOT com
X-VadeSecure-score: verdict=clean score=0/300, class=clean
X-SNCR-VADESECURE: CLEAN
Subject: Re: Cygwin debugger crashes every time on following a unique_ptr
To: The Cygwin Mailing List <cygwin AT cygwin DOT com>,
Raj Kumar <gaurav AT iastate DOT edu>
References: <CAECqvgfWPBo0VmYk=EG14vQkK-L7f4zGZ==pv-jSMt31vhavZw AT mail DOT gmail DOT com> <4ffe9ce5-8504-f009-2b19-098bdc9b1aef AT maxrnd DOT com>
From: Jon Turney <jon DOT turney AT dronecode DOT org DOT uk>
Message-ID: <7a439630-5450-b41e-1f03-c93cfd356b67@dronecode.org.uk>
Date: Sun, 26 May 2019 17:40:10 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0
MIME-Version: 1.0
In-Reply-To: <4ffe9ce5-8504-f009-2b19-098bdc9b1aef@maxrnd.com>

On 25/05/2019 22:31, Mark Geisert wrote:
> Raj Kumar wrote:
> [...]
>> Adding a watch is equivalent to when in the gdb window I try and do
>> this: myCar.get()->currentPassengers. This crashes the GDB every time.
>> So the issue occurs when I try to follow the object pointed to by a
>> unique_ptr and try to get its attributes/variables.
> 
> I can confirm this issue.  The fault is reported by Cygwin's memcpy().  
> I'm having a heck of a time trying to get a gdb backtrace to show what 
> in gdb itself is likely calling memcpy() with a bad arg.

When debugging gdb with itself here, you'll need to use 'set 
cygwin-exceptions on' to allow it to stop on exceptions inside the 
cygwin DLL.

See https://cygwin.com/faq.html#faq.programming.debugging-cygwin

(This would be a lot more usable if gdb ignored exceptions inside the 
specific functions where it makes sense to do that (e.g. 
verifyable_object_isvalid, etc.), rather than anywhere in the cygwin 
DLL, if someone wants to fix that...)

> To reproduce with OP's supplied source files in an otherwise clean 
> directory:
> g++ -g -o raj *.cpp
> gdb raj
> [...]
> (gdb) b main
> (gdb) run
> (gdb) n
> (gdb) n
> 
> At this point you'll be on line 14.  Issue the OP's triggering command:
> (gdb) p myCar.get()->currentPassengers
> Segmentation fault (core dumped)

Thanks for the reproduction instructions.

This seems to be the issue discussed in [1], fixed by [2].

This fix is contained in the 8.2.1-1 Cygwin test release of gdb.

[1] https://sourceware.org/ml/gdb-patches/2018-06/msg00584.html
[2] 
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=de52b9607d2623f18b7a7dbee3e1123d8d63f5da

--
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