Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Compiler Flag Drift May Affect matplotlib ABI Stability via Memory Assumptions #30064

Closed as not planned
Labels
@BryteLite

Description

@BryteLite

Bug summary

Summary

Matplotlib may be vulnerable to ABI and memory alignment issues caused by C23 default behaviors in GCC 15.1. Silent adoption of padding behavior changes — particularly in union or struct definitions used in NumPy or Pandas C extensions — may lead to unpredictable runtime behavior.

This issue was originally identified in NumPy, Cython andMeson. As Matplotlib includes Meson and relies on NumPy for internal memory layout, it is downstream vulnerable.

These compiled pieces are sensitive to pointer alignment, ABI expectations, or padding behaviors — especially across environments.

##Reproducible Example

Please see section below

Possibly related to:

Bug: interpolation_stage="data" removes too many pixels in the vicinity of nans in upsampled, interpolated images
Bug: memory baking figure is not freed when figure is closed
Missing type hints for matplotlib.dates.DateFormatter
MNT: Python 3.14.0a7 test failures

While these examples originate from different baselines, they exhibit a common theme: ABI drift between independently compiled modules. This behavior may also be present in earlier releases where build procedures lacked explicit compilation flags across Python packages.

Report for more context:
Report

Code for reproduction

importnumpyasnpimportmatplotlib.pyplotasplt# Create a matrix with a single NaN valuematrix=np.ones((5,5))matrix[2,2]=np.nanfig,axs=plt.subplots(1,2,figsize=(10,5),layout="constrained")# Interpolation at data stageaxs[0].imshow(matrix,interpolation="bilinear",interpolation_stage="data")axs[0].set_title("Stage: data (NaN overspill?)")# Interpolation at RGBA stageaxs[1].imshow(matrix,interpolation="bilinear",interpolation_stage="rgba")axs[1].set_title("Stage: rgba (Expected NaN spread)")plt.suptitle("NaN Propagation Comparison by Interpolation Stage")plt.show()

Actual outcome

Interpolating at the data stage causes NaN values to overspill far beyond their origin, resulting in unexpected blank areas in plots. By contrast, the same data interpolated at the rgba stage shows localized NaN effects, which aligns with user expectation.

This may reflect memory interpretation differences in how NaNs are detected in interpolated image data, potentially tied to buffer access order or build settings.

Expected outcome

NaNs should propagate locally during bilinear interpolation. The presence of a single NaN should not render large swaths of the image as undefined when interpolating at the data stage.

Additional information

Matplotlib version: e.g., 3.10.3

Backend: Agg or default interactive backend

Python version: 3.13.X

NumPy version: 2.2.5 (2.2.6 was just recently released)

Operating system

No response

Matplotlib Version

3.10.3

Matplotlib Backend

No response

Python version

3.13.3

Jupyter version

No response

Installation

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp