Win32: immediate crash when dragging a SSD window
Steps to reproduce
- Start a Gtk app with SSD decorations
- Move the window by dragging the SSD titlebar --> immediate crash!
Version information
Windows 10, msys2-ucrt64, Gtk 4.17+834f20e2, self-compiled in debug mode.
(mainline only, the official gtk-4.16 is not affected)
Warnings
Gdk-CRITICAL **: gdk_surface_get_display: assertion 'GDK_IS_SURFACE (surface)' failed
Backtrace
Click to expand
warning: Exception code=0xc0000005 flags=0x0 at 0x7ffee03bbb77. Access violation - attempting to read data at address 0xf0
Thread 1 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 39328.0x46d0]
modal_timer_proc (hwnd=hwnd@entry=0x0, msg=msg@entry=0, id=id@entry=0, time=time@entry=0)
at ../gdk/win32/gdkevents-win32.c:1378
1378 g_main_context_pending (NULL) &&
(gdb) bt full
##0 modal_timer_proc (hwnd=hwnd@entry=0x0, msg=msg@entry=0, id=id@entry=0, time=time@entry=0)
at ../gdk/win32/gdkevents-win32.c:1378
arbitrary_limit = 10
display = 0x0
##1 0x00007ffee03bf75d in gdk_event_translate (msg=msg@entry=0x6302ffd200, ret_valp=ret_valp@entry=0x6302ffd1fc)
at ../gdk/win32/gdkevents-win32.c:3088
rect = {left = 481956068, top = 32767, right = 50319816, bottom = 99}
point = {x = 477159483, y = 32767}
mmi = <optimized out>
hwnd = <optimized out>
himc = <optimized out>
hwndpos = 0x6302ffd7e0
ignore_leave = <optimized out>
event = <optimized out>
display = <optimized out>
surface = 0x1a7bdd5a9c0
impl = 0x1a7bdd5a9c0
win32_display = <optimized out>
new_surface = <optimized out>
keyboard_grab = <optimized out>
pointer_grab = <optimized out>
grab_surface = 0x0
crossing_cb = 0x0
button = <optimized out>
return_val = 0
i = <optimized out>
##2 0x00007ffee03bfe56 in inner_hwnd_procedure (hwnd=hwnd@entry=0x311444, message=message@entry=71,
wparam=wparam@entry=0, lparam=lparam@entry=425252083680) at ../gdk/win32/gdkevents-win32.c:234
msg = {hwnd = 0x311444, message = 71, wParam = 0, lParam = 425252083680, time = 375579453, pt = {x = 536,
y = 221}}
pos = <optimized out>
ret_val = 0
##3 0x00007ffee03bff37 in _gdk_win32_surface_procedure (hwnd=0x311444, message=71, wparam=0, lparam=425252083680)
at ../gdk/win32/gdkevents-win32.c:278
retval = <optimized out>
display = 0x1a7bdb5a310
surface = <optimized out>
##4 0x000001a7bbd8ef5c in USER32!CallWindowProcW () from C:\Windows\System32\user32.dll
No symbol table info available.
##5 0x000001a7bbd8e9de in USER32!CallWindowProcW () from C:\Windows\System32\user32.dll
No symbol table info available.
##6 0x00007ffed514f1f0 in glPushClientAttrib () from C:\Windows\SYSTEM32\opengl32.dll
No symbol table info available.
##7 0x000001a7bbd8ef5c in USER32!CallWindowProcW () from C:\Windows\System32\user32.dll
No symbol table info available.
##8 0x000001a7bbd8e8cc in USER32!DispatchMessageW () from C:\Windows\System32\user32.dll
No symbol table info available.
##9 0x000001a7bbda6230 in USER32!LookupIconIdFromDirectoryEx () from C:\Windows\System32\user32.dll
No symbol table info available.
##10 0x00007fff1f4913e4 in ntdll!KiUserCallbackDispatcher () from C:\Windows\SYSTEM32\ntdll.dll
No symbol table info available.
##11 0x00007fff1cba1124 in win32u!NtUserMessageCall () from C:\Windows\System32\win32u.dll
No symbol table info available.
##12 0x000001a7bbd8cbd5 in USER32!GetWindowTextW () from C:\Windows\System32\user32.dll
No symbol table info available.
##13 0x000001a7bbd8c34f in USER32!IsIconic () from C:\Windows\System32\user32.dll
No symbol table info available.
##14 0x00007fff1690dfa2 in UxTheme!GetUserColorPreference () from C:\Windows\system32\uxtheme.dll
No symbol table info available.
##15 0x00007fff16907092 in UxTheme!GetThemePosition () from C:\Windows\system32\uxtheme.dll
No symbol table info available.
##16 0x00007fff16910099 in UxTheme!IsCompositionActive () from C:\Windows\system32\uxtheme.dll
No symbol table info available.
##17 0x00007fff1690fb01 in UxTheme!IsCompositionActive () from C:\Windows\system32\uxtheme.dll
No symbol table info available.
##18 0x000001a7bbd8c7be in USER32!GetWindowTextW () from C:\Windows\System32\user32.dll
No symbol table info available.
##19 0x00007ffee03bfeab in inner_hwnd_procedure (hwnd=hwnd@entry=0x311444, message=message@entry=274,
wparam=wparam@entry=61458, lparam=lparam@entry=14877213) at ../gdk/win32/gdkevents-win32.c:248
msg = {hwnd = 0x311444, message = 274, wParam = 61458, lParam = 14877213, time = 375579328, pt = {x = 541,
y = 227}}
pos = <optimized out>
ret_val = 0
##20 0x00007ffee03bff37 in _gdk_win32_surface_procedure (hwnd=0x311444, message=274, wparam=61458, lparam=14877213)
at ../gdk/win32/gdkevents-win32.c:278
retval = <optimized out>
display = 0x1a7bdb5a310
surface = <optimized out>
##21 0x000001a7bbd8ef5c in USER32!CallWindowProcW () from C:\Windows\System32\user32.dll
No symbol table info available.
##22 0x000001a7bbd8e9de in USER32!CallWindowProcW () from C:\Windows\System32\user32.dll
No symbol table info available.
##23 0x00007ffed514f1f0 in glPushClientAttrib () from C:\Windows\SYSTEM32\opengl32.dll
No symbol table info available.
##24 0x000001a7bbd8ef5c in USER32!CallWindowProcW () from C:\Windows\System32\user32.dll
No symbol table info available.
##25 0x000001a7bbd8e8cc in USER32!DispatchMessageW () from C:\Windows\System32\user32.dll
No symbol table info available.
##26 0x000001a7bbda10c3 in USER32!SendMessageTimeoutW () from C:\Windows\System32\user32.dll
No symbol table info available.
##27 0x00007fff1f4913e4 in ntdll!KiUserCallbackDispatcher () from C:\Windows\SYSTEM32\ntdll.dll
No symbol table info available.
##28 0x00007fff1cba1124 in win32u!NtUserMessageCall () from C:\Windows\System32\win32u.dll
No symbol table info available.
##29 0x000001a7bbd8cbd5 in USER32!GetWindowTextW () from C:\Windows\System32\user32.dll
No symbol table info available.
##30 0x000001a7bbd8c34f in USER32!IsIconic () from C:\Windows\System32\user32.dll
No symbol table info available.
##31 0x00007fff1690dfa2 in UxTheme!GetUserColorPreference () from C:\Windows\system32\uxtheme.dll
No symbol table info available.
##32 0x00007fff16906fe7 in UxTheme!GetThemePosition () from C:\Windows\system32\uxtheme.dll
No symbol table info available.
##33 0x00007fff16910099 in UxTheme!IsCompositionActive () from C:\Windows\system32\uxtheme.dll
No symbol table info available.
##34 0x00007fff1690fb01 in UxTheme!IsCompositionActive () from C:\Windows\system32\uxtheme.dll
No symbol table info available.
##35 0x000001a7bbd8c7be in USER32!GetWindowTextW () from C:\Windows\System32\user32.dll
No symbol table info available.
##36 0x00007ffee03bfeab in inner_hwnd_procedure (hwnd=hwnd@entry=0x311444, message=message@entry=161,
wparam=wparam@entry=2, lparam=lparam@entry=14877213) at ../gdk/win32/gdkevents-win32.c:248
msg = {hwnd = 0x311444, message = 161, wParam = 2, lParam = 14877213, time = 375579328, pt = {x = 541,
y = 227}}
pos = <optimized out>
ret_val = 0
##37 0x00007ffee03bff37 in _gdk_win32_surface_procedure (hwnd=0x311444, message=161, wparam=2, lparam=14877213)
at ../gdk/win32/gdkevents-win32.c:278
retval = <optimized out>
display = 0x1a7bdb5a310
surface = <optimized out>
##38 0x000001a7bbd8ef5c in USER32!CallWindowProcW () from C:\Windows\System32\user32.dll
No symbol table info available.
##39 0x000001a7bbd8e9de in USER32!CallWindowProcW () from C:\Windows\System32\user32.dll
No symbol table info available.
##40 0x00007ffed514f1f0 in glPushClientAttrib () from C:\Windows\SYSTEM32\opengl32.dll
No symbol table info available.
##41 0x000001a7bbd8ef5c in USER32!CallWindowProcW () from C:\Windows\System32\user32.dll
No symbol table info available.
##42 0x000001a7bbd8e684 in USER32!DispatchMessageW () from C:\Windows\System32\user32.dll
No symbol table info available.
##43 0x00007ffee03c0013 in _gdk_win32_display_queue_events (display=<optimized out>)
at ../gdk/win32/gdkevents-win32.c:3344
msg = {hwnd = 0x311444, message = 161, wParam = 2, lParam = 14877213, time = 375579328, pt = {x = 541,
y = 227}}
##44 0x00007ffee03c004e in gdk_event_dispatch (source=0x1a7be700520, callback=<optimized out>,
user_data=<optimized out>) at ../gdk/win32/gdkevents-win32.c:3393
event_source = 0x1a7be700520
event = <optimized out>
##45 0x00007ffee4da81f8 in g_main_dispatch (context=0x1a7bdb508e0) at ../glib/gmain.c:3356
dispatch = 0x7ffee03c003d <gdk_event_dispatch>
prev_source = 0x0
begin_time_nsec = 0
was_in_call = 0
user_data = 0x0
callback = 0x0
cb_funcs = 0x0
cb_data = 0x0
need_destroy = <optimized out>
source = 0x1a7be700520
current = 0x1a7be820880
i = 0
__func__ = "g_main_dispatch"
##46 0x00007ffee4da829d in g_main_context_dispatch_unlocked (context=context@entry=0x1a7bdb508e0)
at ../glib/gmain.c:4207
No locals.
##47 0x00007ffee4daa54c in g_main_context_iterate_unlocked (context=context@entry=0x1a7bdb508e0, block=block@entry=1,
dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4272
max_priority = 2147483647
timeout_usec = 12990
some_ready = 1
nfds = <optimized out>
allocated_nfds = 3
fds = 0x1a7ce0dd660
begin_time_nsec = 0
##48 0x00007ffee4daaaad in g_main_context_iteration (context=context@entry=0x1a7bdb508e0, may_block=may_block@entry=1)
at ../glib/gmain.c:4337
retval = <optimized out>
##49 0x00007ffee4053105 in g_application_run (application=0x1a7be8f4e40, argc=<optimized out>, argv=0x1a7be8130b0)
at ../gio/gapplication.c:2715
arguments = 0x1a7be813140
status = 0
context = 0x1a7bdb508e0
acquired_context = <optimized out>
__func__ = "g_application_run"
##50 0x00007ffefacb4cc1 in ?? () from C:\TOOLS\msys64\ucrt64\bin\libffi-8.dll
No symbol table info available.
##51 0x00007ffefacb48df in ?? () from C:\TOOLS\msys64\ucrt64\bin\libffi-8.dll
No symbol table info available.
##52 0x00007ffefacb4aa2 in ?? () from C:\TOOLS\msys64\ucrt64\bin\libffi-8.dll
No symbol table info available.
##53 0x00007ffeeb0c0514 in ?? ()
from C:\TOOLS\msys64\ucrt64\lib\python3.11\site-packages\gi\_gi.cp311-mingw_x86_64_ucrt.pyd
No symbol table info available.
##54 0x00007ffeeb0c25c5 in ?? ()
from C:\TOOLS\msys64\ucrt64\lib\python3.11\site-packages\gi\_gi.cp311-mingw_x86_64_ucrt.pyd
No symbol table info available.
##55 0x00007ffee735ea75 in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##56 0x00007ffee7418045 in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##57 0x00007ffee7413a34 in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##58 0x00007ffee72be85e in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##59 0x00007ffee72bd33c in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##60 0x00007ffee739ac8d in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##61 0x00007ffee735df53 in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##62 0x00007ffee7414c00 in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##63 0x00007ffee7413a34 in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##64 0x00007ffee735e2a1 in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##65 0x00007ffee72dc804 in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##66 0x00007ffee72dc47b in ?? () from C:\TOOLS\msys64\ucrt64\bin\libpython3.11.dll
No symbol table info available.
##67 0x00007ff7727b2ad4 in ?? ()
No symbol table info available.
##68 0x00007ff7727b12e9 in ?? ()
No symbol table info available.
##69 0x00007ff7727b13f6 in ?? ()
No symbol table info available.
##70 0x00007fff1dfc7374 in KERNEL32!BaseThreadInitThunk () from C:\Windows\System32\kernel32.dll
No symbol table info available.
##71 0x00007fff1f43cc91 in ntdll!RtlUserThreadStart () from C:\Windows\SYSTEM32\ntdll.dll
No symbol table info available.
##72 0x0000000000000000 in ?? ()
No symbol table info available.
Reproducer
(not the same as the backtrace above, but same result)
Click to expand
import os
import sys
import gi
gi.require_version('Gtk', '4.0')
from gi.repository import Gtk
class MyApp(Gtk.Application):
def __init__(self):
Gtk.Application.__init__(self)
self.connect('activate', self.on_activate)
def on_activate(self, app):
self.add_window(MyAppWindow())
class MyAppWindow(Gtk.ApplicationWindow):
def __init__(self):
super().__init__(default_width=360, default_height=240)
self.set_child(Gtk.Label.new("Hello!"))
self.present()
if __name__ == '__main__':
os.environ['GTK_CSD'] = "0"
sys.exit(MyApp().run(sys.argv))
Edited by gwillems