Everything was working fine, when my game started crashing as follows (without recompiling):
Failed to initialize inotify, joystick connections and disconnections won't be notified
*** buffer overflow detected ***: /home/michal/zagadka/zagadka terminated
======= Backtrace: =========
[...]
Gdb shows this:
#0 0x00007ffff6ee6425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff6ee9b8b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff6f2439e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007ffff6fba817 in __fortify_fail () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00007ffff6fb9710 in __chk_fail () from /lib/x86_64-linux-gnu/libc.so.6
#5 0x00007ffff6fba7ce in __fdelt_warn () from /lib/x86_64-linux-gnu/libc.so.6
#6 0x00007ffff7996b61 in (anonymous namespace)::canRead(int) () from /usr/local/lib/libsfml-window.so.2
#7 0x00007ffff7996f98 in sf::priv::JoystickImpl::isConnected(unsigned int) () from /usr/local/lib/libsfml-window.so.2
#8 0x00007ffff7992541 in sf::priv::JoystickManager::update() () from /usr/local/lib/libsfml-window.so.2
#9 0x00007ffff79955ff in sf::priv::WindowImpl::WindowImpl() () from /usr/local/lib/libsfml-window.so.2
#10 0x00007ffff799926c in sf::priv::WindowImplX11::WindowImplX11(sf::VideoMode, sf::String const&, unsigned long, sf::ContextSettings const&) ()
from /usr/local/lib/libsfml-window.so.2
#11 0x00007ffff79942cf in sf::priv::WindowImpl::create(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&) ()
from /usr/local/lib/libsfml-window.so.2
#12 0x00007ffff7993e6a in sf::Window::create(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&) ()
from /usr/local/lib/libsfml-window.so.2
#13 0x00007ffff7bc6881 in sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&) ()
from /usr/local/lib/libsfml-graphics.so.2
Apparently joystick (which I'm not using) was not initialized correctly, but something tried to use it anyway. This is the line that fails (Linux/JoystickImpl.cpp):
114: if (canRead(notifyFd)) // notifyFd is negative here
It would be great to be able to turn this functionality off altogether, so people don't get bogus crashes when playing my game.