From: Dmitry M. <am...@am...> - 2009-10-13 23:55:50
|
Hi! I'm investigating why zaz game (https://sourceforge.net/projects/zaz/) segfaults in FTGL on FreeBSD. Notable, segfault only happens when 8bit locale is used. That is, it won't segfault on C locale as it won't on ru_RU.UTF-8. However, it does segfault on ru_RU.KOI8-R. Here's gdb output: --- #0 0x281da841 in FTCharmap::GlyphListIndex () from /usr/local/lib/libftgl.so.2 #1 0x281dd86a in FTGlyphContainer::Glyph () from /usr/local/lib/libftgl.so.2 #2 0x281e4807 in FTFontImpl::CheckGlyph () from /usr/local/lib/libftgl.so.2 #3 0x281e5a59 in FTFontImpl::Render () from /usr/local/lib/libftgl.so.2 #4 0x281ea7d0 in FTTextureFontImpl::Render () from /usr/local/lib/libftgl.so.2 #5 0x281e412d in FTFont::Render () from /usr/local/lib/libftgl.so.2 #6 0x0808deed in GenericMenuItem::Render (this=0x29a94d30) at menu.cpp:364 #7 0x0808d36a in Menu::Render (this=0xbfbfe45c) at menu.cpp:68 #8 0x0807dcde in MainMenu::Render (this=0xbfbfe388, frame=1) at mainmenu.cpp:393 #9 0x08054396 in Scenes::Scene::Go (this=0xbfbfe388) at scene.cpp:178 #10 0x08054cef in Scenes::Scene::Run (this=0xbfbfe388) at scene.cpp:61 #11 0x0804f4f2 in main (argc=1, argv=0xbfbfe99c) at main.cpp:211 (gdb) frame 6 #6 0x0808deed in GenericMenuItem::Render (this=0x29a94d30) at menu.cpp:364 364 font->Render(text.c_str()); (gdb) print text $4 = { static npos = 4294967295, _M_dataplus = { <std::allocator<char>> = { <__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, members of std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Alloc_hider: _M_p = 0x29affaac "ïÐÃÉÉ" } } --- My guess is that it doesn't like that koi8-r string. This is confirmed with that it works normally if I feed utf-8 string to it, even on koi8-r locale. I guess that FTGL doesn't work with 8 bit, so the right solution would be to convert all strings ti utf before passing to FTGL. Am I right, or is there some way to tune this behaviour? -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D am...@am... ..: jabber: am...@ja... http://www.amdmi3.ru |