public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18157] New: Segfault when debugging a program where an initializer list contains a lambda function with auto variables
@ 2015-03-24 10:13 sourceware at optimojoe dot com
2015-03-25 10:01 ` [Bug c++/18157] " keiths at redhat dot com
0 siblings, 1 reply; 2+ messages in thread
From: sourceware at optimojoe dot com @ 2015-03-24 10:13 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=18157
Bug ID: 18157
Summary: Segfault when debugging a program where an initializer
list contains a lambda function with auto variables
Product: gdb
Version: 7.7
Status: NEW
Severity: normal
Priority: P2
Component: c++
Assignee: unassigned at sourceware dot org
Reporter: sourceware at optimojoe dot com
The following program:
------
#include <functional>
struct Foo {
std::function <void(double &)> f;
Foo (
std::function <void(double &)> const & f_
) : f(f_) {}
};
struct Bar {
Foo foo;
Bar() :
foo([](auto & num) {})
{}
};
int main() {
Bar bar;
}
------
segfaults gdb on startup:
$ gdb test19
GNU gdb (Gentoo 7.7.1 p1) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from test19...Segmentation fault
However, when changing the line
foo([](auto & num) {})
to
foo([](double & num) {})
gdb works as normal. In case it helps:
GNU gdb (Gentoo 7.7.1 p1) 7.7.1
gcc version 4.9.2 (Gentoo 4.9.2 p1.0, pie-0.6.1)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/18157] Segfault when debugging a program where an initializer list contains a lambda function with auto variables
2015-03-24 10:13 [Bug c++/18157] New: Segfault when debugging a program where an initializer list contains a lambda function with auto variables sourceware at optimojoe dot com
@ 2015-03-25 10:01 ` keiths at redhat dot com
0 siblings, 0 replies; 2+ messages in thread
From: keiths at redhat dot com @ 2015-03-25 10:01 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=18157
Keith Seitz <keiths at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |keiths at redhat dot com
Resolution|--- |FIXED
Target Milestone|--- |7.8
--- Comment #1 from Keith Seitz <keiths at redhat dot com> ---
I've verified that this is another libiberty demangler crashing bug. It is
also fixed in GDB 7.8+.
If you'd like a patch, look at commits 91662bad2, fd259167d, 9548bbede, and
53f94b92e (all in libiberty).
It might be possible to toss together something relatively easily by simply
grabbing a recent copy of libiberty/cp-demangle.[ch].
Otherwise, the easiest thing to do is simply upgrade to 7.8 or 7.9.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-24 20:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-24 10:13 [Bug c++/18157] New: Segfault when debugging a program where an initializer list contains a lambda function with auto variables sourceware at optimojoe dot com
2015-03-25 10:01 ` [Bug c++/18157] " keiths at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).