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

AndreMiras / pyjnius / 41714381202
88%
master: 88%

Build:
Build:
LAST BUILD BRANCH: fix/export-class-proxy-lifetime
DEFAULT BRANCH: master
Ran 03 Nov 2026 08:41PM UTC
Jobs 1
Files 6
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

03 Nov 2026 08:35PM UTC coverage: 88.388%. Remained the same
41714381202

push

github

AndreMiras
:white_check_mark: Fix use-after-free in export class test

`test_subclasses_work_for_arg_matching` passed a temporary
`SampleIterable()` to `ArrayList.add()` without keeping a Python
reference to it. The Java proxy only stores a raw pointer to its Python
object (see #835), so the object could be garbage collected while the
list still held the proxy.

`isinstance(array_list.get(0), SampleIterable)` then read that pointer,
which is a use-after-free. This needs a cyclic GC pass between `add()`
and `get()`, so the test failed intermittently in CI:
```
>       self.assertIsInstance(array_list.get(0), SampleIterable)
E       AssertionError: <jdk.proxy1.$Proxy2 ...> is not an
E       instance of <class 'test_export_class.SampleIterable'>

test_export_class.py:44: AssertionError
```
- Keep the object in a local variable for the whole test.
- Call `gc.collect()` after `add()`, so the test relies on that
  reference rather than on GC timing.

This is a test-only change; proxy lifetime behavior in `jnius` is
unchanged.

See failing build:
https://github.com/kivy/pyjnius/actions/runs/41687847369/job/126149258008

510 of 577 relevant lines covered (88.39%)

0.88 hits per line

Jobs
ID Job ID Ran Files Coverage
1 41714381202.1 03 Nov 2026 08:41PM UTC 6
88.39
GitHub Action Run
Source Files on build 41714381202
  • Tree
  • List 6
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #41714381202
  • 2385a620 on github
  • Prev Build on master (#41703175204)
  • Next Build on fix/export-class-proxy-lifetime (#42106438547)
  • Delete
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