• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / Qiskit.jl / 36210661065
86%

Build:
DEFAULT BRANCH: main
Ran 26 Sep 2026 02:07AM UTC
Jobs 1
Files 11
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Sep 2026 02:03AM UTC coverage: 85.603% (+0.6%) from 84.99%
36210661065

push

github

web-flow
Don't free a TargetEntry that Qiskit has already taken (#84)

* Don't free a TargetEntry that Qiskit has already taken

`qk_target_add_instruction` cleared the wrapper's pointer only after the C call
returned normally, so a call that raised left the pointer set.  Qiskit takes
ownership of a valid entry whether or not the instruction is successfully added,
so the entry had already been freed, and our finalizer freed it a second time.

Reaching this needs no unusual code -- build a target, add the same gate twice,
handle the error, carry on:

    try
        qk_target_add_instruction(target, duplicate)
    catch
    end

The second free aborts the process with `free(): invalid size` once the
finalizer runs, and in a loop it instead segfaults during finalization at exit,
after the user's code has finished and with nothing to point at the cause.
Neither is catchable from Julia.

Clear the pointer in a `finally` block so it is cleared on both paths.

That Qiskit consumes the entry unconditionally is confirmed by the maintainers
in https://github.com/Qiskit/qiskit/issues/17051 -- an `AlignmentError` return
is the only case that does not take ownership, and in that case the pointer was
never a valid entry to begin with, so there is nothing to free.

Assisted-by: Claude Opus 5

* Prune a comment

3 of 3 new or added lines in 1 file covered. (100.0%)

440 of 514 relevant lines covered (85.6%)

70.38 hits per line

Jobs
ID Job ID Ran Files Coverage
1 36210661065.1 26 Sep 2026 02:07AM UTC 11
85.6
GitHub Action Run
Source Files on build 36210661065
  • Tree
  • List 11
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36210661065
  • b85310a8 on github
  • Prev Build on main (#36155601473)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc