-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Found while testing the fix for #6731.
Setting aside the leaks from zlib and fontconfig, we've got the following for tests/main.R:
Direct leak of 125829120 byte(s) in 15 object(s) allocated from:
#1 0x7f43e5ea224a in fwriteMain src/fwrite.c:792
#2 0x7f43e5ea7638 in fwriteR src/fwriteR.c:310
plus a few tens of megabytes from other objects allocated in the same place.
Looks like this allocation:
Line 792 in 1aa92bc
| char *buffPool = malloc(alloc_size); |
are not always matched with this deallocation:
Line 1096 in 1aa92bc
| free(buffPool); |
(Some allocations done internally by zlib are also leaks, but LeakSanitizer doesn't trace them to a specific line in data.table.)
We've got quite a few calls to STOP() between the two lines, and most of those don't release the memory allocated for buffPool. This bisects to e0abdfc, i.e., #6393. Before this commit, tests/main.R finishes without any notes from LeakSanitizer.
Edit: the title used to say "leak in fread", which was not correct at all.