Neil Stewart <neil.stew...@warwick.ac.uk> writes:

> I have compiled elinks with spidermoney enabled for javascript support. I am
> running a bash script which loads pages useing the -remote
> "openURL(${URL})". After 128 pages, elinks crashes.

I can reproduce similar crashes with upstream ELinks 0.11.4,
0.11.5, and 0.12pre4, using libmozjs1d 1.9.0.8-1.  It often takes
more than 128 pages, however.

The problem seems to be that both JS_InitStandardClasses and
JS_InitClass called from spidermonkey_get_interpreter run out of
memory (tested with a breakpoint in JS_ReportOutOfMemory), and
JS_InitClass returns NULL, which spidermonkey_get_interpreter
happily saves as document_obj and gives back to JS_InitClass,
which eventually crashes in one of these calls.

The out-of-memory error may be caused by ELinks constructing a
large number of JSContexts as described in ELinks bug 981:
http4://bugzilla.elinks.cz/show_bug.cgi?id=981

Regardless of whether that one is fixed, I think we need to make
spidermonkey_get_interpreter check the return values.

Attachment: pgp2RHiEk4l04.pgp
Description: PGP signature

Reply via email to