-
Notifications
You must be signed in to change notification settings - Fork 782
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
Using two input devices simultaneously causes heap overflow + undefined behavior #1507
Comments
Output on GNOME/Wayland with gtk 3.24.11 (also on 3.24.10) Seems to be caused by two pointers which are available simultaneous and update the XournalWidget allocation.
|
Also occurs when using a stylus and a mouse simultaneously. |
The heap overflow occurs here: https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gdk/gdkevents.c#L720; it appears that switching between devices with different numbers of axes causes the error (e.g. mouse has 4, pressure-sensitive stylus has 6). Edit: Possible cause may be because a grab is released and acquired: https://developer.gnome.org/gdk3/stable/gdk3-Events.html#gdk-event-get-source-device
Edit 2: Indeed. Moving the stylus and then moving the mouse does not cause an error, but moving the mouse and then moving the stylus causes the heap overflow. Edit 3: To be clear, I'm not suggesting that this is a GTK bug; this seems more like a GTK "gotcha" that we need to be careful about. Edit 4: You can see how the change in axes count causes the crash by inserting the following line into the top of if (this->sourceEvent->any.type == GDK_MOTION_NOTIFY) {
g_message("%i", gdk_device_get_n_axes(this->sourceEvent->motion.device));
} |
The crash that ocurrs when drawing the second stroke with a pen looks like its related to EDIT: Crash only appears if pen is lifted between strokes (pointer is switched) EDIT 2: Might not be related to zoom at all but to overall repainting. Stack is always stuck at some css style stuff. ( |
(Please complete the following information, and then delete this line)
Affects versions :
Describe the bug
Undefined behaviour and crash when using two fingers or finger and stylus at the same time, or stylus(pen) and then finger(handtool)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No undefined behaviour, no crash, no heap-buffer-overflow
Additional context
May be the reason for #1471 #1475 #1457 .
The text was updated successfully, but these errors were encountered: