boostorg / boostorg/beast

Documentation does not mention stack requirements

Open
#844 6 comments 0 reactions 0 assignees View on GitHub
Design Doc
Dominant language
C++
Stars
4.8k
Forks
694
Avg merge
12h 48m
Merged PRs (30d)
1

Description

```read``` or ```async_read``` operations may require "large" amounts of stack. The documentation should acknowledge this.

Example: https://github.com/boostorg/beast/blob/ffbe65f4c922e1b8d76e85434d0a8d3ee1c083e9/include/boost/beast/http/impl/basic_parser.ipp#L486
If the parser is used inside of a stackful coroutine, this may easily lead to stack overflow. A coroutine stack size is architecture dependent and the user may choose a size that is smaller than the default(64k IIRC), but the size should be at least ``` SIGSTKSZ```, which happens to be ```8196``` bytes on linux-amd64.

Additional related thing to consider: with split stacks enabled a large stack allocation might not necessarily improve performance over a dynamically allocated buffer.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.