Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Thiago Jung Bauermann <thiago.bauermann@linaro.org>,
	Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb.gdb/python-helper.exp: Increase timeout values
Date: Sun, 6 Sep 2026 21:02:49 -0400	[thread overview]
Message-ID: <26f8c856-5194-4fec-9314-fbd30473f493@simark.ca> (raw)
In-Reply-To: <87bjaannoi.fsf@linaro.org>



On 2026-09-06 16:13, Thiago Jung Bauermann wrote:
> Tom de Vries <tdevries@suse.de> writes:
> 
>> On 9/6/26 6:01 AM, Thiago Jung Bauermann wrote:
>>> In the three Linux machines I tested (my x86_64 laptop and two aarch64
>>> servers), gdb.gdb/python-helper.exp has this timeout failure:
>>> FAIL: gdb.gdb/python-helper.exp: pretty print type instance flags (timeout)
>>> And the slower aarch64 server also has this one:
>>> FAIL: gdb.gdb/python-helper.exp: start inner gdb (timeout)
>>> Fix these failures by using timeout factors.  For the latter, a 2x factor
>>> is enough.  For the former, I needed 8x.  It appears that the "pretty print
>>> type instance flags" test is quite demanding.
>>
>> I tried to see if I could reproduce this.  I ended up writing a patch (
>> https://sourceware.org/pipermail/gdb-patches/2026-September/230135.html ) for some timeout
>> but I have no idea whether it's the same root cause or not.  You may want to test it.
>>
>> Assuming it's not, LGTM.
>>
>> Approved-By: Tom de Vries <tdevries@suse.de>
> 
> Thank you! I tested your patch. The same timeouts still happen.
> 
> BUT:
> 
>>> ---
>>> I actually noticed these failures because I compared GDB 17.2 test
>>> results with GDB 18 ones. OK to also push to the branch?
>>
>> This makes me wonder if we're dealing with a performance regression here, but yeah, I
>> suppose it's ok.
> 
> And from Simon's email:
> 
>> Out of curiosity, is this with GDB build at -O0 or -O2 (or something
>> else)?  With ASan or other instrumentation?
>>
>> I am asking because if it's -O2, then it's representative of what a user
>> would have in their hands.  If some commands take a minute to run, then
>> we could at least check if it's because GDB is doing something terribly
>> inefficient.
> 
> Your responses made me realise I may be the only one seeing these
> timeouts, even if it's accross three machines. I found out that this is
> because I compile my test builds with -D_GLIBCXX_DEBUG. I hadn't
> realized until now that its impact on GDB performance was so big:
> 
> Without -D_GLIBCXX_DEBUG on the slower aarch64 server:
> 
> $ ./gdb -D data-directory -nx -q -ex 'maint set per-command time' -ex 'file gdb' -ex quit
> Reading symbols from gdb...
> Time for "minsym install worker": wall 0.237, user 0.135, sys 0.013, user+sys 0.148, 62.4 % CPU
> Time for "minsym install worker": wall 0.238, user 0.139, sys 0.003, user+sys 0.142, 59.7 % CPU
> Time for "minsym install worker": wall 0.239, user 0.141, sys 0.005, user+sys 0.146, 61.1 % CPU
> Time for "minsym install worker": wall 0.248, user 0.148, sys 0.009, user+sys 0.157, 63.3 % CPU
> Time for "minsym install worker": wall 0.249, user 0.154, sys 0.003, user+sys 0.157, 63.1 % CPU
> Time for "minsym install worker": wall 0.252, user 0.143, sys 0.007, user+sys 0.150, 59.5 % CPU
> Time for "minsym install worker": wall 0.256, user 0.151, sys 0.003, user+sys 0.154, 60.2 % CPU
> Time for "minsym install worker": wall 0.260, user 0.148, sys 0.004, user+sys 0.152, 58.5 % CPU
> ⚠ warning: File "/home/thiago.bauermann/src/binutils-gdb-wt/gdb/gdb-gdb.gdb" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
> To enable execution of this file add
>         add-auto-load-safe-path /home/thiago.bauermann/src/binutils-gdb-wt/gdb/gdb-gdb.gdb
> line to your configuration file "/home/thiago.bauermann/.gdbinit".
> To completely disable this security protection add
>         set auto-load safe-path /
> line to your configuration file "/home/thiago.bauermann/.gdbinit".
> For more information about this security protection see the
> "Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
>         info "(gdb)Auto-loading safe path"
>    warning: File "/home/thiago.bauermann/src/binutils-gdb-wt/gdb/gdb-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
> Time for "DWARF indexing worker": wall 0.623, user 0.585, sys 0.035, user+sys 0.620, 99.5 % CPU
> Time for "DWARF indexing worker": wall 0.623, user 0.586, sys 0.034, user+sys 0.620, 99.5 % CPU
> Time for "DWARF indexing worker": wall 0.623, user 0.597, sys 0.023, user+sys 0.620, 99.5 % CPU
> Time for "DWARF indexing worker": wall 0.623, user 0.588, sys 0.033, user+sys 0.621, 99.7 % CPU
> Time for "DWARF indexing worker": wall 0.625, user 0.597, sys 0.025, user+sys 0.622, 99.5 % CPU
> Time for "DWARF indexing worker": wall 0.625, user 0.576, sys 0.045, user+sys 0.621, 99.4 % CPU
> Time for "DWARF indexing worker": wall 0.626, user 0.598, sys 0.025, user+sys 0.623, 99.5 % CPU
> Time for "DWARF indexing worker": wall 0.626, user 0.596, sys 0.029, user+sys 0.625, 99.8 % CPU
> Time for "DWARF skeletonless type units": wall 0.001, user 0.001, sys 0.000, user+sys 0.001, 100.0 % CPU
> Time for "DWARF add parent map": wall 0.089, user 0.087, sys 0.001, user+sys 0.088, 98.9 % CPU
> Time for "DWARF finalize worker": wall 2.039, user 2.034, sys 0.002, user+sys 2.036, 99.9 % CPU
> Time for "DWARF finalize worker": wall 0.000, user 0.000, sys 0.000, user+sys 0.000, nan % CPU
> Time for "DWARF finalize worker": wall 2.045, user 2.040, sys 0.002, user+sys 2.042, 99.9 % CPU
> Time for "DWARF finalize worker": wall 2.055, user 2.051, sys 0.001, user+sys 2.052, 99.9 % CPU
> Time for "DWARF finalize worker": wall 2.082, user 2.077, sys 0.002, user+sys 2.079, 99.9 % CPU
> Time for "DWARF finalize worker": wall 2.087, user 2.082, sys 0.002, user+sys 2.084, 99.9 % CPU
> Time for "DWARF finalize worker": wall 2.103, user 2.096, sys 0.004, user+sys 2.100, 99.9 % CPU
> Time for "DWARF finalize worker": wall 2.112, user 2.107, sys 0.002, user+sys 2.109, 99.9 % CPU
> Time for "DWARF finalize worker": wall 2.114, user 2.110, sys 0.001, user+sys 2.111, 99.9 % CPU
> 
> With -D_GLIBCXX_DEBUG on the slower aarch64 server:
> 
> $ ./gdb -D data-directory -nx -q -ex 'maint set per-command time' -ex 'file gdb' -ex quit
> Reading symbols from gdb...
> Time for "minsym install worker": wall 0.334, user 0.245, sys 0.011, user+sys 0.256, 76.6 % CPU
> Time for "minsym install worker": wall 0.336, user 0.242, sys 0.012, user+sys 0.254, 75.6 % CPU
> Time for "minsym install worker": wall 0.342, user 0.249, sys 0.008, user+sys 0.257, 75.1 % CPU
> Time for "minsym install worker": wall 0.349, user 0.231, sys 0.015, user+sys 0.246, 70.5 % CPU
> Time for "minsym install worker": wall 0.352, user 0.231, sys 0.019, user+sys 0.250, 71.0 % CPU
> Time for "minsym install worker": wall 0.356, user 0.237, sys 0.012, user+sys 0.249, 69.9 % CPU
> Time for "minsym install worker": wall 0.362, user 0.250, sys 0.009, user+sys 0.259, 71.5 % CPU
> Time for "minsym install worker": wall 0.362, user 0.240, sys 0.017, user+sys 0.257, 71.0 % CPU
>    warning: File "/home/thiago.bauermann/src/binutils-gdb-wt/gdb/gdb-gdb.gdb" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
> To enable execution of this file add
>         add-auto-load-safe-path /home/thiago.bauermann/src/binutils-gdb-wt/gdb/gdb-gdb.gdb
> line to your configuration file "/home/thiago.bauermann/.gdbinit".
> To completely disable this security protection add
>         set auto-load safe-path /
> line to your configuration file "/home/thiago.bauermann/.gdbinit".
> For more information about this security protection see the
> "Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
>         info "(gdb)Auto-loading safe path"
>    warning: File "/home/thiago.bauermann/src/binutils-gdb-wt/gdb/gdb-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
> Time for "DWARF indexing worker": wall 3.786, user 2.786, sys 0.847, user+sys 3.633, 96.0 % CPU
> Time for "DWARF indexing worker": wall 3.786, user 2.711, sys 0.954, user+sys 3.665, 96.8 % CPU
> Time for "DWARF indexing worker": wall 3.786, user 2.741, sys 0.933, user+sys 3.674, 97.0 % CPU
> Time for "DWARF indexing worker": wall 3.787, user 2.822, sys 0.872, user+sys 3.694, 97.5 % CPU
> Time for "DWARF indexing worker": wall 3.791, user 2.688, sys 0.979, user+sys 3.667, 96.7 % CPU
> Time for "DWARF indexing worker": wall 3.791, user 2.771, sys 0.880, user+sys 3.651, 96.3 % CPU
> Time for "DWARF indexing worker": wall 3.792, user 2.936, sys 0.778, user+sys 3.714, 97.9 % CPU
> Time for "DWARF indexing worker": wall 3.793, user 2.762, sys 0.905, user+sys 3.667, 96.7 % CPU
> Time for "DWARF skeletonless type units": wall 0.006, user 0.005, sys 0.000, user+sys 0.005, 83.3 % CPU
> Time for "DWARF add parent map": wall 0.116, user 0.114, sys 0.001, user+sys 0.115, 99.1 % CPU
> Time for "DWARF finalize worker": wall 15.504, user 10.265, sys 4.293, user+sys 14.558, 93.9 % CPU
> Time for "DWARF finalize worker": wall 0.000, user 0.000, sys 0.000, user+sys 0.000, nan % CPU
> Time for "DWARF finalize worker": wall 15.770, user 10.372, sys 4.360, user+sys 14.732, 93.4 % CPU
> Time for "DWARF finalize worker": wall 16.329, user 10.965, sys 4.415, user+sys 15.380, 94.2 % CPU
> Time for "DWARF finalize worker": wall 68.077, user 33.268, sys 26.932, user+sys 60.200, 88.4 % CPU
> Time for "DWARF finalize worker": wall 70.295, user 34.154, sys 27.911, user+sys 62.065, 88.3 % CPU
> Time for "DWARF finalize worker": wall 73.817, user 37.446, sys 28.763, user+sys 66.209, 89.7 % CPU
> Time for "DWARF finalize worker": wall 73.916, user 37.227, sys 28.555, user+sys 65.782, 89.0 % CPU
> Time for "DWARF finalize worker": wall 74.662, user 37.951, sys 28.837, user+sys 66.788, 89.5 % CPU

And is this with or without compiler optimizations?  I have the feeling
that C++ without optimizations (especially the standard lib) is slow,
because you have a ton of layers of functions that would normally get
optimized out, but are there in a -O0 build.

> Tom, sorry for sending you on a wild goose chase.
> 
> This patch is clearly not needed.

If you have a particularly slow build, what you can do is use a local
timeout factor when testing:

$ echo 'set gdb_test_timeout [expr 5 * $timeout]' >> testsuite/site.exp

On the other hand if the same single test often times out in a lot of
scenarios or for a lot of people, then it could make sense to increase
the timeout for that one in particular.

Simon

  reply	other threads:[~2026-09-07  1:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-06  4:01 Thiago Jung Bauermann
2026-09-06 15:58 ` Tom de Vries
2026-09-06 20:13   ` Thiago Jung Bauermann
2026-09-07  1:02     ` Simon Marchi [this message]
2026-09-07  4:21       ` Thiago Jung Bauermann
2026-09-06 18:52 ` 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=26f8c856-5194-4fec-9314-fbd30473f493@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    --cc=thiago.bauermann@linaro.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