public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "irfanariq at kaist dot ac.kr" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-102130-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102130

            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=51378&action=edit
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:
==617==ERROR: AddressSanitizer: stack-overflow on address 0x7fffe1fa7ff8 (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 

$ CFLAGS="-g -O0 -fsanitize=address" ./configure --disable-shared
--enable-targets=all

,and built it using 

$ make -j10; make install 

,and run it with:

$ ./c++filt @<input file>

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 master
branch on sourceware git
(https://sourceware.org/git/?p=binutils-gdb.git;a=tree;h=7de7786bb7db5159fc8a7bfa3df72381ff16a38c;hb=7de7786bb7db5159fc8a7bfa3df72381ff16a38c)

Thank you.

             reply	other threads:[~2021-08-30 17:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 17:11 irfanariq at kaist dot ac.kr [this message]
2021-08-31  7:20 ` [Bug demangler/102130] " rguenth at gcc dot gnu.org
2021-08-31 12:45 ` irfanariq at kaist dot ac.kr
2021-09-05 10:57 ` amodra at gmail dot com
2021-12-27  8:24 ` pinskia at gcc dot gnu.org

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=bug-102130-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).