Summary: | freetype: error rendering space character in mono mode (libsdl/sdl-tff crashes) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jon Hurst <untrusted> |
Component: | [OLD] Games | Assignee: | Gentoo Fonts Team <fonts> |
Status: | RESOLVED DUPLICATE | ||
Severity: | major | CC: | bugs, edge, games |
Priority: | High | ||
Version: | 2006.0 | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | foo.c |
Description
Jon Hurst
2006-08-01 11:46:43 UTC
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 ...) |