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 187327788B for ; Fri, 24 Jan 2014 14:07:44 -0800 (PST) From: Chris Brannon To: edbrowse-dev@lists.the-brannons.com References: <87lhy6qw9t.fsf@mushroom.PK5001Z> <20140124105929.GC12450@toaster.adamthompson.me.uk> <878uu5qx3y.fsf@mushroom.PK5001Z> <20140124145833.GE12450@toaster.adamthompson.me.uk> Date: Fri, 24 Jan 2014 14:07:27 -0800 In-Reply-To: <20140124145833.GE12450@toaster.adamthompson.me.uk> (Adam Thompson's message of "Fri, 24 Jan 2014 14:58:33 +0000") Message-ID: <87mwilowyo.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: Re: [Edbrowse-dev] garbage collection1 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: Fri, 24 Jan 2014 22:07:44 -0000 Adam Thompson writes: > In addition I think we need to change the establish_property_* functions to take > JS::Handle and js::MutableHandle arguments. Yes, I think so, but this is going to cause problems, since other functions in html.c call establish_property_*, and those don't know about C++ types. But you're on to something... The rooting guide [1] says that we should basically never use raw pointers. Why? Because Spidermonkey doesn't know about them, and it will happily invalidate them during a garbage collection. But we're using them a lot. Here's a stretch of code that could crash the program. It starts at line 544 of html.c and ends at line 564. e is a raw pointer to something in the JS heap, and each one of those establish_property_* calls could move it. So I think it might be time to make html.c compilable with g++ and move over to the appropriate SpiderMonkey types. I'm willing to do this work if you need a break. -- Chris