Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Segfault in FT2Font.set_text(...) #30538

@Nicolas-Bechstedt

Description

@Nicolas-Bechstedt

Bug summary

A Segfault happens when calling fm.get_font(...). This happens at least on the current main version for python 3.13 in conda-forge.

Code for reproduction

import matplotlib.font_manager as fm

font = fm.get_font("C:\\Windows\\Fonts\\arial.ttf")
font.set_text("lp")

Actual outcome

No output, the program simply stops without output (Is there a way to enable C Code debugging, so we get a stacktrace for the Segfault?).
Running the code as a subprocess or as a jupyter notebook the return code is 3221225477 (0xC0000005)

Expected outcome

The program exits as normal (exit code 0)

Additional information

After updating my conda environment today, I noticed that suddenly sns.heatmap crashed my program. Debugging the code I arrived at the provided minimal example.
The exact version is win-64/matplotlib-3.10.6-py313hfa70ccb_1.conda

Operating system

Windows

Matplotlib Version

3.10.6

Matplotlib Backend

qtagg & agg both

Python version

Python 3.13.7

Jupyter version

No response

Installation

conda

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions