edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] my very large patch
@ 2014-01-25 22:46 Chris Brannon
  2014-01-26 23:52 ` Adam Thompson
  0 siblings, 1 reply; 6+ messages in thread
From: Chris Brannon @ 2014-01-25 22:46 UTC (permalink / raw)
  To: edbrowse-dev

Ok, it is done.
I think it is too big to send to the list, so here's a link:
http://the-brannons.com/js.patch
The commit message should be a pretty good description of what I've
changed, so I won't rehash it here unless someone has questions.
I may have made mistakes along the way as well.  It's quite possible
that I forgot to use JSAutoCompartment in some places where it is needed.

html.cpp is now compilable with g++, but it requires the -fpermissive
switch.  Turns out that g++ doesn't like Karl's list macros from eb.h,
because of the use of void pointers.  Since html.cpp is now in C++, it
might be a good idea to rewrite the list manipulations to use the list
type from C++'s standard template library.  But not today.

So after doing all that work, I fired up my shiny new edbrowse, and I
eventually managed to make it crash.  Turns out that in some cases, it
has nothing to do with GC at all.
The problem is that in a lot of instances, we do not check the return
value of JS_NewObject, and it will return NULL on an error (such as heap
exaustion).  JS_NewObject returned NULL somewhere, and a bit later on in
the program, a crash ensued because that NULL got passed to
a function that expected a non-NULL.
The JS heap is too small.

The patch is still necessary, though.

-- Chris

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

end of thread, other threads:[~2014-01-27 12:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-25 22:46 [Edbrowse-dev] my very large patch Chris Brannon
2014-01-26 23:52 ` Adam Thompson
2014-01-27  0:49   ` Adam Thompson
2014-01-27  1:22     ` Chris Brannon
2014-01-27 10:35       ` [Edbrowse-dev] my very large patch1 Adam Thompson
2014-01-27 12:29     ` [Edbrowse-dev] my very large patch 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).