Re: Cygwin debugger crashes every time on following a unique_ptr
- Date: Sat, 25 May 2019 14:31:45 -0700
- From: Mark Geisert <mark@xxxxxxxxxx>
- Subject: Re: Cygwin debugger crashes every time on following a unique_ptr
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) b main
At this point you'll be on line 14. Issue the OP's triggering command:
(gdb) p myCar.get()->currentPassengers
Segmentation fault (core dumped)
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple