The Wayback Machine - https://web.archive.org/web/20201108135820/https://github.com/residuum/PuRestJson/issues/43
Skip to content
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

Large JSON file crashes encode/decode #43

Closed
nyboer opened this issue May 6, 2016 · 4 comments
Closed

Large JSON file crashes encode/decode #43

nyboer opened this issue May 6, 2016 · 4 comments
Labels

Comments

@nyboer
Copy link

@nyboer nyboer commented May 6, 2016

Working on an ARM7 computer (NTC CHIP) running a debian 4.3 kernel.
I opened this file with json_encode and tried to decode it. PD 046-7 crashes. Yes, it's quite big, as far as JSON files go. Using purest json installed with apt-get from stretch repo.

sis.txt
patchimg

@residuum
Copy link
Owner

@residuum residuum commented May 9, 2016 •

Does the problem occur, when you load the file for the second time? If so, then I can reproduce this bug, because [json-encode] is then crashing while freeing the first stored object.

@nyboer
Copy link
Author

@nyboer nyboer commented May 9, 2016

Yes, it seems to be a problem on the 2nd click. If I click it once, it seems to do nothing, if I click it again, it crashes pd with an error like:

*** Error in `pd': free(): invalid pointer: 0x000ed7cf ***

Also, I tried to hang a "print" object off the end of that [t a a]. PD hangs, and I got

 *** Error in `pd': corrupted double-linked list: 0x000ed878 ***

in the terminal. Can't consistently reproduce that, though.

@residuum residuum added the medium label May 19, 2016
@residuum
Copy link
Owner

@residuum residuum commented Jun 22, 2016 •

Update:

  1. [read( on [json-encode] does not output anything, it only loads the content of the file. To output the stored JSON, use [bang(.
  2. It boils down to json_object_put() from json-c segfaulting. Investigating in it right now.
@residuum
Copy link
Owner

@residuum residuum commented Jun 23, 2016 •

OK, I have already had the same issue with [json-decode]. Time to make a sample application in C and report the bug to json-c.

This segfaults:

json_object_put(jobj);

This is the segfault in [json-decode]:

/*json_object_put(jobj);*/

Not calling json_object_put() leads to memory leaks, which would be a workaround, but should be fixed. I will commit a hotfix wth a commented out line in json-encode.c, and will work with json-c maintainers to fix that issue later.

Similar issue reported to json-c
json-c/json-c#158

@residuum residuum closed this in 23af780 Jun 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.