XAllocID usage in libxview requires a new solution / problem in xcb_io.c
I am currently trying to compile SunOS libxview for MacOS x86_64/arm64. My repository is
https://github.com/21tesla/libxview-macos
From what I have read, there is a problem with the way XAllocID is called thereby producing the following error:
Assertion failed: (ret != inval_id), function _XAllocID, file xcb_io.c, line 520.
There was a solution suggested; however, it does not appear to work anymore. I believe the problem is tied a bad implementation of XAlloc in server.c where XAlloc is called too many times. The best comment on it I could find was from 11 years ago!
Looking at libX11 source code, it's obvious why this happens. Since XView is inherently not thread-safe, there is no multi-threading involved and XInitThreads() is never called, so dpy->lock is NULL and so _XIDHandler() is never called by XLockDisplay(), thus the xcb->next_xid field stays 'invalid_id'. I think this is a bug, and could be also one cause of https://bugs.freedesktop.org/show_bug.cgi?id=27552 and https://xcb.pdx.freedesktop.narkive.com/vsAJcfE3/calling-xallocid-twice-causes-assertion-ret-inval-id-failed >
thank you for any insight
logan donaldson