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

ICRAR / ijson / 298 / 7
100%
master: 100%

Build:
DEFAULT BRANCH: master
Ran 16 Mar 2022 01:58AM UTC
Files 14
Run time 1s
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

16 Mar 2022 01:56AM UTC coverage: 95.033% (+2.7%) from 92.353%
CIBW_SKIP="cp27-win*" CIBW_TEST_REQUIRES=pytest cffi= CIBW_BEFORE_ALL="bash -c 'cmake --help || yum install -y cmake; cd \"{project}\"; sh .github/tools/install_yajl.sh'" CIBW_TEST_COMMAND="bash -c 'cd \"{project}\"; pytest -vv'" CIBW_ENVIRONMENT_WINDOWS="IJSON_EMBED_YAJL=1" TWINE_USERNAME=__token__

push

travis-ci-com

rtobar
Avoid decref'ing the sink argument

In #34 memory leaks were reported on the yajl2_c backend that happened
at generator construction time. After investigation, we discovered one
of these in the "chain" utility method, which leaked the temporary
coroutines it chained together. The fix in a8159e4 (first present in
3.1.2) attempted to fix this particular problem, along with the rest of
the identified memory leaks.

The fix for the "chain" method was not correct though: the condition we
used to identify whether the internal "coro" variable had to be decref'd
was incorrect, and led to our code incorrect decref'ing the "sink"
parameter given by the caller, which was meant to be left untouched.
This opened the door to potential issues when the caller decref'd its
reference to "sink".

The problem was not immediately obvious, as depending on the program's
activity, memory allocator and other factors, the memory used by the
destroyed "sink" object could still be valid. In fact our unit tests
never caught this error, and this problem was only reported to us about
a year after 3.1.2 was released by users who saw this problem only after
creating and destroying ijson.parser objects thousands of times.

To reproduce this issue locally I wrote a small script that created a
list of N ijson.parser generators, and then depleted them in order. Only
when running with N=10k I was able to get a failure every 2 or 3
executions.  After applying this patch I saw no failures, so I'm fairly
confident the issue is gone.

This problem was reported originally in #66, which this commit should
fix.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>

861 of 906 relevant lines covered (95.03%)

0.95 hits per line

Source Files on job 298.7 (CIBW_SKIP="cp27-win*" CIBW_TEST_REQUIRES=pytest cffi= CIBW_BEFORE_ALL="bash -c 'cmake --help || yum install -y cmake; cd \"{project}\"; sh .github/tools/install_yajl.sh'" CIBW_TEST_COMMAND="bash -c 'cd \"{project}\"; pytest -vv'" CIBW_ENVIRONMENT_WINDOWS="IJSON_EMBED_YAJL=1" TWINE_USERNAME=__token__)
  • Tree
  • List 0
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 304
  • Travis Job 298.7
  • c5229082 on github
  • Prev Job for CIBW_SKIP="cp27-win*" CIBW_TEST_REQUIRES=pytest cffi= CIBW_BEFORE_ALL="bash -c 'cmake --help || yum install -y cmake; cd \"{project}\"; sh .github/tools/install_yajl.sh'" CIBW_TEST_COMMAND="bash -c 'cd \"{project}\"; pytest -vv'" CIBW_ENVIRONMENT_WINDOWS="IJSON_EMBED_YAJL=1" TWINE_USERNAME=__token__ on master (#297.2)
  • Next Job for CIBW_SKIP="cp27-win*" CIBW_TEST_REQUIRES=pytest cffi= CIBW_BEFORE_ALL="bash -c 'cmake --help || yum install -y cmake; cd \"{project}\"; sh .github/tools/install_yajl.sh'" CIBW_TEST_COMMAND="bash -c 'cd \"{project}\"; pytest -vv'" CIBW_ENVIRONMENT_WINDOWS="IJSON_EMBED_YAJL=1" TWINE_USERNAME=__token__ on master (#300.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc