public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "tromey at sourceware dot org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug threads/28271] Crash in GDB-10.2 in thread::detach
Date: Fri, 27 Aug 2021 19:02:00 +0000	[thread overview]
Message-ID: <bug-28271-4717-yK7Q7Mxbih@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28271-4717@http.sourceware.org/bugzilla/>

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #10 from Tom Tromey <tromey at sourceware dot org> ---
The valgrind trace doesn't seem very useful.
A lot of the complaints in there don't seem like gdb problems though.

(In reply to Alexey Brodkin from comment #4)

> (top-gdb) bt
> During symbol reading: incomplete CFI data; unspecified registers (e.g.,
> rax) at 0xbe1e31
> #0  0x0000000000000000 in ?? ()
> #1  0x0000000000be1e25 in std::thread::detach() ()
...
> So it looks like a memory/stack corruption which happens in GDB itself.

To me it seems the opposite, more like a system and/or libstdc++ thing.
That code in gdb is just:

              std::thread thread (&thread_pool::thread_function, this);
              thread.detach ();

If creating the thread fails, it should throw an exception.
If thread.detach() crashes... it's hard to see the gdb bug here.

You could perhaps try writing a simple std::thread test and seeing 
if that works standalone.  Maybe that would help track it down a little.

Or, when debugging gdb, you could go 'up' to that frame and poke around.

valgrind did report:

==7500== Jump to the invalid address stated on the next line
==7500==    at 0x0: ???
==7500==    by 0x7886E6: update_thread_pool_size() (maint.c:775)
==7500==    by 0x789636: _initialize_maint_cmds() (maint.c:1265)

What's up with that 0x0?  That seems strange.

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

      parent reply	other threads:[~2021-08-27 19:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 13:00 [Bug threads/28271] New: " florin.iucha at amd dot com
2021-08-26 13:08 ` [Bug threads/28271] " florin.iucha at amd dot com
2021-08-26 14:39 ` simark at simark dot ca
2021-08-26 14:47 ` florin.iucha at amd dot com
2021-08-26 16:39 ` alexey.brodkin at gmail dot com
2021-08-26 16:57 ` simark at simark dot ca
2021-08-26 17:13 ` alexey.brodkin at gmail dot com
2021-08-26 17:21 ` simark at simark dot ca
2021-08-26 17:23 ` cbiesinger at google dot com
2021-08-26 17:44 ` alexey.brodkin at gmail dot com
2021-08-27 19:02 ` tromey at sourceware dot org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28271-4717-yK7Q7Mxbih@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).