Check duplicate issues.
Description
R__memcompress crashed from civetweb threads.
Main reason - size of struct bits_internal_state structure approximately 128K which is bigger than default stack size of civetweb thread (approx 100K).
Actually there is compile definition DYN_ALLOC which allows to allocate this memory dynamically,
but it is never used/defined. And even worse. If one enable such definition - allocated memory never will be released while R__lm_free() never called.
Proposed solution - implement R__memcompress_dynamic() with dynamically allocated struct bits_internal_state.
No change of API, no extra work - just new function with same functionality. And of course add everywhere R__lm_free() calls
Reproducer
Compile ROOT with modified flags for RHTTP library.
Add to net/http/CMakeLists.txt, line 75 following statement:
target_compile_definitions(RHTTP PRIVATE -DUSE_STACK_SIZE=102400)
Compile root and run:
[shell] net/http/test/testHttpServer
Problem appears when civetweb compiled in #22731
ROOT version
master, all previous versions as well
Installation method
build from source
Operating system
OpenSUSE
Additional context
No response
Check duplicate issues.
Description
R__memcompresscrashed fromcivetwebthreads.Main reason - size of
struct bits_internal_statestructure approximately 128K which is bigger than default stack size ofcivetwebthread (approx 100K).Actually there is compile definition
DYN_ALLOCwhich allows to allocate this memory dynamically,but it is never used/defined. And even worse. If one enable such definition - allocated memory never will be released while
R__lm_free()never called.Proposed solution - implement
R__memcompress_dynamic()with dynamically allocatedstruct bits_internal_state.No change of API, no extra work - just new function with same functionality. And of course add everywhere
R__lm_free()callsReproducer
Compile ROOT with modified flags for
RHTTPlibrary.Add to net/http/CMakeLists.txt, line 75 following statement:
Compile root and run:
Problem appears when
civetwebcompiled in #22731ROOT version
master, all previous versions as well
Installation method
build from source
Operating system
OpenSUSE
Additional context
No response