Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allegro_main! - thread '<unknown>' has overflowed its stack #24

Open
ccie18473 opened this issue Nov 25, 2023 · 0 comments
Open

allegro_main! - thread '<unknown>' has overflowed its stack #24

ccie18473 opened this issue Nov 25, 2023 · 0 comments

Comments

@ccie18473
Copy link

ccie18473 commented Nov 25, 2023

Hello Team,

Since I've been using RustAllegro, I never used allegro_main!. Today in order to troubleshoot an issue, I decided to use allegro_main!.

Then I got this:

thread '' has overflowed its stack
fatal runtime error: stack overflow
Aborted (core dumped)

I was able to get an workaround increasing the stack:

const STACK_SIZE: usize = 4 * 1024 * 1024;

allegro_main! {
// Spawn thread with explicit stack size
let child = thread::Builder::new()
.stack_size(STACK_SIZE)
.spawn(run)
.unwrap();

// Wait for thread to join
child.join().unwrap();

}

fn run() {
// game code
}

Nevertheless, I was able to solve my issue and got back using main() again without issues.

My question relates with allegro_main!. What does it do, why do we need it and do we really need to use it.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant