Skip to content

Fix solver destructor segfault#197

Merged
slarson merged 1 commit intoow-0.9.8from
codex/add-unit-tests-for-opencl-solver
Jun 29, 2025
Merged

Fix solver destructor segfault#197
slarson merged 1 commit intoow-0.9.8from
codex/add-unit-tests-for-opencl-solver

Conversation

@slarson
Copy link
Copy Markdown
Member

@slarson slarson commented Jun 29, 2025

Summary

  • initialize _particleIndex and gridNextNonEmptyCellBuffer pointers to nullptr
  • reset pointers to nullptr inside owOpenCLSolver::destroy() to avoid double free or deleting garbage

The change prevents a segmentation fault when constructing owOpenCLSolver without valid buffers.

Testing

  • make
  • ./Release/Sibernetic -no_g -l_to lpath=tests/data/reference_run logstep=50 timelimit=0.00025 timestep=0.000005 -f configuration/test/test_energy
  • ./test.sh (fails: File simulations/.../worm_motion_log.txt missing)

https://chatgpt.com/codex/tasks/task_b_6860b94aa2a0832a823a12edc78df5e8

@slarson slarson merged commit 9b297ce into ow-0.9.8 Jun 29, 2025
4 checks passed
@slarson slarson deleted the codex/add-unit-tests-for-opencl-solver branch June 29, 2025 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant