Spent some time on studying the five SFML functions in the back trace:
sf::priv::getAtom(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)
sf::priv::WindowImplX11::setProtocols()
sf::priv::WindowImplX11::WindowImplX11(unsigned long)
sf::priv::WindowImpl::create(unsigned long)
sf::Window::create(unsigned long, sf::ContextSettings const&)
Compared version 2.1, which works for certain, and version 2.3.2, which gives the error for certain. Both
sf::priv::WindowImpl::create(unsigned long) and
sf::Window::create(unsigned long, sf::ContextSettings const&) are the same in both versions - there are no changes there.
There's some differences in
sf::priv::WindowImplX11::WindowImplX11(unsigned long), although only one seems relevant - the newer one makes a call to
sf::priv::WindowImplX11::setProtocols(), which exists only in 2.3.2, but not in 2.1.
The first thing
setProtocols does, on its side, is
xcb_atom_t wmProtocols = getAtom("WM_PROTOCOLS");, and according to the backtrace, the non-SFML function, in which the error occurs is exactly there. However, I couldn't find
getAtom in the 2.3.2 source. I wonder what it does. Is it essential?
It'd be a good idea to read on the system functions further above in the backtrace:
#0 0x00007ffff4ec7770 in gdk_x_error (display=0x75d000, error=0x7fffffffdec0) at gdkmain-x11.c:458
#1 0x00007fffeff476fd in _XError (dpy=dpy@entry=0x75d000, rep=rep@entry=0x9c3db0) at XlibInt.c:1434
#2 0x00007fffeff44627 in handle_error (dpy=0x75d000, err=0x9c3db0, in_XReply=<optimized out>) at xcb_io.c:199
#3 0x00007fffeff446e5 in handle_response (dpy=0x75d000, response=0x9c3db0, in_XReply=<optimized out>)
at xcb_io.c:311
#4 0x00007fffeff455f8 in _XReply (dpy=dpy@entry=0x75d000, rep=rep@entry=0x7fffffffe0a0, extra=extra@entry=0, discard=discard@entry=1) at xcb_io.c:621
#5 0x00007fffeff302ff in XInternAtom (dpy=dpy@entry=0x75d000, name=0x7fffffffe1c0 "WM_PROTOCOLS", onlyIfExists=onlyIfExists@entry=0) at IntAtom.c:181
gdk_x_error,
_XError and
handle_error seem to be only for error handling and reporting. This leaves us with only
handle_response,
_XReply and
XInternAtom to investigate.
I don't really know how to interpret the data in the brackets, but looking at
name=0x7fffffffe1c0 "WM_PROTOCOLS", onlyIfExists=onlyIfExists@entry=0, it seems like WM_PROTOCOLS is some entry that is missing. This further feeds my gut feelings that it's about gtk2 incompability and need to upgrade to gtk3. The latter, however, had proven troublesome in the past.
Searches like "WM_PROTOCOLS X window system error" don't turn up anything immediately seeming relevant.
Here's what Linux man page has to say about XInternAtom:
Atom XInternAtom(Display *display, char *atom_name, Bool only_if_exists);
atom_name
Specifies the name associated with the atom you want returned.
display
Specifies the connection to the X server.
only_if_exists
Specifies a Boolean value that indicates whether the atom must be created.
The XInternAtom function returns the atom identifier associated with the specified atom_name string. If only_if_exists is False, the atom is created if it does not exist. Therefore, XInternAtom can return None. If the atom name is not in the Host Portable Character Encoding, the result is implementation-dependent. Uppercase and lowercase matter; the strings ''thing'', ''Thing'', and ''thinG'' all designate different atoms. The atom will remain defined even after the client's connection closes. It will become undefined only when the last connection to the X server closes.
XInternAtom can generate BadAlloc and BadValue errors.
From what I can understand, a BadValue error is returned only when only_if_exists is true and the atom indentifier with such atom_name doesn't exist. But only_if_exists in this case is false, so this leaves BadAlloc as the only option. This is the trace to begin with next time. That, and reading the links I've posted above.