Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in set_native_cursor_on_all_displays function #2907

Closed
Gasparoken opened this issue Aug 20, 2021 · 6 comments
Closed

Crash in set_native_cursor_on_all_displays function #2907

Gasparoken opened this issue Aug 20, 2021 · 6 comments
Assignees
Labels
bug crash report Issue originated from a crash report / .dmp file time-2
Milestone

Comments

@Gasparoken
Copy link
Member

Gasparoken commented Aug 20, 2021

I couldn't reproduce it.
I print screen of Xcode
Crash

@Gasparoken Gasparoken added bug crash report Issue originated from a crash report / .dmp file labels Aug 20, 2021
@Gasparoken
Copy link
Member Author

Other crash on set_native_cursor_on_all_displays

    else {
      result |= nativeWindow->setCursor(cursor);
    }
    display = display->parentDisplay(); // Unhandled exception at 0x00007FF6CDF3E5B7 (Aseprite.exe) in Aseprite-crash-1.3-beta6-x64.dmp: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF
  }
  return result;
}
>	Aseprite.exe!ui::set_native_cursor_on_all_displays(ui::Display * display, const os::NativeCursor cursor) Line 118	C++
 	Aseprite.exe!ui::update_mouse_cursor() Line 185	C++
 	Aseprite.exe!ui::Manager::_closeWindow(ui::Window * window, bool redraw_background) Line 1489	C++
 	Aseprite.exe!ui::Window::closeWindow(ui::Widget * closer) Line 414	C++
 	Aseprite.exe!ui::TipWindow::onProcessMessage(ui::Message * msg) Line 291	C++
 	Aseprite.exe!ui::Manager::sendMessageToWidget(ui::Message * msg, ui::Widget * widget) Line 1916	C++
 	Aseprite.exe!ui::Manager::pumpQueue() Line 1778	C++
 	Aseprite.exe!ui::Manager::dispatchMessages() Line 834	C++
 	Aseprite.exe!ui::Manager::run() Line 291	C++
 	Aseprite.exe!app::App::run() Line 434	C++
 	Aseprite.exe!app_main(int argc, char * * argv) Line 105	C++
 	Aseprite.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 41	C++
 	[External Code]	
 	[Frames may be missing, no binary loaded for kernel32.dll]	
 	[External Code]	

@Gasparoken
Copy link
Member Author

Other crash on set_native_cursor_on_all_displays

    else {
      result |= nativeWindow->setCursor(cursor);
    }
    display = display->parentDisplay(); // Unhandled exception at 0x00007FF6D9760D27 (Aseprite.exe) in Aseprite-crash-1.3-beta7-x64.dmp: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
  }
  return result;
}
>	Aseprite.exe!ui::set_native_cursor_on_all_displays(ui::Display * display, const os::NativeCursor cursor) Line 118	C++
 	Aseprite.exe!ui::update_mouse_cursor() Line 185	C++
 	Aseprite.exe!ui::Manager::_closeWindow(ui::Window * window, bool redraw_background) Line 1495	C++
 	Aseprite.exe!ui::Window::closeWindow(ui::Widget * closer) Line 419	C++
 	Aseprite.exe!app::ToolBar::closeTipWindow() Line 549	C++
 	Aseprite.exe!app::ToolBar::onClosePopup() Line 581	C++
 	[Inline Frame] Aseprite.exe!std::_Func_class<void,ui::CloseEvent &>::operator()(ui::CloseEvent &) Line 968	C++
 	[Inline Frame] Aseprite.exe!obs::slot<void __cdecl(ui::CloseEvent &)>::operator()(ui::CloseEvent &) Line 78	C++
 	Aseprite.exe!obs::signal<void __cdecl(ui::CloseEvent &)>::operator()<ui::CloseEvent &>(ui::CloseEvent & <args_0>) Line 121	C++
 	Aseprite.exe!ui::Window::closeWindow(ui::Widget * closer) Line 419	C++
 	Aseprite.exe!ui::PopupWindow::onProcessMessage(ui::Message * msg) Line 181	C++
 	Aseprite.exe!ui::Manager::sendMessageToWidget(ui::Message * msg, ui::Widget * widget) Line 1928	C++
 	Aseprite.exe!ui::Manager::pumpQueue() Line 1790	C++
 	Aseprite.exe!ui::Manager::dispatchMessages() Line 834	C++
 	Aseprite.exe!ui::Manager::run() Line 291	C++
 	Aseprite.exe!app::App::run() Line 437	C++
 	Aseprite.exe!app_main(int argc, char * * argv) Line 119	C++
 	Aseprite.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 41	C++
 	[External Code]

Aseprite version: 1.3-beta7-x64
System: Windows
Reported on https://igarastudio.zendesk.com/agent/tickets/3028

dacap added a commit that referenced this issue Jan 11, 2022
In this way we don't process any queued native message for the display
as it will be deleted. This could be a possible fix for some crashes
reported in set_native_cursor_on_all_displays() (#2907)
@sentry-io
Copy link

sentry-io bot commented Feb 9, 2022

Sentry issue: ASEPRITE-2F

@dacap
Copy link
Member

dacap commented Feb 9, 2022

The Sentry issue looks like a different one but similar (the crash is not generated directly from closeWindow):

Thread 1273090 Crashed:
0   aseprite                        0x107de4dda         [inlined] ui::set_native_cursor_on_all_displays
1   aseprite                        0x107de4dda         ui::update_mouse_cursor (system.cpp:180)
2   aseprite                        0x107dd48c2         ui::Manager::generateMessagesFromOSEvents (manager.cpp:502)
3   aseprite                        0x107dd44c9         ui::Manager::generateMessages (manager.cpp:351)
4   aseprite                        0x107ddea70         ui::MessageLoop::pumpMessages (message_loop.cpp:25)
5   aseprite                        0x107dd42a7         ui::Manager::run (manager.cpp:292)
6   aseprite                        0x107a59092         app::App::run (app.cpp:445)
7   aseprite                        0x107a5707d         app_main (main.cpp:115)
8   aseprite                        0x107df5097         main (main.cpp:67)

@sentry-io
Copy link

sentry-io bot commented Aug 11, 2022

Sentry issue: ASEPRITE-41

@dacap dacap self-assigned this Aug 11, 2022
@dacap dacap added this to the v1.3.0 milestone Aug 11, 2022
@dacap dacap removed their assignment Aug 11, 2022
@dacap dacap self-assigned this Aug 29, 2022
dacap added a commit to dacap/aseprite that referenced this issue Aug 29, 2022
…rite#3491, fix aseprite#2907)

This might be a fix for two frequently reported crashes from Sentry:

1) In Manager::_closeWindow() (aseprite#3491): We can reproduce this bug (without
this patch) pressing Ctrl+S to save the active sprite and clicking
randomly in the menu bar (File, Edit, etc. options) to open other menu
boxes (a crash can happen when multiple windows UI is enabled).

2) In set_native_cursor_on_all_displays() (aseprite#2907): We weren't able to
reproduce this bug.
@dacap
Copy link
Member

dacap commented Aug 29, 2022

Highly probable that this bug is fixed with the bc16ab3 patch that fixed #3491 where a Display::parentDisplay() was pointing to an invalid pointer (so in set_native_cursor_on_all_displays() when we iterate displays using the parentDisplay() property, we got to an invalid/deleted pointer).

@dacap dacap closed this as completed Aug 29, 2022
@dacap dacap removed the wip label Aug 29, 2022
@dacap dacap modified the milestones: v1.3.0, v1.3-beta21 Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug crash report Issue originated from a crash report / .dmp file time-2
Projects
None yet
Development

No branches or pull requests

2 participants