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

Suspected Go 1.22-1.23 CGO regressions/crashes (hopefully fixed in Go 1.24) #65

Open
Ullanar opened this issue Nov 12, 2024 · 4 comments
Labels
crash the issue resulted in the engine crashing panic the issue resulted in a Go panic windows affects windows

Comments

@Ullanar
Copy link

Ullanar commented Nov 12, 2024

Recently discovered that scene instantiation on Windows stopped working (while Linux builds continue to function normally). The issue started appearing about 2 weeks ago.

Environment

  • Windows 11
  • Go: tested with 1.23.3, 1.23.2, and ^1.22
  • Godot: 4.3

Steps to Reproduce

  1. Build the project on Windows using gd run (or build for Windows from any environment)
  2. Try to instantiate any scene using code like:
dialogUI, ok2 := Resource.Load[PackedScene.Advanced](dialogUIScenePath)
if !ok2 {
    return
}
dialogInstance := dialogUI.Instantiate(PackedScene.GenEditStateDisabled)

Current Behavior

  1. Fails during .Instantiate() call with error:
fatal error: runtime: stack split at bad time
  1. Issue occurs both when:
    • Building directly on Windows
    • Cross-compiling for Windows from Linux

Critical Observation

Previously built releases from earlier versions continue working properly. However, if you checkout these older tags now and try to build them - they will fail with the same issue. This suggests that something fundamental changed in how the builds are handled.

Expected Behavior

Scene should instantiate successfully as it does on Linux platform.

Additional Information

  1. Logs contain multiple failed goroutines, which is expected as we actively use goroutines in node implementations. But definitely not all of failed goroutines was initialized by our code
  2. In logs probably most issue related part starts from 25 string

error_log.txt

@Splizard
Copy link
Contributor

There is a c-shared regression in Go 1.22.5 through to the currently released version of Go 1.23, perhaps this is related? golang/go#68285
You could try using an earlier version of Go than 1.22.5 or rebuild Go using the latest master branch to see if this makes a difference, let me know if the issue is still reproducible.

@Ullanar
Copy link
Author

Ullanar commented Nov 13, 2024

Reproducible on go 1.24 from source

Probably it also can be somehow related
golang/go#68760

@Splizard
Copy link
Contributor

Have you tried reverting the Go commit mentioned in the issue? Will help rule out whether this is related or just some unsafe complication on Windows.
golang/go#68760 (comment)

@Splizard
Copy link
Contributor

Splizard commented Jan 6, 2025

@Ullanar I think there have been more fixes added to Go 1.24 if you could try to reproduce again? I've been using Go 1.24 since this issue cropped up without issues.

@Splizard Splizard changed the title Bug: Scene Instantiation Fails on Windows Platform Bug: Scene Instantiation Fails on Windows Platform with Go 1.22-1.23 Jan 27, 2025
@Splizard Splizard changed the title Bug: Scene Instantiation Fails on Windows Platform with Go 1.22-1.23 Suspected Go 1.22-1.23 CGO regressions/crashes (hopefully fixed in Go 1.24) Jan 29, 2025
@Splizard Splizard added crash the issue resulted in the engine crashing panic the issue resulted in a Go panic windows affects windows labels Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash the issue resulted in the engine crashing panic the issue resulted in a Go panic windows affects windows
Projects
None yet
Development

No branches or pull requests

2 participants