jhthorsen / json-validator

:cop: Validate data against a JSON schema
https://metacpan.org/release/JSON-Validator
56 stars 58 forks source link

more-bundle.t hangs on windows #170

Closed chorny closed 4 years ago

chorny commented 5 years ago
Deep recursion on subroutine "JSON::Validator::_resolve" at C:\Strawberry260\cpan\build\JSON-Validator-3.14-0\blib\lib/JSON/Validator.pm line 542.
Deep recursion on subroutine "JSON::Validator::_resolve_ref" at C:\Strawberry260\cpan\build\JSON-Validator-3.14-0\blib\lib/JSON/Validator.pm line 505.
YAML::XS Error: Expected STREAM_START_EVENT; Got: 0 != 1 at C:\Strawberry260\cpan\build\JSON-Validator-3.14-0\blib\lib/JSON/Validator.pm line 358.
(hangs)
perlpunk commented 5 years ago

@chorny Just to factor out YAML::XS here - could you possibly test with the newest YAML::XS 0.80?

The error message could point to a memory leak when loading invalid YAML, and I just fixed a leak.

chorny commented 5 years ago

Tested with 0.80, same problem

jhthorsen commented 4 years ago

Sorry, I don't have windows, so I won't be able to figure out why this doesn't work.

Also seems to only be an issue on certain versions of Windows..? https://app.thorsen.pm/cpantestreport/dist/JSON-Validator-3.14?osname=MSWin32

karenetheridge commented 4 years ago

Well that's indicating that a change made in bundle (or one of the private methods it uses) didn't work, since the tests in more-bundle.t used to cause infinite recursion until the implementation was changed. Interesting that this only happens on windows! perhaps a difference with how Tie::RefHash is implemented?

rai-gaurav commented 4 years ago

Just FYI - I also got the similar issue with the new version.

JSON::Validator version: 3.16 Perl version: 5.30.0 (Strawberry) Operating system: Windows 10

t/load-yaml.t .......................... ok
t/more-bundle.t ........................ Deep recursion on subroutine "JSON::Validator::_resolve" at C:\berrybrew\5.30.0_64\cpan\build\JSON-Validator-3.16-2\blib\lib/JSON/Validator.pm line 574.
Deep recursion on subroutine "JSON::Validator::_resolve" at C:\berrybrew\5.30.0_64\cpan\build\JSON-Validator-3.16-2\blib\lib/JSON/Validator.pm line 574.
Deep recursion on subroutine "JSON::Validator::_resolve" at C:\berrybrew\5.30.0_64\cpan\build\JSON-Validator-3.16-2\blib\lib/JSON/Validator.pm line 574.
Deep recursion on subroutine "JSON::Validator::_resolve" at C:\berrybrew\5.30.0_64\cpan\build\JSON-Validator-3.16-2\blib\lib/JSON/Validator.pm line 574.
Deep recursion on subroutine "JSON::Validator::_resolve_ref" at C:\berrybrew\5.30.0_64\cpan\build\JSON-Validator-3.16-2\blib\lib/JSON/Validator.pm line 537.
jhthorsen commented 4 years ago

Fixed by @charsbar in #180.