Crash when parsing a big json file

Issue #25 resolved
Teemu Halmela created an issue

If I try to parse this json file the toolkit crashes. This is the same test as j0185 except it has newlines and spaces removed.

It crashes because bigkey->count isn't incremented when bigkey is expanded and this mismatch compounds over time and things start to crash. The normal version isn't crashing because the count is incremented on empty chars, so the bigkey will grow (unnecessarily) and we have enough room to put all the real values.

By discarding the empty chars (code) the normal version will also crash.

To fix this crash we can apply this fix.

Other way and maybe better, so we don't need the empty char stuff, might be this fix.

Comments (2)

  1. Former user Account Deleted

    Ok, fix for json_grow_key. Thanks.

    • Yips Super Driver - tests driver - 1.1.4-sg5 toolkit - Crash when parsing a big json file (Halmela)
    bash-4.3$ ./test1000_sql400json32 ../json/j0186_pgm_hamela04-ds-rpg-occurs-500-slim  
    input(5000000):
    {"pgm":[{"name":"HAMELA04","lib":"DB2JSON"},
    
    :
    
    arm11":"äöÄÖåÅáÁàÀ"}]}]}
    
    result:
    success (0)
    

    Note: I used your idea for count (k). However, I wanted to keep the key count and max internals 'encapsulated' in json_grow_key (C++ish). Thanks.

  2. Log in to comment