bugGprofng GUI - Bugs: bug #66676, Segfault in gp-display-text at...

 
 

bug #66676: Segfault in gp-display-text at Vector<Histable*>::destroy (this=0x4700c0) at ../../../binutils-gdb.git/gprofng/src/vec.h

Submitter:  Peter Kessler <peterkessler>
Submitted:  Thu 16 Jan 2025 11:38:34 PM UTC
   
 
Category:  None Severity:  2 - Minor
Item Group:  None Status:  Confirmed
Privacy:  Public Assigned to:  vmezentsev
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 17 Jan 2025 06:13:45 AM UTC, comment #1: 

You configured your build with --enable-gprofng-debug.
Delete it. It's only needed for my debugging :).
I agree that there is a bug when we call free() incorrectly.
I will fix this in the next release.

Vladimir Mezentsev <vmezentsev>
Group administrator
Thu 16 Jan 2025 11:38:34 PM UTC, original submission:  

This is a bug in gp-display-text, but I suspect it will affect gp-display-gui.

I am using my debug build of binutils-gdb, with the patch from Vladimir to avoid the segfault in DbeInstr::mapPCtoLine.  I see

$ gdb ~/Work/binutils-gdb+debug+patch/bld/INSTALL/bin/gp-display-text
(gdb) set args llama-batched-bench_ntg256.er -threads
(gdb) run
Excl. Total CPU   Name

    sec.      %
6252.254 100.00   <Total>
  81.987   1.31   Process 1, Thread 1
   0.480   0.01   Process 1, Thread 14
   0.480   0.01   Process 1, Thread 54
... 20298 lines elided.  All for unique thread numbers. ...
   0.180   0.00   Process 1, Thread 2582
   0.180   0.00   Process 1, Thread 3660
   0.180   0.00   Process 1, Thread 5701


Program received signal SIGSEGV, Segmentation fault.
0x0072500000000000 in ?? ()
Missing separate debuginfos, use: dnf debuginfo-install zlib-1.2.11-33.fc36.aarch64
(gdb) where
#0  0x0072500000000000 in ?? ()
#1  0x000040000017f2a4 in Vector<Histable*>::destroy (this=0x4700c0) at ../../../binutils-gdb.git/gprofng/src/vec.h:521
#2  0x00004000001725b8 in DbeSession::~DbeSession (this=0x462be0, __in_chrg=<optimized out>) at ../../../binutils-gdb.git/gprofng/src/DbeSession.cc:414
#3  0x000040000016d2f8 in DbeApplication::~DbeApplication (this=0x4622c0, __in_chrg=<optimized out>) at ../../../binutils-gdb.git/gprofng/src/DbeApplication.cc:63
#4  0x000000000040c99c in er_print::~er_print (this=0x4622c0, __in_chrg=<optimized out>) at ../../../binutils-gdb.git/gprofng/src/gp-display-text.cc:180
#5  0x000000000040c9bc in er_print::~er_print (this=0x4622c0, __in_chrg=<optimized out>) at ../../../binutils-gdb.git/gprofng/src/gp-display-text.cc:180
#6  0x000000000040c7e4 in main (argc=4, argv=0xfffffffff288) at ../../../binutils-gdb.git/gprofng/src/gp-display-text.cc:156
(gdb) up
#1  0x000040000017f2a4 in Vector<Histable*>::destroy (this=0x4700c0) at ../../../binutils-gdb.git/gprofng/src/vec.h:521
521     delete data[i];
(gdb) list
516
517 template <typename ITEM> inline void
518 Vector<ITEM>::destroy ()
519 {
520   for (long i = 0; i < count; i++)
521     delete data[i];
522   count = 0;
523 }
524
525 #endif /* _VEC_H */
(gdb) info locals
i = 511
(gdb) print count
$7 = 52554

We are only 511 elements into the array, but expect to get to 52554 elements.  There are a lot of threads in this application: gp-display-text has already listed 20304 of them.

If there are other things I should look at, please remind me that this is using /home/pkessler/tmp/llama_bench_20250115-1122_test/llama-batched-bench_ntg256.er so I can find it again.  I also have llama-batched-bench_npp1024.er, which exhibits the same (?) issue, also when `i` is 511, but `count` is only 6189.

Peter Kessler <peterkessler>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by kurtgoebel (Updated the item)
  • -email is unavailable- added by vmezentsev (Posted a comment)
  • -email is unavailable- added by peterkessler (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-01-23 kurtgoebel StatusNone Confirmed
    2025-01-17 vmezentsev Severity3 - Normal 2 - Minor
        Assigned toNone vmezentsev

    Back to the top

    Powered by Savane 3.15-4cd8.
    Corresponding source code