From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) by hurricane.the-brannons.com (Postfix) with ESMTPS id B4F8478426 for ; Fri, 7 Feb 2014 00:26:55 -0800 (PST) Received: by mail-wi0-f181.google.com with SMTP id hi5so585228wib.2 for ; Fri, 07 Feb 2014 00:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=/OTW0FY2OGL7PrGP3hon39BG/9sGJfJwKC/lAh0mvMc=; b=Qtmj7dGmDM4Mi1Yaj+6hE4BMjHD6esGmC5UBsb2Wp9UClRhXhiDXvBgBYh+i0rUezE 4GRSTfKw3zx/caxNCn61EpBVNtp6G4v4tBZPYH1L/bP4FEoVTCA9z69SqGzuObt9SXNA gyjWpG+PFkSO9B4ez6qojVMhb6J7Vql3rQRe9vQ78dKElhNH8EYMmlxH/SDmq/lAxI+K 8oNadvj+NPwXvOY0f/KY/peSYAHNyf/8Ofp9Ac1EK93RElAkBfi+JnuIugdGMJmgAUAN QeClbwdGnG+6pDDta88mkN9SdfY4olwnO3VjLoGshp5g87kT9ZP3cgNOoRFAfe6neDuG cogA== X-Received: by 10.194.236.9 with SMTP id uq9mr9374571wjc.31.1391761580323; Fri, 07 Feb 2014 00:26:20 -0800 (PST) Received: from toaster.adamthompson.me.uk (toaster.adamthompson.me.uk. [2001:8b0:1142:9042::2]) by mx.google.com with ESMTPSA id z1sm8774917wjq.19.2014.02.07.00.26.19 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 07 Feb 2014 00:26:19 -0800 (PST) Date: Fri, 7 Feb 2014 08:26:17 +0000 From: Adam Thompson To: Karl Dahlke Message-ID: <20140207082617.GD3978@toaster.adamthompson.me.uk> References: <20140107013051.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140107013051.eklhad@comcast.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Edbrowse-dev@lists.the-brannons.com Subject: Re: [Edbrowse-dev] suggest increasing the size argument to JS_NewRuntime 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, 07 Feb 2014 08:26:56 -0000 On Fri, Feb 07, 2014 at 01:30:51AM -0500, Karl Dahlke wrote: > > From what I can tell, the remaining segfaults all seem to be caused by > > out-of-memory errors in JS. > > Really? > JS is so bad that when it exhausts its memory pool it segfaults? > That doesn't give me a warm fuzzy feeling. > > Or maybe js returns 0, like any malloc failure, > and I don't watch for that and then I segfault. > If that is the case then we need to write lots more error legs, > which is really tedious programming. This is probably the case. > Sure, push the run time memory up to 32 or 64 meg. Why not? > Probably can't buy a computer these days with under 4 gig, > or even a smart phone. > But that doesn't explain why Chris simple program segfaults on debian js. No it doesn't, I've got a feeling that's a broken debian package. I'm going to look at this more over the weekend. > > As an aside, with debug level 2 or greater, > > edbrowse will print "out of memory" before it crashes. > > Not sure what this means. > My wrappers around malloc do indeed print and exit upon malloc failure, > which probably saves me about 3,000 lines of error leg programming, > but you don't need debug levels, it just happens. > However ... on a 64 bit machine with lots of memory, > integers could overflow before we are out of ram. > Even though it's a signed int, malloc prototype is size_t, which is unsigned, > so we're really good all the way up to unsigned in, however, > beyond that we are allocating a really small number, > instead of 4 gig, and then we tromp over unallocated memory, and that's bad. Yeah, that's certainly unfortunate. > Remember that edbrowse was originally written when the best computer > on the market had 64 meg. > So I need to revamp all these strings and allocated arrays, and use size_t, > and then for the 32 bit machines, make sure there is no size_t overflow. May as well do this for all machines, or just not bother. On 32 bit machines, can you really get enough ram to exhaust 32 bit size_t? > A file with half a billion lines, times sizeof(struct lineMap), > goes over the limit. > Plenty to think about here, but perhaps more important is > putting in more dom objects and functions to support more websites. > But we should probably remain focused on js 24 and the next release. I think keep the focus on js 24 for the minute, with a focus on the size_t change after the release. At the end of the day if the back end is stable then adding dom objects etc is much easier. Also, as long as the api remains somewhat the same (with int switched for size_t) people can be working on both things at once. > Thank you so much for all your help and hard work. Thanks for providing such a useful program. Cheers, Adam.