refactor: use curl_global_init_mem with pg allocators #223
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uses
curl_global_init_mem(CURL_GLOBAL_DEFAULT, net_malloc, net_free, net_realloc, net_strdup, net_calloc)
to keep better track of memory allocation by curl.The aim is to fix #216.
Unfortunately this currently segfaults when reaching 2 iterations:
The logs:
Using
gdb
(via conveniencesudo xpg gdb
) will show that this will always fail when hitting curl functions:Which are called when using
curl_multi_socket_action
in our codebase inpg_net/src/worker.c
Lines 320 to 336 in a7792bf
Unfortunately this is quite hard to debug, it might be a bug in curl itself.