* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
@ 2023-10-30 16:40 ` josh.cottingham at linaro dot org
2023-10-31 4:14 ` sam at gentoo dot org
` (15 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: josh.cottingham at linaro dot org @ 2023-10-30 16:40 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Josh Cottingham <josh.cottingham at linaro dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P2 |P1
CC| |josh.cottingham at linaro dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
2023-10-30 16:40 ` [Bug symtab/31010] " josh.cottingham at linaro dot org
@ 2023-10-31 4:14 ` sam at gentoo dot org
2023-10-31 17:30 ` tromey at sourceware dot org
` (14 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: sam at gentoo dot org @ 2023-10-31 4:14 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Sam James <sam at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sam at gentoo dot org,
| |tromey at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
2023-10-30 16:40 ` [Bug symtab/31010] " josh.cottingham at linaro dot org
2023-10-31 4:14 ` sam at gentoo dot org
@ 2023-10-31 17:30 ` tromey at sourceware dot org
2023-11-30 17:15 ` tromey at sourceware dot org
` (13 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: tromey at sourceware dot org @ 2023-10-31 17:30 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
cooked_index_functions::expand_symtabs_matching defers to the
index, which uses case-insensitive lookup to handle things like
Ada and Fortran.
This probably needs some refinement.
Maybe a lookup_name ought to carry a language along with it.
Anyway more filtering could be done in the inner loop of that
function.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (2 preceding siblings ...)
2023-10-31 17:30 ` tromey at sourceware dot org
@ 2023-11-30 17:15 ` tromey at sourceware dot org
2024-01-20 8:36 ` sam at gentoo dot org
` (12 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: tromey at sourceware dot org @ 2023-11-30 17:15 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |29366
Referenced Bugs:
https://sourceware.org/bugzilla/show_bug.cgi?id=29366
[Bug 29366] [meta] New DWARF indexer meta bug
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (3 preceding siblings ...)
2023-11-30 17:15 ` tromey at sourceware dot org
@ 2024-01-20 8:36 ` sam at gentoo dot org
2024-02-15 17:02 ` tromey at sourceware dot org
` (11 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: sam at gentoo dot org @ 2024-01-20 8:36 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Sam James <sam at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://sourceware.org/bugz
| |illa/show_bug.cgi?id=30520
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (4 preceding siblings ...)
2024-01-20 8:36 ` sam at gentoo dot org
@ 2024-02-15 17:02 ` tromey at sourceware dot org
2025-02-04 15:38 ` josh.cottingham at linaro dot org
` (10 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: tromey at sourceware dot org @ 2024-02-15 17:02 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |DUPLICATE
--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
Closing this as a dup, since it seems to be basically the
same problem as the other bug, and that bug has a patch.
Worth noting that this problem is reported as being fixed
by that patch as well.
*** This bug has been marked as a duplicate of bug 30520 ***
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (5 preceding siblings ...)
2024-02-15 17:02 ` tromey at sourceware dot org
@ 2025-02-04 15:38 ` josh.cottingham at linaro dot org
2025-02-05 10:15 ` josh.cottingham at linaro dot org
` (9 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: josh.cottingham at linaro dot org @ 2025-02-04 15:38 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Josh Cottingham <josh.cottingham at linaro dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|DUPLICATE |---
Status|RESOLVED |UNCONFIRMED
--- Comment #3 from Josh Cottingham <josh.cottingham at linaro dot org> ---
After trying with both GDB 15.1 and GDB 16.1 I am lead to believe that this
issue has not actually been solved in bug 30520.
When testing with the following patch
https://sourceware.org/pipermail/gdb-patches/2024-January/205924.html it did
appear to be solved and no longer occurring.
However, since then it looks like it was proposed to move to from name matching
the full name to name matching on the canonical name. By the time the patch was
implemented again with this change in
https://sourceware.org/pipermail/gdb-patches/2024-May/209010.html it appears
that this issue was still occurring.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (6 preceding siblings ...)
2025-02-04 15:38 ` josh.cottingham at linaro dot org
@ 2025-02-05 10:15 ` josh.cottingham at linaro dot org
2025-02-20 22:23 ` tromey at sourceware dot org
` (8 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: josh.cottingham at linaro dot org @ 2025-02-05 10:15 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
--- Comment #4 from Josh Cottingham <josh.cottingham at linaro dot org> ---
For simplicity, I have created a GDB test which you can use for validation if
you like:
# Copyright 1998-2025 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file was written by Joshua Cottingham (josh.cottingham@linaro.org)
# Used to catch regression where GDB would expand CU table when printing
# fundamental types that are in "mixed-case".
standard_testfile break.c break1.c
if {[prepare_for_testing "failed to prepare" $testfile \
[list $srcfile $srcfile2] {debug nowarnings}]} {
return -1
}
set readnow_p [readnow]
# The command we test here produce many lines of output; disable "press
# <return> to continue" prompts.
gdb_test_no_output "set height 0"
gdb_file_cmd ${binfile}
# Check no CU are currently read before starting the program
gdb_test "maint print statistics" \
".*Number of read CUs: 0.*" \
"No CU are read at the start"
gdb_test "print INT" "" "printing uppercase fundamental type"
# Now check CUs have still not been read after printing
gdb_test "maint print statistics" \
".*Number of read CUs: 0.*" \
"No CU are read after printing fundamental type"
``
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (7 preceding siblings ...)
2025-02-05 10:15 ` josh.cottingham at linaro dot org
@ 2025-02-20 22:23 ` tromey at sourceware dot org
2025-02-20 22:24 ` tromey at sourceware dot org
` (7 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: tromey at sourceware dot org @ 2025-02-20 22:23 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2025-02-20
Ever confirmed|0 |1
--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
Thanks, can confirm.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (8 preceding siblings ...)
2025-02-20 22:23 ` tromey at sourceware dot org
@ 2025-02-20 22:24 ` tromey at sourceware dot org
2025-02-21 16:27 ` tromey at sourceware dot org
` (6 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: tromey at sourceware dot org @ 2025-02-20 22:24 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at sourceware dot org |tromey at sourceware dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (9 preceding siblings ...)
2025-02-20 22:24 ` tromey at sourceware dot org
@ 2025-02-21 16:27 ` tromey at sourceware dot org
2025-02-21 16:34 ` tromey at sourceware dot org
` (5 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: tromey at sourceware dot org @ 2025-02-21 16:27 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
I'm going to fix this in the easiest way; but there is
a better way and I'll file a follow-up bug for that.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (10 preceding siblings ...)
2025-02-21 16:27 ` tromey at sourceware dot org
@ 2025-02-21 16:34 ` tromey at sourceware dot org
2025-02-22 0:40 ` tromey at sourceware dot org
` (4 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: tromey at sourceware dot org @ 2025-02-21 16:34 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |32733
Referenced Bugs:
https://sourceware.org/bugzilla/show_bug.cgi?id=32733
[Bug 32733] cooked_index_functions::expand_symtabs_matching does not examine
last name element in loop
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (11 preceding siblings ...)
2025-02-21 16:34 ` tromey at sourceware dot org
@ 2025-02-22 0:40 ` tromey at sourceware dot org
2025-02-22 18:51 ` tromey at sourceware dot org
` (3 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: tromey at sourceware dot org @ 2025-02-22 0:40 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
I have a patch that I'll send reasonably soon.
It depends on another patch I sent this past week.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (12 preceding siblings ...)
2025-02-22 0:40 ` tromey at sourceware dot org
@ 2025-02-22 18:51 ` tromey at sourceware dot org
2025-03-08 0:15 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: tromey at sourceware dot org @ 2025-02-22 18:51 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
--- Comment #8 from Tom Tromey <tromey at sourceware dot org> ---
https://sourceware.org/pipermail/gdb-patches/2025-February/215738.html
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (13 preceding siblings ...)
2025-02-22 18:51 ` tromey at sourceware dot org
@ 2025-03-08 0:15 ` cvs-commit at gcc dot gnu.org
2025-03-08 0:19 ` tromey at sourceware dot org
2025-03-08 18:18 ` sam at gentoo dot org
16 siblings, 0 replies; 18+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2025-03-08 0:15 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
--- Comment #9 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=aab2ac34d7f78f0b7a42cef0187dc6e4d7ec4f02
commit aab2ac34d7f78f0b7a42cef0187dc6e4d7ec4f02
Author: Tom Tromey <tom@tromey.com>
Date: Fri Feb 21 09:18:28 2025 -0700
Avoid excessive CU expansion on failed matches
PR symtab/31010 points out that something like "ptype INT" will expand
all CUs in a typical program. The OP further points out that the
original patch for PR symtab/30520:
https://sourceware.org/pipermail/gdb-patches/2024-January/205924.html
... did solve the problem, but the patch changed after (my) review and
reintroduced the bug.
In cooked_index_functions::expand_symtabs_matching, the final
component of a split name is compared with the entry's name using the
usual method of calling get_symbol_name_matcher.
This code iterates over languages and tries to split the original name
according to each style. But, the Ada splitter uses the decoded name
-- "int". This causes every C or C++ CU to be expanded.
Clearly this is wrong. And, it seems to me that looping over
languages and trying to guess the splitting style for the input text
is probably bad. However, fixing the problem is not so easy (again
due to Ada). I've filed a follow-up bug, PR symtab/32733, for this.
Meanwhile, this patch changes the code to be closer to the
originally-submitted patch. This works because the comparison is now
done between the full name and the "lookup_name_without_params"
object, which is a less adulterated variant of the original input.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Tested-By: Simon Marchi <simon.marchi@efficios.com>
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (14 preceding siblings ...)
2025-03-08 0:15 ` cvs-commit at gcc dot gnu.org
@ 2025-03-08 0:19 ` tromey at sourceware dot org
2025-03-08 18:18 ` sam at gentoo dot org
16 siblings, 0 replies; 18+ messages in thread
From: tromey at sourceware dot org @ 2025-03-08 0:19 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Target Milestone|--- |17.1
Status|NEW |RESOLVED
--- Comment #10 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug symtab/31010] Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion
2023-10-30 16:38 [Bug symtab/31010] New: Evaluating "mixed-cased" fundamental types causes hangs/OOM due to full symtab expansion josh.cottingham at linaro dot org
` (15 preceding siblings ...)
2025-03-08 0:19 ` tromey at sourceware dot org
@ 2025-03-08 18:18 ` sam at gentoo dot org
16 siblings, 0 replies; 18+ messages in thread
From: sam at gentoo dot org @ 2025-03-08 18:18 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=31010
Sam James <sam at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://sourceware.org/bugz
| |illa/show_bug.cgi?id=32616
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 18+ messages in thread