iskra / jsonx

JSONX is an Erlang library for efficient decode and encode JSON, written in C.
Other
91 stars 32 forks source link

Segmentation fault under high load on Solaris #17

Closed vjache closed 10 years ago

vjache commented 10 years ago

It seems that there is a bug which exhibits itself under heavy load. In my case this means parsing and encoding huge JSON data ~50mb in parallel by ~10 erlang processes. Oh yes that was a Solaris OS, it might be the reason of a bug.

Anyway it might be interesting for you to see the following (from core dump):

 # mdb core
Loading modules: [ libc.so.1 libuutil.so.1 ld.so.1 ]
> ::stack
libc_psr.so.1`memcpy+0x58(f977be50, 1e46132e, f977bd78, 4000013, 224000, 44dcc)
jsonx.so`match_string+0x1c(f977be50, 1e46132e, f977bd78, f977ba54, 1e461344, 2)
jsonx.so`match_pair+0x60(f977be50, 1e461342, f977bd78, f977bd94, 640bfffb, 2c)
jsonx.so`match_proplist+0x158(f977be50, 1e460de9, f977bd78, f977bb5c, 1e460fb4, 1e460fb4)
jsonx.so`match_tuple+0xd0(f977be50, 1e460fb2, f977bd78, 0, f977bd78, 62080028)
jsonx.so`match_term+0x154(f977be50, 1e460fb2, f977bd78, f977bd94, 640bfd79, 2c)
jsonx.so`match_list+0x1ac(f977be50, 1a800019, f977bd78, 0, e3279240, 419bc)
jsonx.so`match_term+0xec(f977be50, 1a800019, f977bd78, 7cafc, 0, f977bd78)
jsonx.so`encode_nif+0x174(f977be50, 1, fce86180, 3e7, f80e3b98, 27a84388)
process_main+0x6c4c(4, 4, fa216410, 8, fe435788, 1)
sched_thread_func+0x248(fca7f400, f9d00080, f9d00080, 0, f9d00880, 3)
thr_wrapper+0x70(ffbff128, f977c000, 0, 0, 1a0040, 0)
libc.so.1`_lwp_start(0, 0, 0, 0, 0, 0)
vjache commented 10 years ago

It seems its just because of lack of memory.