From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4E1D2385800E; Mon, 30 Aug 2021 17:11:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E1D2385800E From: "irfanariq at kaist dot ac.kr" To: gcc-bugs@gcc.gnu.org Subject: [Bug demangler/102130] New: [c++filt] Stack overflow in demangle_path Date: Mon, 30 Aug 2021 17:11:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: demangler X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: irfanariq at kaist dot ac.kr X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Aug 2021 17:11:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102130 Bug ID: 102130 Summary: [c++filt] Stack overflow in demangle_path Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: demangler Assignee: unassigned at gcc dot gnu.org Reporter: irfanariq at kaist dot ac.kr Target Milestone: --- Created attachment 51378 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51378&action=3Dedit poc and full stack trace Hello, We are currently working on fuzz testing feature, and we found a crash on c++filt. The stack traces are as follow: =3D=3D617=3D=3DERROR: AddressSanitizer: stack-overflow on address 0x7fffe1f= a7ff8 (pc 0x555911cd5385 bp 0x7fffe1fa8140 sp 0x7fffe1fa8000 T0) #0 0x555911cd5384 in demangle_path rust-demangle.c:674 #1 0x555911cd5e48 in demangle_path rust-demangle.c:774 #2 0x555911cd56a1 in demangle_path rust-demangle.c:696 #3 0x555911cd5e48 in demangle_path rust-demangle.c:774 #4 0x555911cd56a1 in demangle_path rust-demangle.c:696 ... #247 0x555911cd5e48 in demangle_path rust-demangle.c:774 #248 0x555911cd56a1 in demangle_path rust-demangle.c:696 #249 0x555911cd5e48 in demangle_path rust-demangle.c:774 #250 0x555911cd56a1 in demangle_path rust-demangle.c:696 We also attach the full stack trace in the attachment. **Step to reproduce** We configured c++filt using=20 $ CFLAGS=3D"-g -O0 -fsanitize=3Daddress" ./configure --disable-shared --enable-targets=3Dall ,and built it using=20 $ make -j10; make install=20 ,and run it with: $ ./c++filt @ The input file is in the attachment. **Environment** - OS: Ubuntu 18.04.5 LTS - GCC version: gcc 7.5.0 - binutils version: commit (7de7786bb7db5159fc8a7bfa3df72381ff16a38c) of ma= ster branch on sourceware git (https://sourceware.org/git/?p=3Dbinutils-gdb.git;a=3Dtree;h=3D7de7786bb7db= 5159fc8a7bfa3df72381ff16a38c;hb=3D7de7786bb7db5159fc8a7bfa3df72381ff16a38c) Thank you.=