in reply to [SOLVED] JSON::XS parsing error when incrementally parsing JSON file - "panic: sv_chop"
G'day ateague,
I tried running your code but found I didn't have JSON::XS installed under v5.24. On attempting to install using cpan, I got a message which in essence said:
"... standard perl versions 5.022 and up are not supported by JSON::XS."
The full message, in the spoiler below, was far more detailed.
As the installation ran to completion, I tried your script and got:
$ pm_1175565_json_xs_sv_chop_panic.pl End of document 1 panic: sv_chop ptr=7faa01441e79, start=7faa0140eb30, end=7faa0140ecf0 +at ./pm_1175565_json_xs_sv_chop_panic.pl line 41, <DATA> chunk 886.
The "panic: sv_chop %s" diagnostic was introduced in v5.12 (see "perl5120delta: New Diagnostics"):
- panic: sv_chop %s
This new fatal error occurs when the C routine Perl_sv_chop() was passed a position that is not within the scalar's string buffer. This could be caused by buggy XS code, and at this point recovery is not possible.
I don't have sufficient knowledge of Perl's 'C' internals to help further on that front.
You could try installing JSON::XS under a version of Perl earlier than v5.22; however, given ++stevieb's results under v5.16.3, you should probably look more closely at your script for other issues.
Also note that the current version of JSON (2.90) has (in its VERSION section):
"This version is compatible with JSON::XS 2.34 and later. (Not yet compatble to JSON::XS 3.0x.)"
So, perhaps you might have more success with earlier versions of both Perl and JSON::XS.
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: JSON::XS parsing error when incrementally parsing JSON file - "panic: sv_chop"
by ateague (Monk) on Nov 09, 2016 at 22:43 UTC |