Skip to content

fix memory leaks, data races, and teardown crashes in profiler layer - #5

Merged
rjodinchr merged 1 commit into
mainfrom
dev
Jul 29, 2026
Merged

rjodinchr merged 1 commit into
mainfrom
dev

Conversation

@rjodinchr

Copy link
Copy Markdown
Collaborator
  • Fix host memory leak of cl_event in clEnqueueNDRangeKernel by using stack allocation when the caller passes a null event pointer.
  • Fix data race on program/kernel maps by resolving and copying names to callback_data at enqueue time instead of accessing maps from the helper thread.
  • Fix teardown race condition and potential deadlock in clReleaseCommandQueue by tracking pending callbacks, releasing g_lock before joining the thread, and verifying queue validity in the callback.
  • Add safety check for clGetDeviceAndHostTimer to prevent crashes on OpenCL 1.2/2.0 implementations.
  • Add missing <stdlib.h> include to tests/host.c.

@rjodinchr
rjodinchr force-pushed the dev branch 5 times, most recently from e58e3e4 to be458d5 Compare July 29, 2026 15:24
- Fix host memory leak of `cl_event` in `clEnqueueNDRangeKernel` by using
  stack allocation when the caller passes a null event pointer.
- Fix data race on program/kernel maps by resolving and copying names to
  `callback_data` at enqueue time instead of accessing maps from the
  helper thread.
- Fix teardown race condition and potential deadlock in
  `clReleaseCommandQueue` by tracking pending callbacks, releasing `g_lock`
  before joining the thread, and verifying queue validity in the callback.
- Add safety check for `clGetDeviceAndHostTimer` to prevent crashes on
  OpenCL 1.2/2.0 implementations.
- Add missing `<stdlib.h>` include to `tests/host.c`.
@rjodinchr
rjodinchr merged commit 0eef567 into main Jul 29, 2026
16 of 17 checks passed
@rjodinchr
rjodinchr deleted the dev branch July 29, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant