segfault in sdl2.c:sdl2_window_create() on MSYS2 AARCH64 Windows
<!--This is the upstream QEMU issue tracker. If you are able to, it will greatly facilitate bug triage if you attempt to reproduce the problem with the latest qemu.git master built from source. See https://www.qemu.org/download/#source for instructions on how to do this. QEMU generally supports the last two releases advertised on https://www.qemu.org/. Problems with distro-packaged versions of QEMU older than this should be reported to the distribution instead. See https://www.qemu.org/contribute/report-a-bug/ for additional guidance. If this is a security issue, please consult https://www.qemu.org/contribute/security-process/--> ## Host environment - CPU: Qualcomm Snapdragon X Elite X1E80100 - GPU: Qualcomm Adreno X1-85 - Operating system: Windows 11 Enterprise (24H2) - Architecture: AARCH64 - QEMU flavor: qemu-system-aarch64 - QEMU version: commit 5a68a3add - QEMU command line: qemu-system-aarch64.exe -M virt -smp 1 -m 8192M -display sdl <!--Give the smallest, complete command line that exhibits the problem. </li> </ul> <p data-sourcepos="30:1-31:62">If you are using libvirt, virsh, or vmm, you can likely find the QEMU command line arguments in /var/log/libvirt/qemu/$GUEST.log.--&gt;</p> <pre data-sourcepos="33:3-35:5"><code>qemu-system-x86_64w -m 512 -net user -net nic,model=rtl8139 -device ES1370 -vga cirrus -hda winxp.vhd -cdrom en_winxp_pro_sp3.iso -boot c -rtc base=localtime -usb -display sdl,gl=on </code></pre> <pre data-sourcepos="37:3-39:5"><code>qemu-system-x86_64w -m 512 -net user -net nic,model=rtl8139 -device ES1370 -vga cirrus -hda winxp.vhd -cdrom en_winxp_pro_sp3.iso -boot c -rtc base=localtime -usb -display gtk,gl=on </code></pre> <h2 id="user-content-emulatedvirtualized-environment" data-sourcepos="41:1-41:35">Emulated/Virtualized environment<a href="#emulatedvirtualized-environment" aria-label="Link to heading 'Emulated/Virtualized environment'" data-heading-content="Emulated/Virtualized environment" class="anchor"></a></h2> <ul data-sourcepos="43:1-44:23"> <li data-sourcepos="43:1-43:29">Operating system: Win11 Pro</li> <li data-sourcepos="44:1-45:0">Architecture: aarch64</li> </ul> <h2 id="user-content-description-of-problem" data-sourcepos="46:1-46:25">Description of problem<a href="#description-of-problem" aria-label="Link to heading 'Description of problem'" data-heading-content="Description of problem" class="anchor"></a></h2> <!--Describe the problem, including any error/crash messages seen.--> Seg Fault at sdl2.c:129. This appears to have been introduced with commit 52053b7e. When running under MSYS on Windows, the call to eglGetCurrentDisplay() results in an invalid memory access. Surrounding the call within an if (scon-\>opengl) conditional appears to resolve the issue, but may not be the correct solution. ## Steps to reproduce 1. Launch QEMU, see seg fault at window creation time. ## Additional information <!--Attach logs, stack traces, screenshots, etc. Compress the files if necessary. If using libvirt, libvirt logs and XML domain information may be relevant.--> <!--The line below ensures that proper tags are added to the issue. Please do not remove it.-->
issue