Re: Fwd: SDL2 applications crashing with SIGBUS

Elias Bürli <[email protected]>
Newsgroups gmane.os.netbsd.ports.sparc64
Message-ID <CAK2Gejnwtcox3Lk069Yi3tbKe2219061HsQtHEzzCj9SsdyibQ@mail.gmail.com>
Hello

> > For tyr-quake, I tried the pre-compiled package here:
> This is not suing SDL2 (AFAICT).
>
You are correct, I mistook it for an SDL application.
I was just looking for some pre-compiled similar game to try out to
see if it works better than the games compiled from source.

> SIGBUS - just like you see it. If you still have the core around, can
> you show the output of "bt" in gdb?

Yes, see below the backtrace from all 4 games:

1) chocolate-doom-setup:
Reading symbols from /usr/local/bin/chocolate-doom-setup...done.
[New process 1]
bt
Core was generated by `chocolate-doom-s'.
Program terminated with signal SIGBUS, Bus error.
#0  0x000000004209a534 in XkbSetDetectableAutoRepeat () from
/usr/pkg/lib/libX11.so.6
(gdb) bt
#0  0x000000004209a534 in XkbSetDetectableAutoRepeat () from
/usr/pkg/lib/libX11.so.6
#1  0x00000000405e41b8 in X11_InitKeyboard () from /usr/pkg/lib/libSDL2-2.0.so.0
#2  0x00000000405ebc90 in X11_VideoInit () from /usr/pkg/lib/libSDL2-2.0.so.0
#3  0x00000000405db804 in SDL_VideoInit_REAL () from
/usr/pkg/lib/libSDL2-2.0.so.0
#4  0x0000000040537aac in SDL_InitSubSystem_REAL () from
/usr/pkg/lib/libSDL2-2.0.so.0
#5  0x00000000405525c8 in SDL_Init () from /usr/pkg/lib/libSDL2-2.0.so.0
#6  0x000000000011980c in TXT_Init () at txt_sdl.c:233
#7  0x000000000010bab4 in InitTextscreen () at mainmenu.c:305
#8  0x000000000010bf20 in RunGUI () at mainmenu.c:330
#9  D_DoomMain () at mainmenu.c:346
#10 0x000000000011df34 in main (argc=<optimized out>,
argv=0xffffffffffffd718) at i_main.c:48
(gdb)

2) chocolate-doom:
Reading symbols from /usr/local/bin/chocolate-doom...done.
[New process 1]
[New process 3]
[New process 2]
Core was generated by `chocolate-doom'.
Program terminated with signal SIGBUS, Bus error.
#0  0x0000000043c9a534 in XkbSetDetectableAutoRepeat () from
/usr/pkg/lib/libX11.so.6
[Current thread is 1 (LWP 1)]
(gdb) bt
#0  0x0000000043c9a534 in XkbSetDetectableAutoRepeat () from
/usr/pkg/lib/libX11.so.6
#1  0x00000000406e41b8 in X11_InitKeyboard () from /usr/pkg/lib/libSDL2-2.0.so.0
#2  0x00000000406ebc90 in X11_VideoInit () from /usr/pkg/lib/libSDL2-2.0.so.0
#3  0x00000000406db804 in SDL_VideoInit_REAL () from
/usr/pkg/lib/libSDL2-2.0.so.0
#4  0x0000000040637aac in SDL_InitSubSystem_REAL () from
/usr/pkg/lib/libSDL2-2.0.so.0
#5  0x00000000406525c8 in SDL_Init () from /usr/pkg/lib/libSDL2-2.0.so.0
#6  0x0000000000112b28 in I_InitGraphics () at i_video.c:1356
#7  0x000000000012a5e4 in D_DoomLoop () at d_main.c:449
#8  0x000000000012c21c in D_DoomMain () at d_main.c:1895
#9  0x000000000016dcb4 in main (argc=<optimized out>,
argv=0xffffffffffffd6a8) at i_main.c:48
(gdb)

3) dunelegacy:
Thread 1 received signal SIGBUS, Bus error.
0x000000004239a534 in XkbSetDetectableAutoRepeat () from
/usr/pkg/lib/libX11.so.6
(gdb) bt
#0  0x000000004239a534 in XkbSetDetectableAutoRepeat () from
/usr/pkg/lib/libX11.so.6
#1  0x00000000408e41b8 in X11_InitKeyboard () from /usr/pkg/lib/libSDL2-2.0.so.0
#2  0x00000000408ebc90 in X11_VideoInit () from /usr/pkg/lib/libSDL2-2.0.so.0
#3  0x00000000408db804 in SDL_VideoInit_REAL () from
/usr/pkg/lib/libSDL2-2.0.so.0
#4  0x0000000040837aac in SDL_InitSubSystem_REAL () from
/usr/pkg/lib/libSDL2-2.0.so.0
#5  0x00000000408525c8 in SDL_Init () from /usr/pkg/lib/libSDL2-2.0.so.0
#6  0x0000000000348b3c in main ()
(gdb)

4) And for what it's worth tyr-quake. This is from the stripped binary
from pkgsrc, so I assume a binary compiled from source would maybe
show more details?
But it seems to be failing also at a keyboard related part in libX11:
Program received signal SIGSEGV, Segmentation fault.
0x0000000040923ca4 in XChangeKeyboardControl () from /usr/pkg/lib/libX11.so.6
(gdb) bt
#0  0x0000000040923ca4 in XChangeKeyboardControl () from
/usr/pkg/lib/libX11.so.6
#1  0x0000000040923760 in XAutoRepeatOn () from /usr/pkg/lib/libX11.so.6
#2  0x000000000016388c in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

Best regards
Elias


On Tue, Jan 22, 2019 at 3:59 PM Martin Husemann <[email protected]> wrote:
>
> On Mon, Jan 21, 2019 at 05:57:40PM +0100, Elias Bürli wrote:
> > For tyr-quake, I tried the pre-compiled package here:
> > ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/games/tyrquake/README.html
> > which also needs at least the shareware data:
> > ftp://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/games/quakedata/README.html
> > It successfully shows the splash screen, and if I hit ESC fast enough
> > I can get into the menu, but it crashes when trying to start a new
> > game.
>
> This is not suing SDL2 (AFAICT).
>
> > I was also expecting the issue to be in the game source itself, which
> > is why I find the gdb reference to "XkbSetDetectableAutoRepeat () from
> > /usr/pkg/lib/libX11.so.6" confusing.
>
> Well:
>
> extern  Bool    XkbSetDetectableAutoRepeat(
>         Display *               /* dpy */,
>         Bool                    /* detectable */,
>         Bool *                  /* supported */
> );
>
> and "Bool" is int in X terms - so on sparc64 the last arg ("supported") will
> need to be a properly aligned pointer, failure to do that will lead to a
> SIGBUS - just like you see it. If you still have the core around, can
> you show the output of "bt" in gdb?
>
> Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.