tuxtype2, which was previously working , now fails with a segmentation fault. The libpng, freetype and tiff packages are in the dependency tree and have been updated due to GLSAs. output of tuxtype2 -d: tuxtype2, version 1.5.3 BEGIN LibInit(): -About to init SDL Library -SDL Library init'd successfully -about to init SDL_ttf LibInit():END GraphicsInit - Initialize graphic system -SDL Setting VidMode to 640x480x16 SDL_SetClipRect(screen, NULL): SDL_ShowCursor(0): SDL_WM_SetCaption("Tux Typing", PACKAGE); -SDL VidMode successfully set to 640x480x16 GraphicsInit():END LoadImage: loading standby.png LOADIMAGE: Done LoadImage: loading title1.png LOADIMAGE: Done LoadImage: loading main_bkg.png LOADIMAGE: Done LoadImage: loading menu/seld.png LoadImage: loading menu/sel0.png LOADIMAGE: Done LoadImage: loading menu/sel1.png LOADIMAGE: Done LoadImage: loading menu/sel2.png LOADIMAGE: Done LoadImage: loading menu/sel3.png loading sprite menu/sel - contains 3 frames LoadImage: loading menu/regd.png LoadImage: loading menu/reg0.png LOADIMAGE: Done LoadImage: loading menu/reg1.png LOADIMAGE: Done LoadImage: loading menu/reg2.png LOADIMAGE: Done LoadImage: loading menu/reg3.png loading sprite menu/reg - contains 3 frames LoadImage: loading tuxd.png LoadImage: loading tux0.png LOADIMAGE: Done LoadImage: loading tux1.png LOADIMAGE: Done LoadImage: loading tux2.png LOADIMAGE: Done LoadImage: loading tux3.png LOADIMAGE: Done LoadImage: loading tux4.png loading sprite tux - contains 4 frames loading & parsing menu black_outline of "Fish Cascade" Fatal signal: Segmentation Fault (SDL Parachute Deployed) output of emerge --info: Gentoo Base System version 1.4.16 Portage 2.1-r1 (default-linux/x86/2006.0, gcc-20050130, glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r6 i586) ================================================================= System uname: 2.6.11-gentoo-r6 i586 AMD-K6(tm) 3D+ Processor app-admin/eselect-compiler: [Not Present] dev-lang/python: 2.4.3-r1 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: [Not Present] dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.11 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/gcc-config: 1.3.10-r2 sys-devel/libtool: 1.5.16 virtual/os-headers: 2.6.8.1-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i586-pc-linux-gnu" CFLAGS="-O2 -march=k6-3 -pipe" CHOST="i586-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib/X11/xkb" CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo" CXXFLAGS="-O2 -march=k6-3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict" GENTOO_MIRRORS="ftp://ftp.mirrorservice.org/sites/www.ibiblio.org/gentoo" LANG="en_GB" LC_ALL="en_GB" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage" USE="x86 3dnow X alsa apache2 apm avi bash-completion berkdb bitmap-fonts cdr cli crypt cups dga dlloader dri eds emacs emboss encode esd exif foomaticdb fortran gdbm gif gpm gstreamer gtk gtk2 imlib ipv6 isdnlog jpeg libg++ libwww mad matrox mbox mikmod mmx motif mp3 mysql ncurses nptl ogg opengl oss pam pcre pdflib perl png ppds pppd python qt qt3 qt4 quicktime readline reflection scanner sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts udev unicode usb vorbis xinerama xml xmms xorg xv zlib elibc_glibc input_devices_keyboard input_devices_mouse input_devices_evdev kernel_linux userland_GNU" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
I've done some debugging on this. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1212388832 (LWP 11020)] 0x08053c54 in black_outline (t=0x8059149 "Fish Cascade", font=0x80c08c8, c=0x20) at alphabet.c:123 123 out = SDL_CreateRGBSurface(SDL_SWSURFACE, (tmp->w)+5, (tmp->h)+5, 32, rmask, gmask, bmask, amask); #0 0x08053c54 in black_outline (t=0x8059149 "Fish Cascade", font=0x80c08c8, c=0x20) at alphabet.c:123 #1 0x0804ea6a in TitleScreen_load_menu () at titlescreen.c:75 #2 0x0804fe9c in TitleScreen () at titlescreen.c:293 #3 0x0804e46a in main (argc=2, argv=0xbfb9dba4) at main.c:151 If you look at the code, alphabet.c:122 this is called. tmp = TTF_RenderText_Solid(font, t, black); However, inside the debugger I see tmp is null. So there was an error with TTF_RenderText_Solid. I did verify that both font and t are valid. So at least we know it's a problem with the TTF_RenderText_Solid function and not png/tiff libs. My guess is maybe a freetype problem. Segfault for me with media-libs/freetype-2.1.10-r2. Maybe someone else can try with older freetype?
great: emerge -av =freetype-2.1.9-r1 then that works :))
*** Bug 145128 has been marked as a duplicate of this bug. ***
ive added a patch to tuxtype2 so it errors out rather than just segfaulting ... so on my machine, i now get: $ tuxtype2 LoadSettings: Settings file does not exist! settings not loaded TTF_RenderText_Solid(Fish Cascade) failed: Failed loading DPMSDisable: /usr/lib/libX11.so.6: undefined symbol: DPMSDisable i'll dig into that ...
ok that error is bogus ... the reason freetype-2.1.9 works but freetype-2.1.10 fails is that 2.1.10 does sanity checking on the size of the glyph so when tuxtype starts up, it tries to render "Fish Cascade" using sdl-ttf ... but when it tries to render the space, the glyph it sends to freetype is of size 0pixels by 0pixels ... freetype then does a memory size check and since these values are not larger than 0, it returns the error Ft_Err_Invalid_Argument
Created attachment 95909 [details] foo.c this simple app recreates the issue ... to test: gcc -Wall `sdl-config --cflags --libs` -lSDL_ttf foo.c -o foo ./foo
ok this is a bug in freetype rendering of spaces in monospace fonts fails: http://lists.gnu.org/archive/html/freetype/2006-07/msg00009.html i checked our 2.2.1 ebuild and it fails as well, but when i upgrade to latest cvs, my little testcase and tuxtype2 work just fine i'll let the freetype team figure out what needs to be backported (be nice if we had freetype-2.2.1 in ~arch ...)
*** This bug has been marked as a duplicate of 139494 ***