URL:
<https://savannah.gnu.org/bugs/?64892>
Summary: [tbl] alloc-dealloc-mismatch with
"-fsanitize=address"
Group: GNU roff
Submitter: bjarniig
Submitted: Mon 13 Nov 2023 11:47:02 PM UTC
Category: Preprocessor tbl
Severity: 3 - Normal
Item Group: Warning/Suspicious behaviour
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Mon 13 Nov 2023 11:47:02 PM UTC By: Bjarni Ingi Gislason <bjarniig>
Subject: tbl: alloc-dealloc-mismatch with "-fsanitize=address"
The software was compiled with gcc ((Debian 13.2.0-5) 13.2.0) with
"-fsanitize=address" giving warnings, and when running "test-groff -t
-man -ww -z strcpy.3""
=================================================================
==91730==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator
delete []) on 0x604000000010
#0 0x7f4c462d9c68 in operator delete[](void*)
../../../../src/libsanitizer/asan/asan_new_delete.cpp:155
#1 0x55e441522d45 in block_entry::~block_entry()
(/home/bg/git/groff/build/tbl+0x23d45) (BuildId:
7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#2 0x55e441543742 in left_block_entry::~left_block_entry()
(/home/bg/git/groff/build/tbl+0x44742) (BuildId:
7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#3 0x55e441526ca1 in table::~table()
(/home/bg/git/groff/build/tbl+0x27ca1) (BuildId:
7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#4 0x55e44151e161 in process_table(table_input&)
(/home/bg/git/groff/build/tbl+0x1f161) (BuildId:
7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#5 0x55e44151e970 in process_input_file(_IO_FILE*)
(/home/bg/git/groff/build/tbl+0x1f970) (BuildId:
7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#6 0x55e44150f31d in main (/home/bg/git/groff/build/tbl+0x1031d) (BuildId:
7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#7 0x7f4c45c456c9 in __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
#8 0x7f4c45c45784 in __libc_start_main_impl ../csu/libc-start.c:360
#9 0x55e44150fb60 in _start (/home/bg/git/groff/build/tbl+0x10b60)
(BuildId: 7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
0x604000000010 is located 0 bytes inside of 45-byte region
[0x604000000010,0x60400000003d)
allocated by thread T0 here:
#0 0x7f4c462d85bf in __interceptor_malloc
../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69
#1 0x55e44154cfa3 in string::extract() const
(/home/bg/git/groff/build/tbl+0x4dfa3) (BuildId:
7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#2 0x55e441529ad1 in table::add_entry(int, int, string const&,
entry_format const*, char const*, int) (/home/bg/git/groff/build/tbl+0x2aad1)
(BuildId: 7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#3 0x55e44151ab34 in process_data(table_input&, format*, options*)
(/home/bg/git/groff/build/tbl+0x1bb34) (BuildId:
7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#4 0x55e44151e141 in process_table(table_input&)
(/home/bg/git/groff/build/tbl+0x1f141) (BuildId:
7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#5 0x55e44151e970 in process_input_file(_IO_FILE*)
(/home/bg/git/groff/build/tbl+0x1f970) (BuildId:
7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#6 0x55e44150f31d in main (/home/bg/git/groff/build/tbl+0x1031d) (BuildId:
7ab334cfd6181c9ca70b997de2ca11b5dc765cd7)
#7 0x7f4c45c456c9 in __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
SUMMARY: AddressSanitizer: alloc-dealloc-mismatch
../../../../src/libsanitizer/asan/asan_new_delete.cpp:155 in operator
delete[](void*)
==91730==HINT: if you don't care about these errors you may set
ASAN_OPTIONS=alloc_dealloc_mismatch=0
==91730==ABORTING
troff: warning: expected numeric expression, got end of input
troff: error: automatically ending diversion '3table' on exit
troff: error: can't continue page ejection because vertical position traps
disabled
troff: error: can't continue page ejection because vertical position traps
disabled
[...]
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64892>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/