public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/16845] GDB crashs when debugging a simple example of rvalues
  2014-04-15 21:30 [Bug c++/16845] New: GDB crashs when debugging a simple example of rvalues edub4rt at gmail dot com
@ 2014-04-15 21:30 ` edub4rt at gmail dot com
  2014-04-15 21:35 ` edub4rt at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: edub4rt at gmail dot com @ 2014-04-15 21:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16845

Edward Bart <edub4rt at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/16845] New: GDB crashs when debugging a simple example of rvalues
@ 2014-04-15 21:30 edub4rt at gmail dot com
  2014-04-15 21:30 ` [Bug c++/16845] " edub4rt at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: edub4rt at gmail dot com @ 2014-04-15 21:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16845

            Bug ID: 16845
           Summary: GDB crashs when debugging a simple example of rvalues
           Product: gdb
           Version: 7.7
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: edub4rt at gmail dot com

GDB is crashing when trying to debug a simple binary generated by the code
provided below. However it runs fine when compiling with optimization active.

$ g++ --version
g++ (GCC) 4.8.2 20140206 (prerelease)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ -std=c++11 bug.cpp -O0 -o bug && gdb ./bug
GNU gdb (GDB) 7.7
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-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
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 ./bug...Segmentation fault (core dumped)


$ g++ -std=c++11 bug.cpp -O1 -o bug && gdb ./bug
GNU gdb (GDB) 7.7
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-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
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 ./bug...(no debugging symbols found)...done.
(gdb) 


Test case file:

#include <vector>
#include <functional>
#include <memory>

std::vector<std::function<void()>> tasks;

template<class F>
void post(F&& task) {
    typedef typename std::remove_reference<F>::type _F;
    std::shared_ptr<_F> taskPtr(new _F(std::forward<F>(task)));
    tasks.push_back([taskPtr] { (*taskPtr)(); });
}

void add_task() {
    std::function<void()> action;
    post(std::move(action));
}

int main()
{
    return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/16845] GDB crashs when debugging a simple example of rvalues
  2014-04-15 21:30 [Bug c++/16845] New: GDB crashs when debugging a simple example of rvalues edub4rt at gmail dot com
  2014-04-15 21:30 ` [Bug c++/16845] " edub4rt at gmail dot com
@ 2014-04-15 21:35 ` edub4rt at gmail dot com
  2014-04-15 21:45 ` keiths at redhat dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: edub4rt at gmail dot com @ 2014-04-15 21:35 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16845

Edward Bart <edub4rt at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/16845] GDB crashs when debugging a simple example of rvalues
  2014-04-15 21:30 [Bug c++/16845] New: GDB crashs when debugging a simple example of rvalues edub4rt at gmail dot com
  2014-04-15 21:30 ` [Bug c++/16845] " edub4rt at gmail dot com
  2014-04-15 21:35 ` edub4rt at gmail dot com
@ 2014-04-15 21:45 ` keiths at redhat dot com
  2014-04-15 21:47 ` keiths at redhat dot com
  2014-04-17 10:05 ` gbenson at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: keiths at redhat dot com @ 2014-04-15 21:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16845

Keith Seitz <keiths at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |keiths at redhat dot com
         Resolution|---                         |DUPLICATE

--- Comment #1 from Keith Seitz <keiths at redhat dot com> ---
I have verified that this is a dup of the listed libiberty demangler bug.

*** This bug has been marked as a duplicate of bug 16752 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/16845] GDB crashs when debugging a simple example of rvalues
  2014-04-15 21:30 [Bug c++/16845] New: GDB crashs when debugging a simple example of rvalues edub4rt at gmail dot com
                   ` (2 preceding siblings ...)
  2014-04-15 21:45 ` keiths at redhat dot com
@ 2014-04-15 21:47 ` keiths at redhat dot com
  2014-04-17 10:05 ` gbenson at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: keiths at redhat dot com @ 2014-04-15 21:47 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16845

--- Comment #2 from Keith Seitz <keiths at redhat dot com> ---
I should add: the symbol which causes problems this time is:

_ZNSt9_Any_data9_M_accessIPZ4postISt8functionIFvvEEEvOT_EUlvE_EERS5_v

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/16845] GDB crashs when debugging a simple example of rvalues
  2014-04-15 21:30 [Bug c++/16845] New: GDB crashs when debugging a simple example of rvalues edub4rt at gmail dot com
                   ` (3 preceding siblings ...)
  2014-04-15 21:47 ` keiths at redhat dot com
@ 2014-04-17 10:05 ` gbenson at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: gbenson at redhat dot com @ 2014-04-17 10:05 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16845

Gary Benson <gbenson at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gbenson at redhat dot com

--- Comment #3 from Gary Benson <gbenson at redhat dot com> ---
Edward, thanks for the minimal testcase, that's actually a big help.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-17 10:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-15 21:30 [Bug c++/16845] New: GDB crashs when debugging a simple example of rvalues edub4rt at gmail dot com
2014-04-15 21:30 ` [Bug c++/16845] " edub4rt at gmail dot com
2014-04-15 21:35 ` edub4rt at gmail dot com
2014-04-15 21:45 ` keiths at redhat dot com
2014-04-15 21:47 ` keiths at redhat dot com
2014-04-17 10:05 ` gbenson 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).