From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129330 invoked by alias); 24 Mar 2015 09:17:25 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 129307 invoked by uid 48); 24 Mar 2015 09:17:24 -0000 From: "sourceware at optimojoe dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/18157] New: Segfault when debugging a program where an initializer list contains a lambda function with auto variables Date: Tue, 24 Mar 2015 10:13:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: 7.7 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sourceware at optimojoe dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-q1/txt/msg00477.txt.bz2 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 struct Foo { std::function f; Foo ( std::function 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 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: . Find the GDB manual and other documentation resources online at: . 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.