Skip to content

Raygui -Access violation crash in GuiTextBox on Windows - Exception 0xc0000005 #507

@janicaleksander

Description

@janicaleksander

Application crashes with access violation when calling gui.TextBox() from raylib-go/raygui on Windows.

Exception 0xc0000005 0x0 0xc001b94000 0x7bed93
PC=0x7bed93
signal arrived during external code execution

github.com/gen2brain/raylib-go/raygui._Cfunc_GuiTextBox({0x44070000, 0x43b40000, 0x43480000, 0x42700000}, 0xc001b93ff8, 0x40, 0x0)
_cgo_gotypes.go:835 +0x50
github.com/gen2brain/raylib-go/raygui.TextBox({0x0?, 0x0?, 0xecd400?, 0x0?}, 0xc0001feab0, 0x40, 0x0)
C:/Users/Aleksander/go/pkg/mod/github.com/gen2brain/raylib-go/[email protected]/raygui.go:980 +0x158

gui.TextBox(bounds, &textString, 64, true)

Issue:
The crash occurs consistently when calling gui.TextBox(). This appears to be a CGO-related issue where the Go garbage collector may be moving string memory while C code is accessing it, causing an invalid memory access.

Expected Behavior:
TextBox should render without crashing.

Actual Behavior:
Application terminates with access violation exception.

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