Skip to content

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

@ccie18473

Description

@ccie18473

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions