Skip to content

x11vnc: fix double X_UNLOCK on xrandr events#13

Merged
dscho merged 1 commit intoLibVNC:masterfrom
wjt:fix-double-X_UNLOCK-on-xrandr-event
Jul 18, 2014
Merged

x11vnc: fix double X_UNLOCK on xrandr events#13
dscho merged 1 commit intoLibVNC:masterfrom
wjt:fix-double-X_UNLOCK-on-xrandr-event

Conversation

@wjt
Copy link
Contributor

@wjt wjt commented Jul 10, 2014

check_xrandr_event() assumes X_LOCK is taken before it is called, and currently calls X_UNLOCK on behalf of the caller. But in practice, all callers assume that the lock is still held after check_xrandr_event() returns. In particular, this leads to a double-unlock and crash in check_xevents() on any xrandr resize event.

Steps to Reproduce:

  1. Run x11vnc, eg x11vnc -rfbport 5901 -display :0 -localhost. It doesn't make any difference whether you pass an '-xrandr' option or not. There is also no need to connect a client.
  2. Resize your display, eg from GNOME Settings -> Displays

For a stacktrace, see this Fedora bug report.

I've not tested this fix extensively, but it does seem to work. I don't run x11vnc with -threads so I guess there's a whole class of potential bugs I might be avoiding. :)

check_xrandr_event() assumes X_LOCK is taken before it is called, and
currently calls X_UNLOCK on behalf of the caller. But in practice, all
callers assume that the lock is still held after check_xrandr_event()
returns. In particular, this leads to a double-unlock and crash in
check_xevents() on any xrandr event.
@breaklee
Copy link

hi guys. what is your debugging tools for LibVNC?

there are only make files.

i can visual studio or Xcode. i'm not farmiliar with make or console debugging.

let you know your tips for me?

dscho added a commit that referenced this pull request Jul 18, 2014
x11vnc: fix double X_UNLOCK on xrandr events
@dscho dscho merged commit 9453be4 into LibVNC:master Jul 18, 2014
@dscho
Copy link
Contributor

dscho commented Jul 18, 2014

@wjt sorry to let this slide for a week, my only explanation is that I am very close to moving and have to tie up a lot of loose ends at work...

Thanks for your contribution!

@dscho
Copy link
Contributor

dscho commented Jul 18, 2014

hi guys. what is your debugging tools for LibVNC?

@breaklee a much better idea than hijacking an unrelated issue, and than submitting a request for assistance on an issue tracker, is to write a mail to the mailing list.

@wjt
Copy link
Contributor Author

wjt commented Jul 18, 2014

@dscho no problem at all, 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

Successfully merging this pull request may close these issues.

3 participants