Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Hannes Domani <ssbssa@yahoo.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix heap-use-after-free in index-cached with --disable-threading
Date: Sat, 04 May 2024 09:45:03 -0600	[thread overview]
Message-ID: <878r0p1szk.fsf@tromey.com> (raw)
In-Reply-To: <20240504110942.922-1-ssbssa@yahoo.de> (Hannes Domani's message of "Sat, 4 May 2024 13:09:42 +0200")

>>>>> "Hannes" == Hannes Domani <ssbssa@yahoo.de> writes:

Hannes> Fixed by making cooked_index_worker::wait only return true if desired_state
Hannes> is CACHE_DONE, same as if threading was enabled, so m_state will not be
Hannes> prematurely deleted.

Hannes> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31694

Thank you.  This is ok.
Approved-By: Tom Tromey <tom@tromey.com>

Hannes>  #else
Hannes>    /* Without threads, all the work is done immediately on the main
Hannes>       thread, and there is never anything to wait for.  */
Hannes> -  done = true;
Hannes> +  done = desired_state == cooked_state::CACHE_DONE;
Hannes>  #endif /* CXX_STD_THREAD */
 
I wouldn't mind if this code were lowered out of the #if, like:

    #endif /* CXX_STD_THREAD */
      bool done = ...

However I think it's also fine as-is and can be tidied up later if
anyone cares to.

Tom

  reply	other threads:[~2024-05-04 15:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240504110942.922-1-ssbssa.ref@yahoo.de>
2024-05-04 11:09 ` Hannes Domani
2024-05-04 15:45   ` Tom Tromey [this message]
2024-05-04 16:28     ` Hannes Domani
2024-05-04 16:56     ` Hannes Domani
2024-05-10  5:59       ` Bernd Edlinger
2024-05-10 13:50         ` Hannes Domani
2024-05-10 18:03         ` Tom Tromey
2024-05-11  6:44           ` Bernd Edlinger
2024-05-10 19:16   ` Pedro Alves
2024-05-11 10:47     ` Hannes Domani

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=878r0p1szk.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ssbssa@yahoo.de \
    /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