-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
What did you do?
I was faced a problem when using arcade library. It uses Pillow under the hood to work with images. When I tried to draw game score text, I got random crash. I localized the problem and found out that crash is related to the way the Pillow works with font and frees up a resources.
What actually happened?
Crash with an error:
munmap_chunk(): invalid pointer
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
What are your OS, Python and Pillow versions?
- OS: Fedora 30
- Python: 3.7.5
- Pillow: 6.2.1
Code example
Crashing code example (munmap_chunk(): invalid pointer):
import PIL.Image
import PIL.ImageDraw
import PIL.ImageFont
while True:
image = PIL.Image.new("RGBA", (10, 10))
draw = PIL.ImageDraw.Draw(image)
font = PIL.ImageFont.truetype("Arial.ttf", 12)
print(draw.multiline_textsize("Sample", font=font))Works without any problem:
import PIL.Image
import PIL.ImageDraw
import PIL.ImageFont
font = PIL.ImageFont.truetype("Arial.ttf", 12)
while True:
image = PIL.Image.new("RGBA", (10, 10))
draw = PIL.ImageDraw.Draw(image)
print(draw.multiline_textsize("Sample", font=font))jcassee, encukou, DearRude, Fogapod, FromSi and 1 more
Metadata
Metadata
Assignees
Labels
No labels