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

* [Bug demangler/102132] [nm] Stack overflow in demangler_path
  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 ` rguenth at gcc dot gnu.org
  2021-08-31  7:26 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-08-31  7:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
wrong bugzilla, libiberty is a component in the sourceware bugzilla.

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

* [Bug demangler/102132] [nm] Stack overflow in demangler_path
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-31  7:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> wrong bugzilla, libiberty is a component in the sourceware bugzilla.

GCC's copy of libiberty is/was considered the upstream copy at least at one
point.

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

* [Bug demangler/102132] [nm] Stack overflow in demangler_path
  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
  4 siblings, 0 replies; 6+ messages in thread
From: irfanariq at kaist dot ac.kr @ 2021-08-31 12:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Irfan Ariq <irfanariq at kaist dot ac.kr> ---
Okay, I will move it to sourceware bugzilla. Thank you

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

* [Bug demangler/102132] [nm] Stack overflow in demangler_path
  2021-08-30 17:16 [Bug demangler/102132] New: [nm] Stack overflow in demangler_path irfanariq at kaist dot ac.kr
                   ` (2 preceding siblings ...)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: amodra at gmail dot com @ 2021-09-05 11:00 UTC (permalink / raw)
  To: gcc-bugs

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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |amodra at gmail dot com
     Ever confirmed|0                           |1
            Version|unknown                     |12.0
   Last reconfirmed|                            |2021-09-05

--- Comment #4 from Alan Modra <amodra at gmail dot com> ---
Yes, gcc's libiberty is still considered upstream of binutils' copy.

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

* [Bug demangler/102132] [nm] Stack overflow in demangler_path
  2021-08-30 17:16 [Bug demangler/102132] New: [nm] Stack overflow in demangler_path irfanariq at kaist dot ac.kr
                   ` (3 preceding siblings ...)
  2021-09-05 11:00 ` amodra at gmail dot com
@ 2021-12-27  8:24 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-27  8:24 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 98886.

*** This bug has been marked as a duplicate of bug 98886 ***

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