sp_init has dead code but could call free twice
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 110
- Forks
- 35
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 2
Description
### Bug:
`spindle_ctx_destroy` doesn't get called since `logerrno_printf_and_return` macro expands with its own return. `ctx` will still be freed in destructor but potential for double free.
https://github.com/llnl/Spindle/blob/585dacff6734eb039d318577711d47c5b950699c/src/flux/flux-spindle.c#L594-L598
macro:
https://github.com/llnl/Spindle/blob/585dacff6734eb039d318577711d47c5b950699c/src/flux/flux-spindle.c#L56-L62
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/flux/flux-spindle.c at lines 594-598, then inspect the logerrno_printf_and_return macro at lines 56-62 and trace the cleanup paths for ctx. Confirm the corrected control flow leaves one owner for ctx and removes the unreachable cleanup and double-free risk.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- hpc
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100