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

PATCH: Don't crash when trying to exit because of an xio-error #573

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

PATCH: Don't crash when trying to exit because of an xio-error #573

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.14
Reported for operating system, platform: Linux, Other

Comments on the original bug report:

On 2010-06-23 07:03:18 +0000, Hans de Goede wrote:

Created attachment 511
PATCH: Don't crash when trying to exit because of an xio-error

See the backtrace attached to this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=603984

What is happening here is:

  1. an xio error happened while the mouse cursor was grabbed
  2. SDL's xio error handler then sets SDL_Display to
  3. SDL_VideoQuit calls SDL_WM_GrabInputOff, which ends up calling
    X11_GrabInputNoLock which causes a segfault trying to deref
    SDL_Display

The attached patch fixes this crash by checking for SDL_Display being NULL in
both X11_GrabInputNoLock() and X11_CheckMouseModeNoLock() (which will get
by called SDL_WM_GrabInputOff after X11_GrabInputNoLock(). I've audited the entire SDL_VideoQuit code path for further unchecked uses of SDL_Display and
could not find any.

On 2010-07-18 11:28:35 +0000, Sam Lantinga wrote:

This is fixed in revision a1af511bbbdd, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant