actix / actix/actix-web

thread 'actix-server worker x' has overflowed its stack fatal runtime error: stack overflow

Open
#3,630 1 comment 0 reactions 0 assignees View on GitHub
needs-investigation
Dominant language
Rust
Stars
24.8k
Forks
1.9k
Avg merge
23h 10m
Merged PRs (30d)
26

Description

## Expected Behavior

The test executes till the end and the program exits with no errors.

## Current Behavior

The program, on some of the github actions machines, stops suddenly with the error :
```
thread 'actix-server worker x' has overflowed its stack
fatal runtime error: stack overflow
error: test failed, to rerun pass ....
```
Where x is some integer usually between 0 and 3

A huge problem is that **I could not** reproduce this bug on any of my local setups. It often, however, happens on CI/CD pipelines especially on RedHat machines (but sometimes on ubuntu or mac too !)

## Possible Solution

I have no idea

## Steps to Reproduce (for bugs)

Sorry but I failed to create a standalone program that produces this. I have a huge server that handles requests to basically do some encryption operations. In the test that fails, many tokio threads are spawned to perform a lot of operations where the Actix server is sollicitated multiple times
Currently I tried the following ideas that did not work :
- Using backoff time for the tokio threads that fail to get what they want on first attemps (they will keep pinging the server till they get the reply they want and then they terminate)
- Instantiating the whole test server on the heap (in a Box<...>

## Your Environment

- Machine : RHEL9. Fails sometimes on ubuntu 24_04 if I make the test more "demanding"
- Rust Version (I.e, output of `rustc -V`): rustc 1.85.0-nightly (d117b7f21 2024-12-31)
- Actix Web Version:
actix-rt = "2.10"
actix-server = { version = "2.5", default-features = false }
actix-web = { version = "4.9", default-features = false }

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.