Monday, February 10, 2020

X11 is haunted

After trying off and on for a week now to get GRasterSurface working on Linux, I can only conclude that X11 is haunted by a malicious poltergeist. I can't find any other reason that the XPutImage function should freeze the test program every time it's called from another thread than main, except for the times where it doesn't and closes immediately instead. Yet the code all works fine if stepped through in the debugger instead of run normally, and every piece of logic works fine with XPutImage commented out.

I spent eight hours yesterday trying everything I could think of to fix the problem, then when I ran out of ideas, everything Lari and three classmates could think of, and the only deviation in behavior was a handful of things causing crashes instead of freezes. Ultimately, I simply don't know enough about how GThreadShared, GConcurrent, or X11 work at a low level to be able to identify the problem, and after three or four hours of suggestions that didn't fix the problem, Lari told me to just make Linux be single-threaded and document every attempted fix for future reference.

Sometimes the bug wins, and you just have to cut your losses and move on.

No comments:

Post a Comment