Skip to content

Random crashes caused by incorrect goroutine stack size detection #5375

@digitalentity

Description

@digitalentity

I'm encountering random crashes with my test application, which is essentially blinky on steroids. The app code is here: https://github.com/digitalentity/tinygo_gotchas/blob/master/src/ticker_crash/main.go. This is an extract from a different up to create a smaller repro environment.

Nothing really complicated, but it sometimes dies with a message fatal error: undefined instruction with sp=0x20000fd4 pc=0x00000091 or similar to the console.

The biggest problem is that they are not deterministic - sometimes the app can run for hours, sometimes is crashes within minutes which makes debugging really hard. Right now I have it running under GDB for about 1h without any sign of issue.

I never saw crashes when using time.Sleep(), it started when I started adding time.Ticker for a more accurate intervals. I can't use Sleep because I need to reasonably accurately run the closed loop controller every 2ms and this inverval needs to be measured more or less accurately.

I would appreciate any pointers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions