-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Description:
The program encounters a stack overflow error after running a series of episodes, causing it to crash with the following message:
thread 'main' has overflowed its stack
error: process didn't exit successfully: `target\debug\rl-examples.exe` (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)
This issue typically indicates that the program is consuming more stack memory than is allocated, which could be due to excessive recursion, large stack-allocated variables, or improper thread stack size settings.
Steps to Reproduce:
- Navigate to the project directory:
cd burn-rl-examples - Compile and run the program:
cargo run
- Observe the program processing a series of episodes. For example:
{"episode": 0, "reward": 44.0000, "duration": 44} {"episode": 1, "reward": 82.0000, "duration": 82} ... {"episode": 52, "reward": 87.0000, "duration": 87} - The program crashes after episode 52 with the following error:
thread 'main' has overflowed its stack error: process didn't exit successfully: `target\debug\rl-examples.exe` (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)
Expected Behavior:
The program should handle memory allocation and recursion (if any) efficiently and execute without crashing due to stack overflow.
Observed Behavior:
The program crashes after a specific number of episodes due to stack overflow.
Suggested Fixes:
- Optimize recursive logic or convert to iterative implementations.
- Allocate large variables on the heap using
BoxorVecinstead of the stack. - Explicitly increase the thread stack size using
std::thread::Builderfor custom threads. - Check for and fix any unintended infinite recursion.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
