hugoam / kiui

Auto-layout Ui library, lightweight, skinnable and system agnostic, with an OpenGL backend
zlib License
749 stars 70 forks source link

File Browser demo crash #17

Closed alexeyknyshev closed 9 years ago

alexeyknyshev commented 9 years ago

Crash in readdir (DIR * is NULL)

See video: https://www.youtube.com/watch?v=qBnX-q7Rm_Y

gdb bt:

Program received signal SIGSEGV, Segmentation fault. 0x00007ffff5b18786 in readdir (dirp=0x0) at ../sysdeps/posix/readdir.c:44 44 ../sysdeps/posix/readdir.c: Нет такого файла или каталога. (gdb) bt 0 0x00007ffff5b18786 in readdir (dirp=0x0) at ../sysdeps/posix/readdir.c:44 1 0x00007ffff7a0e076 in mk::Directory::update() () from /usr/local/lib/libkiui.so 2 0x00007ffff7a0e16b in mk::Directory::setLocation(std::string const&) () from /usr/local/lib/libkiui.so 3 0x00007ffff7a0e1c7 in mk::Directory::moveIn(std::string const&) () from /usr/local/lib/libkiui.so 4 0x00007ffff7a0dc0b in mk::Dir::trigger() () from /usr/local/lib/libkiui.so 5 0x00007ffff7a13068 in mk::WrapButton::leftClick(float, float) () from /usr/local/lib/libkiui.so 6 0x00007ffff7a06f16 in mk::Widget::mouseReleased(float, float, mk::MouseButton) () from /usr/local/lib/libkiui.so 7 0x00007ffff7a0bd4a in mk::RootSheet::mouseReleased(float, float, mk::MouseButton) () from /usr/local/lib/libkiui.so 8 0x00007ffff7ac6a83 in mk::UiWindow::dispatchMouseReleased(float, float, mk::MouseButton) () from /usr/local/lib/libkiui.so 9 0x00007ffff7abdc74 in mk::GlWindow::injectMouseButton(int, int, int) () from /usr/local/lib/libkiui.so 10 0x00007ffff7abd1f9 in mk::GlWindow::initContext()::{lambda(GLFWwindow, int, int, int)%3}::operator()(GLFWwindow, int, int, int) const () from /usr/local/lib/libkiui.so 11 0x00007ffff7abd22e in mk::GlWindow::initContext()::{lambda(GLFWwindow_, int, int, int)%3}::FUN(GLFWwindow, int, int, int) () from /usr/local/lib/libkiui.so 12 0x00007ffff663c660 in ?? () from /usr/lib/x86_64-linux-gnu/libglfw.so.3 13 0x00007ffff7abd8af in mk::GlWindow::renderFrame() () from /usr/local/lib/libkiui.so 14 0x000000000041e1a7 in main ()

hugoam commented 9 years ago

Can you tell me the value of Directory::mPath just before the crash ?

alexeyknyshev commented 9 years ago

Yeap, just a minute.

alexeyknyshev commented 9 years ago

in mk::Directory::setLocation(const mk::string& path):

  path    "..\vnc_client" mk::string &
  this    @0xf6f700   mk::Directory

Problem with handling relative paths.

alexeyknyshev commented 9 years ago

Or maybe '\' instead '/' Looks strange enough

hugoam commented 9 years ago

Try this ? eee466a I'm not used to linux environments. Didn't even know backslash works only on windows.

alexeyknyshev commented 9 years ago

Great, all is good. Thank you, man

alexeyknyshev commented 9 years ago

Great topic to read about file path separators: http://bytes.com/topic/python/answers/23123-when-did-windows-start-accepting-forward-slash-path-separator