edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] garbage collection
@ 2014-01-23 20:27 Chris Brannon
  2014-01-24 10:59 ` [Edbrowse-dev] garbage collection1 Adam Thompson
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Brannon @ 2014-01-23 20:27 UTC (permalink / raw)
  To: edbrowse-dev

I'm more and more convinced that the JavaScript crashes are related to
GC and rooting, as Adam suspected.  The crashes I'm seeing are occurring
in jsdom.c, and they seem to involve corruption of the JS heap, not the
heap used for edbrowse strings and other data.
Example: this one at line 1185 of jsdom.c from master:
	    v = JS_NewObject(jcx, cp, NULL, owner);
One of the pointers passed in is apparently pointing to something that
was freed long ago.  I don't think it's jcx or cp, so it must be owner.

So let's switch gears.  I've been working with Adam's code, and it still
has GC / rooting issues.  From what I can tell, JS_DefineProperty can
trigger a GC.  We should not be passing unrooted jsval as the fourth
argument to JS_DefineProperty as this can also lead to a crash.
Also there seems to be a problem in jsloc.cpp, caused by uo, which is a
statically allocated pointer to a JS object that is never rooted.

-- Chris

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

end of thread, other threads:[~2014-01-24 22:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-23 20:27 [Edbrowse-dev] garbage collection Chris Brannon
2014-01-24 10:59 ` [Edbrowse-dev] garbage collection1 Adam Thompson
2014-01-24 14:21   ` Chris Brannon
2014-01-24 14:58     ` Adam Thompson
2014-01-24 22:07       ` Chris Brannon

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).