llnl / llnl/Spindle

sp_init has dead code but could call free twice

Open
#168 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.