-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault in @3.0.2 #29
Comments
Example backtrace:
So, unsurprisingly, blame on the line added in 80da1dc |
Thanks for the report @roll and for the details @bz2. This is indeed caused by the (buggy itself) fix for #28, which in hindsight is obviously wrong (isn't it always?). Also, despite we having 200+ unit tests and 99+% coverage this wasn't caught by our tests, so one can never be too prepared... The problem should only appear when the top-level JSON structure is an array. I'll add tests to confirm I can duplicate the problem, and then will fix it, which will be easy. Expect a fix and a new release coming up shortly. |
This problem was caused by calling Py_DECREF() more than once on the static, global PyObject* "item" variable that we use to keep the "item" string literal in memory. The situation only arouse when the top-level JSON value was an array, and therefore did not hit all users necessarily. More than one of our tests use arrays as their top-level JSON values that went through parse_basecoro, so in principle we should have hit the bug, but it still went unnoticed. This might have been just luck, with the python memory allocator playing in our favor and placing valid objects back into the memory previously used by the "item" variable before we decreased its reference count again. In order to reproduce the error more reliably more tests need to be added to try and hit the problem with a higher chance. This problem was originally reported in #29, and was a direct consequence of the fix introduced to fix #28. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
These new tests have higher chances of identifying issues like that exposed in #29, and in fact they helped reproducing the problem and finding the solution. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
Hi @rtobar, Thanks! |
ijson 3.0.3 is now available in PyPI. |
Thanks! |
Hi,
We've run into https://travis-ci.org/github/frictionlessdata/tabulator-py/jobs/678168760 on
which happened on @3.0.2 but works with @3.0.1
The text was updated successfully, but these errors were encountered: