public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>,
	Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Cc: "Kévin Le Gouguec" <legouguec@adacore.com>
Subject: Re: [PATCH] Guard against frame.c destructors running before frame-info.c's
Date: Tue, 15 Nov 2022 20:19:22 -0500	[thread overview]
Message-ID: <9994be80-c436-32ee-f6a3-174858683054@polymtl.ca> (raw)
In-Reply-To: <87v8nfbtix.fsf@tromey.com>



On 11/15/22 20:03, Tom Tromey wrote:
> Simon> Do you have a way to reproduce, so we can experiment with it?
> 
> Since it's sort of like a C++ static initializer problem, it's dependent
> on how the linker happens to order the relevant destructors.
> 
> For me, the appended reproduces the problem on Linux, because it changes
> the relative ordering of frame.o and frame-info.o in the link.
> 
> Tom
> 
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index fb4d42c7baa..72527f4363f 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -2138,7 +2138,7 @@ stamp-init: $(INIT_FILES) config.status $(srcdir)/make-init-c
>  # against that.
>  #
>  # init.o is very important.  It pulls in the rest of GDB.
> -LIBGDB_OBS = $(sort $(COMMON_OBS)) init.o
> +LIBGDB_OBS = $(COMMON_OBS) init.o
>  libgdb.a: $(LIBGDB_OBS)
>  	-rm -f libgdb.a
>  	$(AR) q libgdb.a $(LIBGDB_OBS)

Thanks, this reproduces for me too.  The patch looks good to me:

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon

  reply	other threads:[~2022-11-16  1:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15 20:48 Kévin Le Gouguec
2022-11-15 21:57 ` Simon Marchi
2022-11-15 22:32   ` Kévin Le Gouguec
2022-11-16  1:03   ` Tom Tromey
2022-11-16  1:19     ` Simon Marchi [this message]
2022-11-16  7:05       ` Kévin Le Gouguec
2022-11-16 14:39         ` Simon Marchi
2022-11-16 16:25           ` Kévin Le Gouguec
2022-11-16 16:28             ` Simon Marchi

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=9994be80-c436-32ee-f6a3-174858683054@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=legouguec@adacore.com \
    --cc=tom@tromey.com \
    /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).