Closed Bug 522089 Opened 15 years ago Closed 11 years ago

Report fatal JS Errors - Dehydra crashes when calling JSON.stringify from included json2.js

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

1.9.1 Branch
x86_64
Linux
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: humph, Unassigned)

References

()

Details

(Keywords: crash)

I'm trying to use JSON.stringify() in place of uneval(), and when calling it in a dehydra script, I get the always helpful:

g++: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

My dehydra/SM are pretty new (pulled and built within last week).  I've also tried specifying the JS version to use with requires, but no different.  Not sure what to look at next.
Severity: normal → critical
Keywords: crash
Oh this is awesome. the json library uses fancy new JSON.stringify method which fails to detect recursion and blows the stack trying to jsonify cyclical C++ objects. Pretty sure this is a spidermonkey bug
#0  0x002e53ca in js_GetPropertyHelper () from /home/tglek/work/spidermonkey/libmozjs.so
#1  0x002e5705 in js_GetMethod () from /home/tglek/work/spidermonkey/libmozjs.so
#2  0x002d7f3c in js_ValueToIterator () from /home/tglek/work/spidermonkey/libmozjs.so
#3  0x002e879e in JO () from /home/tglek/work/spidermonkey/libmozjs.so
#4  0x002e7ede in Str () from /home/tglek/work/spidermonkey/libmozjs.so
#5  0x002e8b09 in JO () from /home/tglek/work/spidermonkey/libmozjs.so
#6  0x002e7ede in Str () from /home/tglek/work/spidermonkey/libmozjs.so
#7  0x002e860f in JA () from /home/tglek/work/spidermonkey/libmozjs.so
#8  0x002e7ede in Str () from /home/tglek/work/spidermonkey/libmozjs.so
....
#77295 0x002e8b09 in JO () from /home/tglek/work/spidermonkey/libmozjs.so
#77296 0x002e7ede in Str () from /home/tglek/work/spidermonkey/libmozjs.so
#77297 0x002e82ce in js_Stringify () from /home/tglek/work/spidermonkey/libmozjs.so
#77298 0x002e848f in js_json_stringify () from /home/tglek/work/spidermonkey/libmozjs.so
#77299 0x002d04a6 in js_Interpret () from /home/tglek/work/spidermonkey/libmozjs.so
#77300 0x002d64d9 in js_Invoke () from /home/tglek/work/spidermonkey/libmozjs.so
#77301 0x002d6a73 in js_InternalInvoke () from /home/tglek/work/spidermonkey/libmozjs.so
#77302 0x0028fd80 in JS_CallFunctionValue () from /home/tglek/work/spidermonkey/libmozjs.so
#77303 0x0089c8ef in dehydra_visitType (this=0x8a6720, t=0xb7d6ca28) at dehydra.c:628
#77304 0x00895650 in process_record_or_union_type (c=0xb7d6ca28) at dehydra_plugin.c:129
#77305 0x0089582e in process_type (t=0xb7d6ca28) at dehydra_plugin.c:160
#77306 0x008960c0 in gcc_plugin_post_parse () at dehydra_plugin.c:310
#77307 0x087596ff in plugin_go () at ../../gcc-4.3.0/gcc/tree-plugin-pass.c:180
#77308 0x0837c11f in c_common_parse_file (set_yydebug=0) at ../../gcc-4.3.0/gcc/c-opts.c:1301
#77309 0x0872b2b1 in compile_file () at ../../gcc-4.3.0/gcc/toplev.c:1048
#77310 0x0872ce79 in do_compile () at ../../gcc-4.3.0/gcc/toplev.c:2254
#77311 0x0872cedb in toplev_main (argc=7, argv=0xbffcf304) at ../../gcc-4.3.0/gcc/toplev.c:2286
#77312 0x0839c536 in main (argc=Cannot access memory at address 0x0
) at ../../gcc-4.3.0/gcc/main.c:35


It could be that Dehydra is doing something screwy which prevents json from detecting cycles, but I don't know what that'd be.
Looks like I have to opt in recursion protection. I have to set debugErrorHook to some handler for that.

Either way, the json lib wont work as it just bails at any sight of recursion.
Blocks: 437502
Summary: Dehydra crashes when calling JSON.stringify from included json2.js → Report fatal JS Errors - Dehydra crashes when calling JSON.stringify from included json2.js
Dehydra and treehydra are no longer maintained by Mozilla.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.