Hi!

In the Hatari project (www.hatari-emu.org), we recently hit a problem in the
CI when we compile Hatari with Cygwin. A couple of weeks ago, everything
was working still fine:

 https://cirrus-ci.com/task/4681700988420096

Then it suddenly started failing - also for the very same code level of
Hatari that was working fine before:

 https://cirrus-ci.com/task/6377222543507456

The only difference was that the SDL2 package of Cygwin recently has been
upgraded from 2.32.8-1 to 2.32.56-1.

Christian Zietz, a user of Hatari who has a Windows installation (I don't)
debugged the issue a little bit and concluded that it's crashing somewhere
during exit():

 
https://sourceforge.net/p/hatari/mailman/hatari-devel/thread/00253a75-4089-4d8a-846e-8d5c0a4899ee%40gmx.net/#msg59242465

He reproduced it with the following small test program:

--------------------- 8< ----------------------------------------

WDAGUtilityAccount@9f56fa41-fdda-4d08-96da-76c506c9465a /tmp/sdltest
$ cat sdltest.c
#include <stdio.h>
#include <SDL.h>

int main(int arc, char ** argv) {

    if (SDL_Init( SDL_INIT_VIDEO ) == 0) {

        printf("SDL_Init succeeded\n");
        printf("Calling SDL_Quit()\n");
        SDL_Quit();
    }

    return 0;
}
WDAGUtilityAccount@9f56fa41-fdda-4d08-96da-76c506c9465a /tmp/sdltest
$ sdl2-config --version
2.32.56

WDAGUtilityAccount@9f56fa41-fdda-4d08-96da-76c506c9465a /tmp/sdltest
$ gcc -g -O1 -o sdltest sdltest.c -I /usr/include/SDL2/ -lsdl2

WDAGUtilityAccount@9f56fa41-fdda-4d08-96da-76c506c9465a /tmp/sdltest
$ ./sdltest
SDL_Init succeeded
Calling SDL_Quit()

WDAGUtilityAccount@9f56fa41-fdda-4d08-96da-76c506c9465a /tmp/sdltest
$ ./sdltest > out.txt

WDAGUtilityAccount@9f56fa41-fdda-4d08-96da-76c506c9465a /tmp/sdltest
$ cat out.txt

WDAGUtilityAccount@9f56fa41-fdda-4d08-96da-76c506c9465a /tmp/sdltest
$ gdb sdltest.exe
GNU gdb (GDB) (Cygwin 14.2-1) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from sdltest.exe...
(gdb) run
Starting program: /tmp/sdltest/sdltest.exe
[New Thread 7024.0x1918]
[New Thread 7024.0x1210]
[New Thread 7024.0x1a80]
[New Thread 7024.0x18d0]
SDL_Init succeeded
Calling SDL_Quit()

Thread 1 "sdltest" received signal SIGSEGV, Segmentation fault.
0x00000003f96f1020 in ?? ()
(gdb) bt
#0  0x00000003f96f1020 in ?? ()
#1  0x00007ffb2a577a63 in __call_exitprocs (code=code@entry=0, d=d@entry=0x0)
    at /usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdlib/__call_atexit.c:123
#2  0x00007ffb2a5356ce in exit (code=0) at 
/usr/src/debug/cygwin-3.6.4-1/newlib/libc/stdlib/exit.c:60
#3  0x00007ffb2a3d6a98 in cygwin_exit (n=0) at 
/usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/dcrt0.cc:1238
#4  0x00007ffb2a3d80d4 in dll_crt0_1 () at 
/usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/dcrt0.cc:1003
#5  0x00007ffb2a3d5d05 in _cygtls::call2 (this=0x7ffffce00, func=0x7ffb2a3d707c 
<dll_crt0_1(void*)>, arg=0x0,
    buf=buf@entry=0x7ffffcdf0) at 
/usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/cygtls.cc:41
#6  0x00007ffb2a3d5dbb in _cygtls::call (func=<optimized out>, arg=<optimized 
out>)
    at /usr/src/debug/cygwin-3.6.4-1/winsup/cygwin/cygtls.cc:28
#7  0x0000000000000000 in ?? ()
(gdb)

--------------------- 8< ----------------------------------------

Could someone please have a look?

 Thanks,
  Thomas

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to