Change in osmo-trx[master]: ChannelizerBase: Fix ASan alloc-dealloc-mismatch

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Nov 1 17:40:52 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/11570


Change subject: ChannelizerBase: Fix ASan alloc-dealloc-mismatch
......................................................................

ChannelizerBase: Fix ASan alloc-dealloc-mismatch

Fixes following Adress Sanitizer warning:
=================================================================
==27120==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x60c00003d900
    #0 0x7f2f216de421 in operator delete(void*, unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:151
    #1 0x561641ce18b7 in ChannelizerBase::~ChannelizerBase() (/build/new/out/bin/osmo-trx-uhd+0x4a8b7)
    #2 0x561641ce1cad in Channelizer::~Channelizer() (/build/new/out/bin/osmo-trx-uhd+0x4acad)
    #3 0x561641cd5160 in RadioInterfaceMulti::close() (/build/new/out/bin/osmo-trx-uhd+0x3e160)
    #4 0x561641cd5047 in RadioInterfaceMulti::~RadioInterfaceMulti() (/build/new/out/bin/osmo-trx-uhd+0x3e047)
    #5 0x561641cd5093 in RadioInterfaceMulti::~RadioInterfaceMulti() (/build/new/out/bin/osmo-trx-uhd+0x3e093)
    #6 0x561641ca3fdd in trx_stop() (/build/new/out/bin/osmo-trx-uhd+0xcfdd)
    #7 0x561641ca4b32 in main (/build/new/out/bin/osmo-trx-uhd+0xdb32)
    #8 0x7f2f1f555222 in __libc_start_main (/usr/lib/libc.so.6+0x24222)
    #9 0x561641ca195d in _start (/build/new/out/bin/osmo-trx-uhd+0xa95d)

0x60c00003d900 is located 0 bytes inside of 128-byte region [0x60c00003d900,0x60c00003d980)
allocated by thread T0 here:
    #0 0x7f2f216dcf19 in operator new[](unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:93
    #1 0x561641ce142d in ChannelizerBase::init() (/build/new/out/bin/osmo-trx-uhd+0x4a42d)
    #2 0x561641cd5865 in RadioInterfaceMulti::init(int) (/build/new/out/bin/osmo-trx-uhd+0x3e865)
    #3 0x561641ca1cb7 in makeRadioInterface(trx_ctx*, RadioDevice*, int) (/build/new/out/bin/osmo-trx-uhd+0xacb7)
    #4 0x561641ca44c6 in trx_start(trx_ctx*) (/build/new/out/bin/osmo-trx-uhd+0xd4c6)
    #5 0x561641ca4b05 in main (/build/new/out/bin/osmo-trx-uhd+0xdb05)
    #6 0x7f2f1f555222 in __libc_start_main (/usr/lib/libc.so.6+0x24222)

SUMMARY: AddressSanitizer: alloc-dealloc-mismatch /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cc:151 in operator delete(void*, unsigned long)
==27120==HINT: if you don't care about these errors you may set ASAN_OPTIONS=alloc_dealloc_mismatch=0
==27120==ABORTING

Change-Id: Ib7c98ae478f319573dd86a0d2cb264f676bb3859
---
M Transceiver52M/ChannelizerBase.cpp
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/70/11570/1

diff --git a/Transceiver52M/ChannelizerBase.cpp b/Transceiver52M/ChannelizerBase.cpp
index 8223dba..430e260 100644
--- a/Transceiver52M/ChannelizerBase.cpp
+++ b/Transceiver52M/ChannelizerBase.cpp
@@ -239,7 +239,7 @@
 
 	for (size_t i = 0; i < m; i++) {
 		free(subFilters[i]);
-		delete hist[i];
+		delete[] hist[i];
 	}
 
 	fft_free(fftInput);

-- 
To view, visit https://gerrit.osmocom.org/11570
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7c98ae478f319573dd86a0d2cb264f676bb3859
Gerrit-Change-Number: 11570
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181101/502d263f/attachment.htm>


More information about the gerrit-log mailing list