delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/05/25/17:32:08

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=eKWzIznSqOArARtQ
ATYoQ+llxDMMQdKV/pIP8nVxZ/FnJZJIZ1nfZ5SnYakXLBO25QUaQdtQ7Mec3jVH
JufrlrQgtb+kvvmiz8p6zBP5WNwMOfbwi3fTuLFQp4NOQuECPOdTv/jlgmwG9S9G
VLN37Neo8lpZCqBxQBmYV+cmUDk=
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=wUIyIsh8BRTHobPO6w1z0G
nH36U=; b=cfn1K2Ch3f5NfWAod+d9p1vpCd6CFnc6CR5XAjudGf8XdRO9J3zH2/
yzkjRiCrhCqsCRJMB0dBLBLmv7cn3mQKZLQcOuDL1i9TdYUbur/C/BQDiKzdT3KD
RqzraQ5I7Euc3XuAKvLY+JhgTBF6VLavklim1X964nLRM+w2Id1tY=
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=-5.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 spammy=H*c:ISO-8859-1, H*Ad:U*mark, kumar, Kumar
X-HELO: m0.truegem.net
Subject: Re: Cygwin debugger crashes every time on following a unique_ptr
To: cygwin AT cygwin DOT com
References: <CAECqvgfWPBo0VmYk=EG14vQkK-L7f4zGZ==pv-jSMt31vhavZw AT mail DOT gmail DOT com>
From: Mark Geisert <mark AT maxrnd DOT com>
Message-ID: <4ffe9ce5-8504-f009-2b19-098bdc9b1aef@maxrnd.com>
Date: Sat, 25 May 2019 14:31:45 -0700
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46
MIME-Version: 1.0
In-Reply-To: <CAECqvgfWPBo0VmYk=EG14vQkK-L7f4zGZ==pv-jSMt31vhavZw@mail.gmail.com>

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.

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)

..mark

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