edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] suggest increasing the size argument to JS_NewRuntime
Date: Fri, 07 Feb 2014 01:30:51 -0500	[thread overview]
Message-ID: <20140107013051.eklhad@comcast.net> (raw)

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

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.

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

Thank you so much for all your help and hard work.

Karl Dahlke

             reply	other threads:[~2014-02-07  6:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07  6:30 Karl Dahlke [this message]
2014-02-07  8:26 ` Adam Thompson
2014-02-07 13:13 ` Chris Brannon
2014-02-07 14:26   ` Adam Thompson
  -- strict thread matches above, loose matches on Subject: below --
2014-02-07  0:27 Chris Brannon
2014-02-07  8:13 ` Adam Thompson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140107013051.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).