Bug 538044 (examples, fonty.py, from) - fonty.py from pygame examples don't work
Summary: fonty.py from pygame examples don't work
Keywords:
Status: CLOSED ERRATA
Alias: examples, fonty.py, from
Product: Fedora
Classification: Fedora
Component: SDL_ttf
Version: 12
Hardware: i686
OS: Linux
low
low
Target Milestone: ---
Assignee: Thomas Janssen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-17 12:09 UTC by Łukasz Posadowski
Modified: 2015-08-18 01:14 UTC (History)
4 users (show)

Fixed In Version: SDL_ttf-2.0.10-1.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-23 22:02:53 UTC


Attachments (Terms of Use)
Fixes crash with big fonts (2.29 KB, patch)
2010-08-12 12:33 UTC, Jan Kaluža
no flags Details | Diff

Description Łukasz Posadowski 2009-11-17 12:09:48 UTC
Description of problem:
Pygame have problems displaying font in utf-8.

Version-Release number of selected component (if applicable):
Python 2.6.2
Pygame 1.8.1

or

Python 2.6.2
Pygame 1.9.1 (compiled and packaged)

or

Python 2.5.4 (compiled to /opt)
Pygame 1.9.1 (builded by python in /opt)

How reproducible:
always

Steps to Reproduce:
1. run "python fonty.py"
  
Actual results (this is a big one):
$ python fonty.py 
*** glibc detected *** python: double free or corruption (out): 0x09b2f0f8 ***
======= Backtrace: =========
/lib/libc.so.6[0xa09261]
/usr/lib/libSDL_ttf-2.0.so.0(+0x13b6)[0x9003b6]
/usr/lib/libSDL_ttf-2.0.so.0(+0x1432)[0x900432]
/usr/lib/python2.6/site-packages/pygame/font.so(+0x2262)[0x8c7262]
/usr/lib/libpython2.6.so.1.0(PyCFunction_Call+0x12a)[0x30b305a]
/usr/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x4403)[0x310f073]
/usr/lib/libpython2.6.so.1.0(PyEval_EvalFrameEx+0x533b)[0x310ffab]
/usr/lib/libpython2.6.so.1.0(PyEval_EvalCodeEx+0x7aa)[0x3110e4a]
/usr/lib/libpython2.6.so.1.0(PyEval_EvalCode+0x64)[0x3110fb4]
/usr/lib/libpython2.6.so.1.0[0x312c25c]
/usr/lib/libpython2.6.so.1.0(PyRun_FileExFlags+0x93)[0x312c323]
/usr/lib/libpython2.6.so.1.0(PyRun_SimpleFileExFlags+0xe1)[0x312d8c1]
/usr/lib/libpython2.6.so.1.0(PyRun_AnyFileExFlags+0x82)[0x312e162]
/usr/lib/libpython2.6.so.1.0(Py_Main+0xb95)[0x313abd5]
python(main+0x28)[0x80485c8]
/lib/libc.so.6(__libc_start_main+0xe6)[0x9b1bb6]
python[0x8048501]
======= Memory map: ========
00110000-00113000 r-xp 00000000 08:02 223569     /usr/lib/python2.6/lib-dynload/cStringIO.so
00113000-00114000 rw-p 00003000 08:02 223569     /usr/lib/python2.6/lib-dynload/cStringIO.so
00114000-0011a000 r-xp 00000000 08:02 168187     /usr/lib/python2.6/site-packages/pygame/display.so
0011a000-0011b000 rw-p 00005000 08:02 168187     /usr/lib/python2.6/site-packages/pygame/display.so
0011b000-0011d000 r-xp 00000000 08:02 168181     /usr/lib/python2.6/site-packages/pygame/bufferproxy.so
0011d000-0011e000 rw-p 00001000 08:02 168181     /usr/lib/python2.6/site-packages/pygame/bufferproxy.so
0011e000-00120000 r-xp 00000000 08:02 168227     /usr/lib/python2.6/site-packages/pygame/time.so
00120000-00121000 rw-p 00002000 08:02 168227     /usr/lib/python2.6/site-packages/pygame/time.so
00121000-00125000 r-xp 00000000 08:02 168204     /usr/lib/python2.6/site-packages/pygame/mask.so
00125000-00126000 rw-p 00004000 08:02 168204     /usr/lib/python2.6/site-packages/pygame/mask.so
00126000-0012d000 r-xp 00000000 08:02 223585     /usr/lib/python2.6/lib-dynload/operator.so
0012d000-0012f000 rw-p 00006000 08:02 223585     /usr/lib/python2.6/lib-dynload/operator.so
0012f000-00130000 r-xp 00000000 08:02 223529     /usr/lib/python2.6/lib-dynload/_bisectmodule.so
00130000-00131000 rw-p 00001000 08:02 223529     /usr/lib/python2.6/lib-dynload/_bisectmodule.so
00131000-00132000 r-xs 00000000 08:02 126376     /tmp/ffiHLu92c (deleted)
00133000-00138000 r-xp 00000000 08:02 168183     /usr/lib/python2.6/site-packages/pygame/color.so
00138000-00139000 rw-p 00004000 08:02 168183     /usr/lib/python2.6/site-packages/pygame/color.so
00139000-00183000 r-xp 00000000 08:02 168220     /usr/lib/python2.6/site-packages/pygame/surface.so
00183000-00184000 rw-p 0004a000 08:02 168220     /usr/lib/python2.6/site-packages/pygame/surface.so
00184000-0018f000 r-xp 00000000 08:02 344826     /usr/lib/libSDL_image-1.2.so.0.1.6
0018f000-00190000 rw-p 0000b000 08:02 344826     /usr/lib/libSDL_image-1.2.so.0.1.6
00190000-001a0000 rw-p 00000000 00:00 0 
001a0000-001c7000 r-xp 00000000 08:02 344685     /usr/lib/libpng12.so.0.39.0
001c7000-001c8000 rw-p 00026000 08:02 344685     /usr/lib/libpng12.so.0.39.0
001c8000-001ca000 r-xp 00000000 08:02 223547     /usr/lib/python2.6/lib-dynload/_heapq.so
001ca000-001cc000 rw-p 00002000 08:02 223547     /usr/lib/python2.6/lib-dynload/_heapq.so
001cc000-001ce000 r-xp 00000000 08:02 223545     /usr/lib/python2.6/lib-dynload/_functoolsmodule.so
001ce000-001cf000 rw-p 00001000 08:02 223545     /usr/lib/python2.6/lib-dynload/_functoolsmodule.so
001cf000-001d8000 r-xp 00000000 08:02 168209     /usr/lib/python2.6/site-packages/pygame/pixelarray.so
001d8000-001d9000 rw-p 00008000 08:02 168209     /usr/lib/python2.6/site-packages/pygame/pixelarray.so
001d9000-001db000 r-xp 00000000 08:02 168208     /usr/lib/python2.6/site-packages/pygame/overlay.so
001db000-001dc000 rw-p 00001000 08:02 168208     /usr/lib/python2.6/site-packages/pygame/overlay.so
001dc000-001df000 r-xp 00000000 08:02 168206     /usr/lib/python2.6/site-packages/pygame/mixer_music.so
001df000-001e0000 rw-p 00002000 08:02 168206     /usr/lib/python2.6/site-packages/pygame/mixer_music.so
001e0000-001e4000 r-xp 00000000 08:02 168217     /usr/lib/python2.6/site-packages/pygame/scrap.so
001e4000-001e5000 rw-p 00003000 08:02 168217     /usr/lib/python2.6/site-packages/pygame/scrap.so
001e5000-001e7000 r-xp 00000000 08:02 344686     /usr/lib/libXau.so.6.0.0
001e7000-001e8000 rw-p 00001000 08:02 344686     /usr/lib/libXau.so.6.0.0
001e8000-001ed000 r-xp 00000000 08:02 168177     /usr/lib/python2.6/site-packages/pygame/_numericsurfarray.so
001ed000-001ee000 rw-p 00004000 08:02 168177     /usr/lib/python2.6/site-packages/pygame/_numericsurfarray.so
001ee000-001f0000 r-xp 00000000 08:02 168109     /usr/lib/python2.6/site-packages/pygame/_numericsndarray.so
001f0000-001f1000 rw-p 00001000 08:02 168109     /usr/lib/python2.6/site-packages/pygame/_numericsndarray.so
001f1000-001f8000 r-xp 00000000 08:02 223562     /usr/lib/python2.6/lib-dynload/_struct.so
001f8000-001fa000 rw-p 00006000 08:02 223562     /usr/lib/python2.6/lib-dynload/_struct.so
001fa000-00210000 r-xp 00000000 08:02 395138     /usr/lib/python2.6/site-packages/numpy/core/_sort.so
00210000-00211000 rw-p 00016000 08:02 395138     /usr/lib/python2.6/site-packages/numpy/core/_sort.so
00211000-00215000 r-xp 00000000 08:02 223593     /usr/lib/python2.6/lib-dynload/stropmodule.so
00215000-00217000 rw-p 00004000 08:02 223593     /usr/lib/python2.6/lib-dynload/stropmodule.so
00217000-00237000 r-xp 00000000 08:02 344840     /usr/lib/libSDL_mixer-1.2.so.0.2.6
00237000-00240000 rw-p 0001f000 08:02 344840     /usr/lib/libSDL_mixer-1.2.so.0.2.6
00240000-00263000 rw-p 00000000 00:00 0 
00263000-00280000 r-xp 00000000 08:02 344687     /usr/lib/libxcb.so.1.1.0
00280000-00281000 rw-p 0001c000 08:02 344687     /usr/lib/libxcb.so.1.1.0
00281000-00287000 r-xp 00000000 08:02 395136     /usr/lib/python2.6/site-packages/numpy/core/_dotblas.so
00287000-00288000 rw-p 00005000 08:02 395136     /usr/lib/python2.6/site-packages/numpy/core/_dotblas.so
00288000-002a2000 r-xp 00000000 08:02 401533     /usr/lib/atlas/libptf77blas.so.3.0
002a2000-002a3000 rw-p 0001a000 08:02 401533     /usr/lib/atlas/libptf77blas.so.3.0
002a3000-002a8000 r-xp 00000000 08:02 223582     /usr/lib/python2.6/lib-dynload/mathmodule.so
002a8000-002aa000 rw-p 00004000 08:02 223582     /usr/lib/python2.6/lib-dynload/mathmodule.so
002ac000-002af000 r-xp 00000000 08:02 168180     /usr/lib/python2.6/site-packages/pygame/base.so
002af000-002b0000 rw-p 00002000 08:02 168180     /usr/lib/python2.6/site-packages/pygame/base.so
002b0000-002f4000 r-xp 00000000 08:02 395220     /usr/lib/python2.6/site-packages/numpy/core/umath.so
002f4000-002f7000 rw-p 00044000 08:02 395220     /usr/lib/python2.6/site-packages/numpy/core/umath.so
002f7000-002f8000 rw-p 00000000 00:00 0 
002f8000-00309000 r-xp 00000000 08:02 223568     /usr/lib/python2.6/lib-dynload/cPickle.so
00309000-0030a000 rw-p 00011000 08:02 223568     /usr/lib/python2.6/lib-dynload/cPickle.so
0030a000-0030e000 r-xp 00000000 08:02 395239     /usr/lib/python2.6/site-packages/numpy/lib/_compiled_base.so
0030e000-0030f000 rw-p 00003000 08:02 395239     /usr/lib/python2.6/site-packages/numpy/lib/_compiled_base.soPrzerwane

Expected results:
A pygame windows with some text.

Additional info:
Running this by random mix of Python 2.5/2.6 and Pygame 1.8/1.9 give me exactly the same result. Others examples (with fonts, but ASCII only) are OK.

Comment 1 Łukasz Posadowski 2009-11-23 14:57:12 UTC
So I finnaly go step by step with fonty.py example and got it:

font.set_underline(1)

This is the problem. If I change to:

font.set_underline(0)

all works fine. I belive that are other ways to make underline, but it's official example and should work.

I have confirmation, that on Windows problem doesn't exist. I'm wating for people with other Linux distros however.

Comment 2 Fedora Admin XMLRPC Client 2010-08-12 07:25:56 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 3 Jan Kaluža 2010-08-12 12:32:26 UTC
This is actually bug in SDL_ttf. It can be reproduced by rendering some text with big font size (usually more than 50pt, that depends on used font). Code which renders underline overwrites the memory if height of underline is bigger than 2 pixels.

I'm attaching patch which fixes this bug.

Comment 4 Jan Kaluža 2010-08-12 12:33:56 UTC
Created attachment 438425 [details]
Fixes crash with big fonts

Comment 5 Thomas Janssen 2010-08-12 14:01:18 UTC
I'm sorry. My bad. Update to 2.0.10, which fixes that one is on the way. Sorry sorry, i overlooked that update.

Comment 6 Fedora Update System 2010-08-12 14:40:03 UTC
SDL_ttf-2.0.10-1.fc14 has been submitted as an update for Fedora 14.
http://admin.fedoraproject.org/updates/SDL_ttf-2.0.10-1.fc14

Comment 7 Fedora Update System 2010-08-12 14:40:07 UTC
SDL_ttf-2.0.10-1.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/SDL_ttf-2.0.10-1.fc13

Comment 8 Fedora Update System 2010-08-12 14:40:12 UTC
SDL_ttf-2.0.10-1.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/SDL_ttf-2.0.10-1.fc12

Comment 9 Fedora Update System 2010-08-12 19:50:26 UTC
SDL_ttf-2.0.10-1.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update SDL_ttf'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/SDL_ttf-2.0.10-1.fc14

Comment 10 Łukasz Posadowski 2010-08-13 08:56:10 UTC
Yeah - problem is solved. Thanks for your work.

Comment 11 Fedora Update System 2010-08-23 22:02:48 UTC
SDL_ttf-2.0.10-1.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2010-08-23 22:03:35 UTC
SDL_ttf-2.0.10-1.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2010-08-24 01:48:13 UTC
SDL_ttf-2.0.10-1.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2013-05-01 11:54:11 UTC
colorhug-client-0.2.0-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/colorhug-client-0.2.0-1.fc19

Comment 15 Fedora Update System 2015-07-14 16:49:06 UTC
python-astroid-1.3.6-3.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/python-astroid-1.3.6-3.fc22

Comment 16 Fedora Update System 2015-08-18 01:11:54 UTC
reposurgeon-3.28-1.fc23 has been submitted as an update for Fedora 23.
https://admin.fedoraproject.org/updates/reposurgeon-3.28-1.fc23

Comment 17 Fedora Update System 2015-08-18 01:13:33 UTC
reposurgeon-3.28-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/reposurgeon-3.28-1.fc22

Comment 18 Fedora Update System 2015-08-18 01:14:51 UTC
reposurgeon-3.28-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/reposurgeon-3.28-1.el7


Note You need to log in before you can comment on or make changes to this bug.