public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug demangler/102132] New: [nm] Stack overflow in demangler_path
@ 2021-08-30 17:16 irfanariq at kaist dot ac.kr
  2021-08-31  7:22 ` [Bug demangler/102132] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: irfanariq at kaist dot ac.kr @ 2021-08-30 17:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102132
           Summary: [nm] Stack overflow in demangler_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 51379
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51379&action=edit
poc and full stack trace

Hello,

We are currently working on fuzz testing feature, and we found a stack overflow
error on nm.

The stack traces are as follow:
==618==ERROR: AddressSanitizer: stack-overflow on address 0x7fff51a74ea8 (pc
0x7f55b9e42509 bp 0x7fff51a75710 sp 0x7fff51a74e80 T0)
    #0 0x7f55b9e42508  (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x79508)
    #1 0x5592e730643c in str_buf_append rust-demangle.c:1493
    #2 0x5592e7306483 in str_buf_demangle_callback rust-demangle.c:1500
    #3 0x5592e72fffc4 in print_str rust-demangle.c:273
    #4 0x5592e7302b82 in demangle_path rust-demangle.c:746
    #5 0x5592e7302c00 in demangle_path rust-demangle.c:756
    #6 0x5592e7303d65 in demangle_type rust-demangle.c:1031
    #7 0x5592e7303cd3 in demangle_type rust-demangle.c:1024
    #8 0x5592e7303348 in demangle_type rust-demangle.c:903
    #9 0x5592e7302b91 in demangle_path rust-demangle.c:747
    #10 0x5592e7302c00 in demangle_path rust-demangle.c:756
    #11 0x5592e7303d65 in demangle_type rust-demangle.c:1031
    #12 0x5592e7303cd3 in demangle_type rust-demangle.c:1024
    #13 0x5592e7303348 in demangle_type rust-demangle.c:903
    #14 0x5592e7302b91 in demangle_path rust-demangle.c:747
    #15 0x5592e7302c00 in demangle_path rust-demangle.c:756
    ...

The full stack trace is attached.

**Step to reproduce**

We configured nm using 

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

, and built it using 

$ make -j10; make install

, and run it with:

$ ./nm -C <input file>

The input file is attached.

**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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-27  8:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 17:16 [Bug demangler/102132] New: [nm] Stack overflow in demangler_path irfanariq at kaist dot ac.kr
2021-08-31  7:22 ` [Bug demangler/102132] " rguenth at gcc dot gnu.org
2021-08-31  7:26 ` pinskia at gcc dot gnu.org
2021-08-31 12:46 ` irfanariq at kaist dot ac.kr
2021-09-05 11:00 ` amodra at gmail dot com
2021-12-27  8:24 ` pinskia at gcc dot gnu.org

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).