Closed teepark closed 14 years ago
Interesting bug, I agree that this should not be causing a SIGSEGV. I suppose raising a yajl.RecursionError might be appropriate? simplejson
raises:
ValueError: Circular reference detected
pull request is in - just adding the checks I get "TypeError: Object is not JSON serializable", which isn't bad
crap, just realized i have a bunch of other out-of-date stuff on my master branch. feel free to just cherry-pick 0af93f64e461185a09683794e24757bf14683e34
SHA: e2504262a0f1d5a3bae07c74c637f7260832343b
There is no protection against stack-overflowing infinite recursion from self-referential objects.
Simple repro:
I wrote a test and then realized that a segfaulting python probably won't behave nicely with a hudson setup or your other tests. On the vain hope that there was some crazy black magic in the signal module I tried catching SIGSEGV for the test, but no joy.
It may be too much to ask, passing an incrementing "depth" argument through every ProcessObject call, and that example code is pretty pathological, but I can imagine a recursive relationship legitimately coming up maybe in an instance-caching ORM like SQLAlchemy.
EDIT: oh never mind, yajl already does this, we just have to be looking for status yajl_max_depth_exceeded. expect a pull request soon.