Skip to content

R__memcompress fails with limited stack size #22938

Description

@linev

Check duplicate issues.

  • Checked for duplicates

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions