-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Bug Description
Segmentation fault occurs when creating pcolormesh plots, caused by array dimension mismatch in pcolormesh initialization.
Steps to Reproduce
- Create coordinate arrays x(6), y(5) and color array c(5,4)
- Call pcolormesh(x, y, c)
- Program crashes with segmentation fault
Stack Trace
Error in initialize_regular_grid: Array dimension mismatch
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace:
#0 0x7fc98463e53f in ???
#1 0x563848aab920 in __fortplot_pcolormesh_MOD_get_data_range at ././src/fortplot_pcolormesh.f90:201
#2 0x563848a926a4 in add_pcolormesh_plot_data at ././src/fortplot_figure_core.f90:670
#3 0x563848aa4eab in __fortplot_figure_core_MOD_add_pcolormesh at ././src/fortplot_figure_core.f90:243
#4 0x563848ac1be2 in __fortplot_matplotlib_MOD_pcolormesh at ././src/fortplot_matplotlib.f90:102
Expected Behavior
Should either:
- Create pcolormesh plot with proper array handling
- Provide clear error message for dimension mismatch
- Handle edge case gracefully
Actual Behavior
- Program crashes with segmentation fault
- No graceful error handling
Environment
- OS: Linux
- Fortran compiler: gfortran
- Branch: fix-rescue-backlog-commits-272
Test Case
integer, parameter :: nx = 6, ny = 5
real(wp) :: x(nx), y(ny), c(nx-1, ny-1)
! Initialize arrays...
call pcolormesh(x, y, c, colormap='plasma') ! Crashes
Impact
- Critical: Complete program crash
- Affects all pcolormesh plotting functionality
- No workaround available
- Data loss due to segmentation fault
Source Analysis
Issue appears to be in fortplot_pcolormesh.f90 at line 201 in get_data_range function, triggered during pcolormesh initialization.
Metadata
Metadata
Assignees
Labels
No labels