Skip to content

Fix segmentation fault on laplacian computation with python backend #29

Description

@lorenzovarese

Bug Report: Segmentation Fault in gt2py_fo_exec Test Suite for Python Backend

Description

In the test suite for gt2py_fo_exec, the test methods related to the Python backend are currently commented out due to a segmentation fault that occurs when the test suite is executed with these tests enabled. Below is a detailed description of the issue and the steps to reproduce it.

Steps to Reproduce

  1. Uncomment the following line in gt2pt_fo_exec.jl:

    testwrapper(setup_cartesian_offset_provider, test_lap, "py", constant_cartesian_field) # TODO: fix segmentation fault on py backend
  2. Run the test suite using the following command:

    julia --project=. --threads 8 test/gt2py_fo_exec.jl

Environment

  • Operating System: macOS
  • Processor: Apple M2
  • Memory: 16 GB RAM
  • Julia Version: 1.10.4 (Homebrew installation)

Error Message

When running the test suite with the Python backend tests enabled, the following segmentation fault is encountered:

Executing 'test_lap' with args: py, constant_cartesian_field
Testset GT2Py fo exec: Test Failed at
[39957] signal (11.2): Segmentation fault: 11
in expression starting at /Users/lorenzovarese/CSCS/GridTools.jl/test/gt2py_fo_exec.jl:709
gc_mark_and_steal at /opt/homebrew/Cellar/julia/1.10.4/lib/julia/libjulia-internal.1.10.4.dylib (unknown line)
gc_mark_loop_parallel at /opt/homebrew/Cellar/julia/1.10.4/lib/julia/libjulia-internal.1.10.4.dylib (unknown line)
jl_gc_mark_threadfun at /opt/homebrew/Cellar/julia/1.10.4/lib/julia/libjulia-internal.1.10.4.dylib (unknown line)
_pthread_start at /usr/lib/system/libsystem_pthread.dylib (unknown line)
Allocations: 34692194 (Pool: 34657804; Big: 34390); GC: 50
[2]    39957 segmentation fault  julia --project=. --threads 8 test/gt2py_fo_exec.jl

Additional Information

This issue is consistently reproducible on my local development machine with the specifications listed above. The segmentation fault seems to be related to garbage collection (gc_mark_and_steal) and threading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions