1. pygame
  2. pygame
  3. pygame

Issues

Issue #50 resolved

Calling repr() on Event causes segfault

René Dudfield
created an issue

== , 2010-07-27 00:48:14 -0700

{{{ In my pygame application I use a number of user-defined events to pass objects around the different components. These objects turn out to be relatively large sometimes. Every now and then, my application terminated with a segmentation fault but only when logging was active. The reason for this is the event_str function in src/event.c that returns the Event object's representation, e.g for printing it to stdout. It reserves a fixed length (1024) for the string representation which can overflow easily.

The following code illustrates the problem quite well:

import pygame print pygame.event.Event(pygame.USEREVENT, data=range(1000)) }}}


Comments (1)

  1. Log in to comment