Skip to content

Testing issue: py-matplotlib failed with error 0x62: raster overflow #5589

Description

@tpadioleau

Steps to reproduce the failure(s) or link(s) to test output(s)

  1. Install the following environment:
spack:
  concretizer:
    reuse: false
    unify: true
  mirrors:
    spack-cache:
      url: https://binaries.spack.io/v2026.06.0
      binary: true
      signed: false
  packages:
    all:
      require:
        - 'target=x86_64_v3'
  repos:
    builtin:
      tag: v2026.06.0
  specs:
    - py-matplotlib /wvrvnko2klh7sm5a5szdetsl4yy2fwil
    - py-numpy
  1. Run the following commands:
import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 2, 100)
plt.plot(x, np.sin(x))
plt.savefig("test.png")

Error message

Error message
Traceback (most recent call last):
  File "/local/home/tpadiole/Codes/gyselalibxx/test.py", line 6, in 
    plt.savefig("test.png")
    ~~~~~~~~~~~^^^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/pyplot.py", line 1346, in savefig
    res = fig.savefig(fname, **kwargs)  # type: ignore[func-returns-value]
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/figure.py", line 3515, in savefig
    self.canvas.print_figure(fname, **kwargs)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/backend_bases.py", line 2281, in print_figure
    result = print_method(
        filename,
    ...<3 lines>...
        bbox_inches_restore=_bbox_inches_restore,
        **kwargs)
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/backend_bases.py", line 2138, in 
    print_method = functools.wraps(meth)(lambda *args, **kwargs: meth(
                                                                 ~~~~^
        *args, **{k: v for k, v in kwargs.items() if k not in skip}))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py", line 537, in print_png
    self._print_pil(filename_or_obj, "png", pil_kwargs, metadata)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py", line 485, in _print_pil
    FigureCanvasAgg.draw(self)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py", line 438, in draw
    self.figure.draw(self.renderer)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/artist.py", line 94, in draw_wrapper
    result = draw(artist, renderer, *args, **kwargs)
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/artist.py", line 71, in draw_wrapper
    return draw(artist, renderer)
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/figure.py", line 3282, in draw
    mimage._draw_list_compositing_images(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        renderer, self, artists, self.suppressComposite)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/image.py", line 133, in _draw_list_compositing_images
    a.draw(renderer)
    ~~~~~~^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/artist.py", line 71, in draw_wrapper
    return draw(artist, renderer)
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/axes/_base.py", line 3350, in draw
    mimage._draw_list_compositing_images(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        renderer, self, artists, self.get_figure(root=True).suppressComposite)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/image.py", line 133, in _draw_list_compositing_images
    a.draw(renderer)
    ~~~~~~^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/artist.py", line 71, in draw_wrapper
    return draw(artist, renderer)
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/axis.py", line 1481, in draw
    tick.draw(renderer)
    ~~~~~~~~~^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/artist.py", line 71, in draw_wrapper
    return draw(artist, renderer)
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/axis.py", line 294, in draw
    artist.draw(renderer)
    ~~~~~~~~~~~^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/artist.py", line 71, in draw_wrapper
    return draw(artist, renderer)
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/text.py", line 909, in draw
    textrenderer.draw_text(gc, x, y, clean_line,
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
                           self._fontproperties, angle,
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                           ismath=ismath, mtext=mtext)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py", line 245, in draw_text
    self._draw_text_glyphs_and_boxes(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        gc, x, y, angle,
        ^^^^^^^^^^^^^^^^
        ((item.ft_object, size, item.glyph_index, 0, 1, item.x, item.y)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         for item in items),
         ^^^^^^^^^^^^^^^^^^^
        [])
        ^^^
  File "/local/home/tpadiole/spack-1.2.1/var/spack/environments/test/.spack-env/view/lib/python3.14/site-packages/matplotlib/backends/backend_agg.py", line 189, in _draw_text_glyphs_and_boxes
    bitmap = font._render_glyph(
        glyph_index, load_flags,
        RenderMode.NORMAL if gc.get_antialiased() else RenderMode.MONO)
RuntimeError: FT_Render_Glyph (ft2font_wrapper.cpp line 1934) failed with error 0x62: raster overflow

Information on your system or the test runner

  • Spack: 1.2.1
  • Builtin repo: d4f7c71
  • Python: 3.14.4
  • Platform: linux-ubuntu26.04-icelake

Additional information

@adamjstewart @rgommers

Note that it seems to work well with freetype@2.14.1.

General information

  • I have reported the version of Spack/Python/Platform/Runner
  • I have run spack maintainers <name-of-the-package> and @mentioned any maintainers
  • I have uploaded any available logs
  • I have searched the issues of this repo and believe this is not a duplicate

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