From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (unknown [IPv6:2602:4b:a4ef:2500:12bf:48ff:fe7c:5584]) by hurricane.the-brannons.com (Postfix) with ESMTPSA id 86FDF779C1 for ; Sat, 25 Jan 2014 14:46:55 -0800 (PST) From: Chris Brannon To: edbrowse-dev@lists.the-brannons.com Date: Sat, 25 Jan 2014 14:46:37 -0800 Message-ID: <87ob2zof1u.fsf@mushroom.PK5001Z> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Subject: [Edbrowse-dev] my very large patch X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jan 2014 22:46:56 -0000 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