From https://sourceware.org/bugzilla/show_bug.cgi?id=28995 c++filt _RYAaca_NRYAaBa_a AddressSanitizer:DEADLYSIGNAL ================================================================= ==4145846==ERROR: AddressSanitizer: stack-overflow on address 0x7ffd205e8ff8 (pc 0x0000021dfea9 bp 0x00000000005f sp 0x7ffd205e9000 T0) #0 0x21dfea9 in peek /home/alan/src/binutils-gdb/libiberty/rust-demangle.c:90 #1 0x21dfd8c in eat /home/alan/src/binutils-gdb/libiberty/rust-demangle.c:99:7 #2 0x21e1bb4 in parse_integer_62 /home/alan/src/binutils-gdb/libiberty/rust-demangle.c:125:7 #3 0x21e2019 in demangle_const /home/alan/src/binutils-gdb/libiberty/rust-demangle.c:1153:17 #4 0x21e20a7 in demangle_const /home/alan/src/binutils-gdb/libiberty/rust-demangle.c:1158:11 and lots more at 1158:11. This is with libiberty sources from gcc commit 4cebae0924248b.
Proposed patch submitted here: https://gcc.gnu.org/pipermail/gcc-patches/2022-March/592244.html
Respectfully pinging this issue to ask for a review of the proposed patch.
Can anyone please review the patch so that it can be used?
The master branch has been updated by Nick Clifton <nickc@gcc.gnu.org>: https://gcc.gnu.org/g:9234cdca6ee88badfc00297e72f13dac4e540c79 commit r13-1393-g9234cdca6ee88badfc00297e72f13dac4e540c79 Author: Nick Clifton <nickc@redhat.com> Date: Fri Jul 1 15:58:52 2022 +0100 Add a recursion limit to the demangle_const function in the Rust demangler. libiberty/ PR demangler/105039 * rust-demangle.c (demangle_const): Add recursion limit.
Patch applied.
Thanks very much for committing the patch.