Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Crash after failed inotify_init() call (Linux, SFML 2.1)  (Read 1546 times)

0 Members and 1 Guest are viewing this topic.

miki151

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Crash after failed inotify_init() call (Linux, SFML 2.1)
« on: August 05, 2013, 08:17:57 am »
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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Crash after failed inotify_init() call (Linux, SFML 2.1)
« Reply #1 on: August 05, 2013, 08:27:39 am »
I'll fix this bug, thanks for your feedback.

However it's really strange that inotify doesn't work for you. Do you have any idea why it could fail?
Laurent Gomila - SFML developer

miki151

  • Newbie
  • *
  • Posts: 30
    • View Profile
    • Email
Re: Crash after failed inotify_init() call (Linux, SFML 2.1)
« Reply #2 on: August 05, 2013, 08:48:59 am »
It's because of too many open files. I'm not sure why this is happening, but it seems to be a common problem on Ubuntu.

Thanks for the quick reply.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Crash after failed inotify_init() call (Linux, SFML 2.1)
« Reply #3 on: August 05, 2013, 09:21:24 am »
Quote
It's because of too many open files. I'm not sure why this is happening, but it seems to be a common problem on Ubuntu.
Hmm this could be annoying if it's a known problem.
Laurent Gomila - SFML developer