edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] out of memory errors
@ 2014-02-23 18:41 Chris Brannon
  2014-02-23 19:38 ` Adam Thompson
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Brannon @ 2014-02-23 18:41 UTC (permalink / raw)
  To: edbrowse-dev

I'm seeing unhandled out-of-memory conditions in domLink and in
handlerSet.  One of these is eventually ending in a segfault.  I can't
tell which one.

Example from jsdom.cpp, line 1522:
				if (JS_DefineProperty(cw->jss->jcx, owner,
						  idname, vv, NULL, NULL, attr) == JS_FALSE)
return NULL;

The failed domLink calls produce hundreds of "out of memory" messages.
We're doing error checking and returning NULL on error, but
javaSessionFail is never called.
So how do you all want to fix it?  Should I just add javaSessionFail()
to the error legs?  I'm willing to write the patch today.

handlerSet is a little more complicated, because it calls
JS_CompileFunction, which can fail for lots of reasons such as a syntax
error.  We're not doing any error checking there at all, but we should
at least try to catch the out of memory condition.
So I wonder about adding the call to javaSessionFail(); to
my_ErrorReporter directly:

	if (report && report->errorNumber == JSMSG_OUT_OF_MEMORY ||
	    message && strstr(message, "out of memory")) {
		i_puts(MSG_JavaMemError);
		javaSessionFail();
}

-- Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-23 19:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-23 18:41 [Edbrowse-dev] out of memory errors Chris Brannon
2014-02-23 19:38 ` Adam Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).