public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix gdb.base/early-init-file.exp with -fsanitize=thread
Date: Sat, 2 Jul 2022 11:50:39 +0200	[thread overview]
Message-ID: <3b8cd629-4949-fe2d-65a0-2bfcbc697e8d@suse.de> (raw)
In-Reply-To: <20220626131505.GA24175@delia>

On 6/26/22 15:15, Tom de Vries via Gdb-patches wrote:
> Hi,
> 
> When building gdb with -fsanitize=thread, I run into:
> ...
> FAIL: gdb.base/early-init-file.exp: check startup version string has style \
>    version
> ...
> due to this:
> ...
> warning: Found custom handler for signal 7 (Bus error) preinstalled.^M
> warning: Found custom handler for signal 8 (Floating point exception) \
>    preinstalled.^M
> warning: Found custom handler for signal 11 (Segmentation fault) \
>    preinstalled.^M
> Some signal dispositions inherited from the environment (SIG_DFL/SIG_IGN)^M
> won't be propagated to spawned programs.^M
> ...
> appearing before the "GNU gdb (GDB) $version" line.
> 
> This is similar to the problem fixed by commit f0bbba7886f
> ("gdb.debuginfod/fetch_src_and_symbols.exp: fix when GDB is built with
> AddressSanitizer").
> 
> In that commit, the problem was fixed by starting gdb with -quiet, but using
> that would mean the "GNU gdb (GDB) $version" line that we're trying to check
> would disappear.
> 
> Fix this instead by updating the regexp to allow the message.
> 
> Tested on x86_64-linux.
> 
> Any comments?
> 

Committed.

Thanks,
- Tom

> [gdb/testsuite] Fix gdb.base/early-init-file.exp with -fsanitize=thread
> 
> ---
>   gdb/testsuite/gdb.base/early-init-file.exp | 19 +++++++++++++++++--
>   1 file changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/early-init-file.exp b/gdb/testsuite/gdb.base/early-init-file.exp
> index 1bc6cea13e3..b5aa5583615 100644
> --- a/gdb/testsuite/gdb.base/early-init-file.exp
> +++ b/gdb/testsuite/gdb.base/early-init-file.exp
> @@ -22,9 +22,23 @@ if {[build_executable "failed to build" $testfile $srcfile]} {
>       return -1
>   }
>   
> +set custom_signal_handle_re \
> +    "warning: Found custom handler for signal $decimal \(\[^\r\n\]+\) preinstalled\."
> +set signal_dispositions_re \
> +    [multi_line \
> +	 "Some signal dispositions inherited from the environment \(\[^\r\n\]+\)" \
> +	 "won't be propagated to spawned programs\." ]
> +set gdb_sanitizer_msg_re \
> +    [multi_line \
> +	 "($custom_signal_handle_re" \
> +	 ")+$signal_dispositions_re" \
> +	 ""]
> +
>   # Start gdb and ensure that the initial version string is styled in
>   # STYLE, use MESSAGE as the name of the test.
>   proc check_gdb_startup_version_string { style { message "" } } {
> +    global gdb_sanitizer_msg_re
> +
>       if { $message == "" } {
>   	set message "check startup version string has style $style"
>       }
> @@ -32,7 +46,7 @@ proc check_gdb_startup_version_string { style { message "" } } {
>       gdb_exit
>       gdb_spawn
>       set vers [style "GNU gdb.*" $style]
> -    gdb_test "" "^${vers}.*" $message
> +    gdb_test "" "^(${gdb_sanitizer_msg_re})?${vers}.*" $message
>   }
>   
>   # Return a list containing two directory paths for newly created home
> @@ -70,12 +84,13 @@ proc setup_home_directories { prefix content } {
>   # drop straight to the prompt.
>   proc check_gdb_startups_up_quietly { message } {
>       global gdb_prompt
> +    global gdb_sanitizer_msg_re
>   
>       gdb_exit
>       gdb_spawn
>   
>       gdb_test_multiple "" $message {
> -	-re "^$gdb_prompt $" {
> +	-re "^(${gdb_sanitizer_msg_re})?$gdb_prompt $" {
>   	    pass $gdb_test_name
>   	}
>       }

      reply	other threads:[~2022-07-02  9:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-26 13:15 [PATCH][gdb/testsuite] " Tom de Vries
2022-07-02  9:50 ` Tom de Vries [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=3b8cd629-4949-fe2d-65a0-2bfcbc697e8d@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@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).