-
Notifications
You must be signed in to change notification settings - Fork 221
Description
There appears to be a memory in the ix::Websocket instantiation. When I resize a vector then memcpy it, I get a UB overflow error. This only appears if I simply include the line:
// Attempt to connect to websocket server websocket = make_shared<ix::WebSocket>();
I do not run the line; the function is never called. Simply having this line inside a method and importing the file will cause a memory leak:
test0.
test1.
test2.
=================================================================
==7989==ERROR: AddressSanitizer: container-overflow on address 0x623000001d00 at pc 0x000108f5dbe1 bp 0x7ff7b8911270 sp 0x7ff7b8910a20
WRITE of size 6200 at 0x623000001d00 thread T0
If I do not include the file with a method that contains that line, my program runs fine after the memcpy procedure:
test0.
test1.
test2.
test3.
Not sure if it's one of the many dependencies (which is still serious enough to note documentation updates, please if you will) or the ixWebSocket itself. I know that C++ imports and sets up many internal pointers and memory allocations if it sees anywhere in the code that a class is being instantiated, whether or not that code is ever ran; so simply importing a file (again, not calling the method or instance) is causing this memory leak. I spent a day narrowing down the memory leak. It is specifically coming from that line above which is never called; it is simply located inside a test file that is merely imported. Nothing else in the file has any issues, I tried everything. It is that line, and that line alone—indicating there is in fact a memory leak.
Mac Intel binaries.