Skip to content

Commit f836dc0

Browse files
committed
[Compute] Added virtual destructor to make ASAN happy.
Without it, ASAN complains as follows : ==1451==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x602000016310 in thread T0: object passed to delete has wrong type: size of the allocated type: 16 bytes; size of the deallocated type: 1 bytes. #0 0x7fac9f23224f in operator delete(void*, unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:172 #1 0x7fac84f60895 in igcc::driver::DriverImpl::compile() (/opt/workspace/build/lib/libigc.so.1+0xe9d895) #2 0x7fac8501a20c in IGC::IgcOclTranslationCtx<0ul>::Impl::Translate(unsigned long, CIF::Builtins::Buffer<1ul>*, CIF: :Builtins::Buffer<1ul>*, CIF::Builtins::Buffer<1ul>*, CIF::Builtins::Buffer<1ul>*, CIF::Builtins::Buffer<1ul>*, CIF::Buil tins::Buffer<1ul>*, unsigned int, void*) const (/opt/workspace/build/lib/libigc.so.1+0xf5720c) #3 0x7fac8501c8ce in IGC::IgcOclTranslationCtx<1ul>::TranslateImpl(unsigned long, CIF::Builtins::Buffer<1ul>*, CIF::B uiltins::Buffer<1ul>*, CIF::Builtins::Buffer<1ul>*, CIF::Builtins::Buffer<1ul>*, unsigned int) [clone .localalias] (/opt/ workspace/build/lib/libigc.so.1+0xf598ce) #4 0x7fac9f01f317 (/lib/x86_64-linux-gnu/libocloc.so+0xa3317) #5 0x7fac9f01f844 (/lib/x86_64-linux-gnu/libocloc.so+0xa3844) #6 0x7fac9f05085e (/lib/x86_64-linux-gnu/libocloc.so+0xd485e) #7 0x7fac9f04dbe7 (/lib/x86_64-linux-gnu/libocloc.so+0xd1be7) #8 0x7fac9f011381 in oclocInvoke (/lib/x86_64-linux-gnu/libocloc.so+0x95381) #9 0x559f99e3b786 in main (/usr/bin/ocloc+0x786) #10 0x7fac9ed7cd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #11 0x7fac9ed7ce3f in __libc_start_main_impl ../csu/libc-start.c:392 #12 0x559f99e3b7b4 in _start (/usr/bin/ocloc+0x7b4) 0x602000016310 is located 0 bytes inside of 16-byte region [0x602000016310,0x602000016320) allocated by thread T0 here: #0 0x7fac9f2311e7 in operator new(unsigned long) ../../../../src/libsanitizer/asan/asan_new_delete.cpp:99 #1 0x7fac84f601c2 in igcc::driver::DriverImpl::compile() (/opt/workspace/build/lib/libigc.so.1+0xe9d1c2)
1 parent bafbb86 commit f836dc0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

igc-compute/lib/Driver/Action.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ template <typename ActionImpl, typename InT> class Action {
3737
}
3838

3939
auto getOutput() { return static_cast<ActionImpl *>(this)->getOutput(); }
40+
41+
virtual ~Action() = default;
4042
};
4143

4244
template <typename ActionImpl>

0 commit comments

Comments
 (0)