Open andymule opened 2 months ago
The problem is either a missing or an empty XResources database. I can't find where the actual file is on ubuntu, but I can say that inserting ANYTHING into the database fixes these crashes. I just did this xrdb -merge <<< "MyApp.background: white"
I'll poke around the code and see if I can't add a default database write before the read as a permanent workaround. This seems more like a bug on X11 library on WSL (maybe all of Ubuntu? idk)
In X11Window.swift you just need this string to not be nil and everything runs fine.
I dont actually understand what's supposed to be happening here so I'll leave it to you to patch properly. Thanks for your work!
@preconcurrency @MainActor func updateStoredMetaData(pixelSize: Size2? = nil) {
var resourceString: UnsafeMutablePointer<CChar>? = XResourceManagerString(xDisplay)
XrmInitialize() /* Need to initialize the DB before calling Xrm* functions */
if resourceString == nil {
resourceString = UnsafeMutablePointer<CChar>.allocate(capacity: 1)
}
I'm in WSL, but have no trouble running other graphics examples, like raylib stuff and xclock. I even made a test X11 app that calls
__strlen_avx2
(which is crashing in your example), and that works. Any ideas? Lots of dumps attached