Hello,
just tried to reproduce the crash in a minimal Stretch amd64 VM.
I got the crash with this stack:
(gdb) bt
#0 TTF_SizeUNICODE (font=font@entry=0x0, text=text@entry=0x7fffffffe340,
w=w@entry=0x7fffffffe2d8, h=h@entry=0x7fffffffe2dc) at SDL_ttf.c:1127
#1 0x00007ffff7bd63b7 in TTF_RenderUNICODE_Blended (font=font@entry=0x0,
text=text@entry=0x7fffffffe340, fg=..., fg@entry=...) at SDL_ttf.c:1849
#2 0x00007ffff7bd682a in TTF_RenderText_Blended (font=0x0,
text=text@entry=0x7fffffffe420 "F1", fg=...) at SDL_ttf.c:1795
#3 0x0000555555555f8f in DispText (screen=screen@entry=0x5555557a7c30,
color=color@entry=..., x=x@entry=100, y=y@entry=100, w=w@entry=0, h=h@entry=0,
text=0x7fffffffe420 "F1") at fx.cpp:739
#4 0x0000555555556c81 in DispMenu (screen=screen@entry=0x5555557a7c30) at
fx.cpp:713
#5 0x0000555555556d30 in menu (screen=0x5555557a7c30) at fx.cpp:322
#6 0x0000555555555700 in main (argc=<optimized out>, argv=<optimized out>) at
main.cpp:40
Having font being a null pointer resulted from font.ttf
being a link to a not existing file.
That issue got resolved by the latest version in Buster/testing
in bug #861508 by adding a dependency to package ttf-dejavu-core.
That fix never reached Stretch.
So a workaround would be to just install the package ttf-dejavu-core.
Kind regards,
Bernhard
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861508
apt install xserver-xorg sddm openbox xterm mc dpkg-dev devscripts gdb zatacka
zatacka-dbgsym libsdl-ttf2.0-0-dbgsym
systemctl start sddm
mkdir zatacka/orig -p
cd zatacka/orig
apt source zatacka
cd ../..
mkdir sdl-ttf2.0/orig -p
cd sdl-ttf2.0/orig
apt source sdl-ttf2.0
cd ../..
export DISPLAY=:0
$ zatacka
Speicherzugriffsfehler
$ gdb -q --args zatacka
Reading symbols from zatacka...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/games/zatacka
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bd502a in TTF_SizeUNICODE () from
/usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0
(gdb) bt
#0 0x00007ffff7bd502a in TTF_SizeUNICODE () from
/usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0
#1 0x00007ffff7bd63b7 in TTF_RenderUNICODE_Blended () from
/usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0
#2 0x00007ffff7bd682a in TTF_RenderText_Blended () from
/usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0
#3 0x0000555555555f8f in ?? ()
#4 0x0000555555556c81 in ?? ()
#5 0x0000555555556d30 in ?? ()
#6 0x0000555555555700 in main ()
(gdb)
$ gdb -q --args zatacka
Reading symbols from zatacka...Reading symbols from
/usr/lib/debug/.build-id/53/5cb8e1b018c227f6540c2ec464eb78aa5b4c67.debug...done.
done.
(gdb) set height 0
(gdb) set width 0
(gdb) set pagination off
(gdb) directory /home/benutzer/zatacka/orig/zatacka-0.1.8/src
Source directories searched:
/home/benutzer/zatacka/orig/zatacka-0.1.8/src:$cdir:$cwd
(gdb) directory /home/benutzer/sdl-ttf2.0/orig/sdl-ttf2.0-2.0.11
Source directories searched:
/home/benutzer/sdl-ttf2.0/orig/sdl-ttf2.0-2.0.11:/home/benutzer/zatacka/orig/zatacka-0.1.8/src:$cdir:$cwd
(gdb) run
Starting program: /usr/games/zatacka
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
TTF_SizeUNICODE (font=font@entry=0x0, text=text@entry=0x7fffffffe340,
w=w@entry=0x7fffffffe2d8, h=h@entry=0x7fffffffe2dc) at SDL_ttf.c:1127
warning: Source file is more recent than executable.
1127 use_kerning = FT_HAS_KERNING( font->face ) && font->kerning;
(gdb) bt
#0 TTF_SizeUNICODE (font=font@entry=0x0, text=text@entry=0x7fffffffe340,
w=w@entry=0x7fffffffe2d8, h=h@entry=0x7fffffffe2dc) at SDL_ttf.c:1127
#1 0x00007ffff7bd63b7 in TTF_RenderUNICODE_Blended (font=font@entry=0x0,
text=text@entry=0x7fffffffe340, fg=..., fg@entry=...) at SDL_ttf.c:1849
#2 0x00007ffff7bd682a in TTF_RenderText_Blended (font=0x0,
text=text@entry=0x7fffffffe420 "F1", fg=...) at SDL_ttf.c:1795
#3 0x0000555555555f8f in DispText (screen=screen@entry=0x5555557a7c30,
color=color@entry=..., x=x@entry=100, y=y@entry=100, w=w@entry=0, h=h@entry=0,
text=0x7fffffffe420 "F1") at fx.cpp:739
#4 0x0000555555556c81 in DispMenu (screen=screen@entry=0x5555557a7c30) at
fx.cpp:713
#5 0x0000555555556d30 in menu (screen=0x5555557a7c30) at fx.cpp:322
#6 0x0000555555555700 in main (argc=<optimized out>, argv=<optimized out>) at
main.cpp:40
(gdb) up
#1 0x00007ffff7bd63b7 in TTF_RenderUNICODE_Blended (font=font@entry=0x0,
text=text@entry=0x7fffffffe340, fg=..., fg@entry=...) at SDL_ttf.c:1849
1849 if ( (TTF_SizeUNICODE(font, text, &width, &height) < 0) ||
!width ) {
(gdb)
#2 0x00007ffff7bd682a in TTF_RenderText_Blended (font=0x0,
text=text@entry=0x7fffffffe420 "F1", fg=...) at SDL_ttf.c:1795
1795 textbuf = TTF_RenderUNICODE_Blended(font, unicode_text, fg);
(gdb)
#3 0x0000555555555f8f in DispText (screen=screen@entry=0x5555557a7c30,
color=color@entry=..., x=x@entry=100, y=y@entry=100, w=w@entry=0, h=h@entry=0,
text=0x7fffffffe420 "F1") at fx.cpp:739
739
DisplayImage(TTF_RenderText_Blended(font,text,color),screen,x,y);
(gdb) print font
$1 = (TTF_Font *) 0x0
(gdb) list fx.h:44
44 #define FONT "font.ttf"
(gdb) list 53
48
49 SDL_Surface *Initialize(){
...
83 font=TTF_OpenFont(FONT,20);
84 return (screen); //return pointer to screen surface
85
86
87 }
(gdb) list 32
32 TTF_Font *font;
(gdb) list DispText
731 void DispText(SDL_Surface *screen,SDL_Color color,int x,int y,int w,
int h, char *text){
732 SDL_Rect dest;
733 dest.x=x;
734 dest.y=y;
735 dest.w=w;
736 dest.h=h;
737 SDL_FillRect(screen,&dest,0);
738 SDL_UpdateRects(screen,1,&dest);
739
DisplayImage(TTF_RenderText_Blended(font,text,color),screen,x,y);
740 }
(gdb)
benutzer@debian:~$ strace -f zatacka 2>&1 | grep font
open("font.ttf", O_RDONLY) = -1 ENOENT (No such file or directory)
benutzer@debian:~/zatacka/orig$ dpkg -L zatacka
/usr/share/games/zatacka/font.ttf
benutzer@debian:/usr/share/games/zatacka$ strace -f zatacka 2>&1 | grep font
open("font.ttf", O_RDONLY) = -1 ENOENT (No such file or directory)
benutzer@debian:/usr/share/games/zatacka$ ls -lisah
133647 0 lrwxrwxrwx 1 root root 46 Aug 10 2014 font.ttf ->
../../fonts/truetype/ttf-dejavu/DejaVuSans.ttf
benutzer@debian:~/zatacka/try1/zatacka-0.1.8$ dpkg -S
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
fonts-dejavu-core: /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
https://packages.debian.org/search?searchon=contents&keywords=DejaVuSans.ttf&mode=path&suite=stable&arch=any
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf fonts-dejavu-core
/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf ttf-dejavu-core
gdb -q --args zatacka
set height 0
set width 0
set pagination off
directory /home/benutzer/zatacka/orig/zatacka-0.1.8/src
directory /home/benutzer/sdl-ttf2.0/orig/sdl-ttf2.0-2.0.11
run