Comments (4)
hmm, where in the stack trace shows it is from "type checker"? And this can be filed as bug to GO right?
from cloud-game.
@giongto35, it's in the (*mspan).typePointersOfUnchecked line.
I don't think it is a bug in Go, but rather a race condition during frame encoding and multiple reinitializations of the x264 encoder.
It crashes randomly (right away or on a second attempt) with x264 (but not with vpx), on Windows (but not on cloudretro.io with Linux), on PSX Castlevania where it changes output resolution like crazy, each time recreating the encoder (but if you disable that recreation in the config pcsx.coreAspectRatio: false
, it works).
So I assume something has changed in the pointer checker of Go after v1.20, maybe it's way more strict now, and that naïve way of encoder's recreation won't fly anymore. ;/
Well, at least they fixed c-go stack collision introduced in version 1.21, which would burry Go for the project otherwise.
from cloud-game.
After a long debugging session, decided to revert everything back to 1.20 for now.
It crashes under Linux/Windows on Go 1.22 with h264 encoder only (any versions, any settings), when Go's GC is looping over uintptrs and crashing due to the mem corruption. https://tip.golang.org/src/runtime/mbitmap_allocheaders.go
It seems, there are some similar bugs out there in Go, but I couldn't reproduce this issue with an isolated unit test in order to post this bug formally onto the tracker.
Anyways. :/
Steps to reproduce:
- Compile with 1.22. (branch go1.22)
- Run some PSX games which change output resolution. (Castelvania, or bundled psxtest)
- Crash.
from cloud-game.
@giongto35, I think, I fixed it somehow ;/
Removed a wrapper to Go structure over the C x264_param_t structure and now it works, so it seems. Not sure why, but my guess that new allocator from 1.22 goes beyond mem bounds of this struct. That's possible because the Go wrapper is written a long time ago for older versions of x264 and if they change the order or the list of fields, you can easily go out of bounds (due to Go's structs padding or sizeof mismatch) when mapping an old struct to a new one from C.
cloud-game/pkg/encoder/h264/libx264.go
Lines 85 to 88 in 1a44b94
Will test it, then. Maybe, this will fix it. :/
from cloud-game.
Related Issues (20)
- Can I change the streaming screen to a desktop or a the program's ui? HOT 1
- handle save/load for no SRM cores HOT 1
- Issue with N64 emulation crashing on launch and crashing on share in docker image HOT 7
- Support function parameters when bypassing LibCo cores HOT 1
- make dev-run error~ HOT 1
- unable to use turn servers with credentials or multiple stun servers. HOT 4
- Only player one slot works HOT 1
- Investigate fatal: morestack on g0 after the migration to Go 1.21.0 HOT 1
- USB gamepad HOT 4
- Controllers do not work in the fullscreen mode HOT 6
- [Question] supported game system? HOT 10
- Port Libretro frontend to C
- Fix concurrent app start/close in the same room
- Reimplement aspect ratio
- can it support android app? HOT 6
- No games List HOT 1
- Add forced fullscreen option HOT 1
- Where are all the games stored? HOT 1
- dev run in windows failed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloud-game.