summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasil Velichkov <vvvelichkov@gmail.com>2021-11-23 14:22:08 +0200
committermormj <34754695+mormj@users.noreply.github.com>2021-12-02 17:37:43 -0500
commit741522bac4e67c6e22ece3b580abf88c046c446e (patch)
tree7ef0853ba079c5ee2f6bebbb323122712d559b38
parent696af48e7f245bc85f3c62cae496b35882c01b2c (diff)
runtime: Fix alloc-dealloc-mismatch in buffer_single_mapped
ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x631000014800 #0 0x7ffbdc10f9d7 in operator delete(void*, unsigned long) (/lib64/libasan.so.6+0xad9d7) #1 0x7ffbd8a6646f in std::default_delete<char>::operator()(char*) const /usr/include/c++/10/bits/unique_ptr.h:85 #2 0x7ffbd8a6646f in std::unique_ptr<char, std::default_delete<char> >::~unique_ptr() /usr/include/c++/10/bits/unique_ptr.h:361 #3 0x7ffbd8a6646f in gr::buffer_single_mapped::~buffer_single_mapped() /home/user/src/gnuradio/gnuradio-runtime/lib/buffer_single_mapped.cc:46 #4 0x7ffbd8c805c4 in gr::host_buffer::~host_buffer() /home/user/src/gnuradio/gnuradio-runtime/lib/host_buffer.cc:65 0x631000014800 is located 0 bytes inside of 65536-byte region [0x631000014800,0x631000024800) allocated by thread T0 here: #0 0x7ffbdc10ecb7 in operator new[](unsigned long) (/lib64/libasan.so.6+0xaccb7) #1 0x7ffbd8c73a60 in gr::host_buffer::do_allocate_buffer(unsigned long, unsigned long) /home/user/src/gnuradio/gnuradio-runtime/lib/host_buffer.cc:119 #2 0x7ffbd8fdaebf (/home/user/src/gnuradio/build/gnuradio-runtime/lib/libgnuradio-runtime.so.3.10.0git+0x3475ebf) Signed-off-by: Vasil Velichkov <vvvelichkov@gmail.com>
-rw-r--r--gnuradio-runtime/include/gnuradio/buffer_single_mapped.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnuradio-runtime/include/gnuradio/buffer_single_mapped.h b/gnuradio-runtime/include/gnuradio/buffer_single_mapped.h
index 5a731b01f9..b3a9fdefc6 100644
--- a/gnuradio-runtime/include/gnuradio/buffer_single_mapped.h
+++ b/gnuradio-runtime/include/gnuradio/buffer_single_mapped.h
@@ -120,7 +120,7 @@ protected:
block_sptr d_buf_owner; // block that "owns" this buffer
- std::unique_ptr<char> d_buffer;
+ std::unique_ptr<char[]> d_buffer;
/*!
* \brief constructor is private. Use gr_make_buffer to create instances.