-
-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The code uses delete operator for the object created via placement new operator. This is non-conformant and should be probably replaced via storage->~storage() followed by ::operator delete(mem); for the ptr itself.
It also invokes asan crash:
0x6060002b5560 in thread T0:
object passed to delete has wrong type:
size of the allocated type: 56 bytes;
size of the deallocated type: 16 bytes.
#0 0x49eba7 in operator delete(void*, unsigned long) (/usr/bin/rspamd+0x49eba7)
#1 0x7f323b89e558 in ankerl::v1_0_0::svector<unsigned int, 4ul>::realloc(unsigned long) (/usr/lib64/rspamd/librspamd-server.so+0x4c7558)
0x6060002b5560 is located 0 bytes inside of 56-byte region [0x6060002b5560,0x6060002b5598)
allocated by thread T0 here:
#0 0x49db47 in operator new(unsigned long) (/usr/bin/rspamd+0x49db47)
#1 0x7f323b89e1ce in ankerl::v1_0_0::svector<unsigned int, 4ul>::realloc(unsigned long) (/usr/lib64/rspamd/librspamd-server.so+0x4c71ce)
To Reproduce
Steps to reproduce the behavior:
- Build any test with
gccasan
Expected behavior
No crash.
System (please complete the following information):
- OS: Centos 7
- Compiler: gcc 8
- Version: master branch
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working