Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have been getting a similar problem using python 2.7. I've found two causes of this segmentation fault in my own program, but I only have a solution to one of them.</p> <p>Cause 1. Initialising fonts with no path, ie calling:</p> <pre><code>pygame.font.Font(None, font_size) </code></pre> <p>In this case, <a href="http://valgrind.org/" rel="nofollow">valgrind</a> reports an invalid read at the address 0x0 in ??? in <code>pygame.font.so</code></p> <p>I would guess that this is because None is converted to a NULL pointer which something then assumes is a valid const char* string. </p> <p>The fix for this problem is to always supply a valid path to a font.</p> <p>Cause 2. Rendering unicode characters in fonts</p> <pre><code>pygame.font.Font("data/DejaVuSans.ttf", 14).render(u'\u2654') </code></pre> <p>valgrind reports an invalid read in PyString_AsString in libpython2.7.so.1.0</p> <p>I'm sorry to say I don't have a solution for this.</p> <p>PS: I have just found another unicode related (but not pygame related) cause of problems with cxfreeze.</p> <pre><code>print u'\u2654' </code></pre> <p>In the python interpreter will print a king (chess piece), but when the script is compiled with cxfreeze, I get the following error (not a segmentation fault):</p> <pre><code>UnicodeEncodeError: 'ascii' codec can't encode character u'\u2654' in position 0: ordinal not in range(128) </code></pre> <p>You also get this error in the python interpreter if you call:</p> <pre><code>print str(u'\u2654') </code></pre> <p>This seems to indicate that cxfreeze is assuming strings are always ascii strings.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload