edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] Error Legs
@ 2014-02-07 14:01 Karl Dahlke
  2014-02-07 15:05 ` Chris Brannon
  0 siblings, 1 reply; 13+ messages in thread
From: Karl Dahlke @ 2014-02-07 14:01 UTC (permalink / raw)
  To: Edbrowse-dev

Ok, I follow what you're saying.

The expedient approach is to wrapper some of the js calls,
the way I wrapper malloc, to simply exit upon null,
and I think that would be fine for now, provided the runtime pool
is pushed up to 64 meg.
It just wouldn't come up very often.
People download huge files, but that doesn't consume huge javascript space.
Web pages come in a certain size, and usually don't include memory intensive js.

Later versions can, perhaps, be more graceful about these allocation errors,
but I think size_t issues, better dom support,
ajax, plugins (particularly flash), and imap, are all higher priority.
For now, a version that never ever segfaults would be lovely.

Karl Dahlke

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [Edbrowse-dev]  Error Legs
@ 2014-02-07 17:57 Karl Dahlke
  2014-02-07 18:23 ` Chris Brannon
  0 siblings, 1 reply; 13+ messages in thread
From: Karl Dahlke @ 2014-02-07 17:57 UTC (permalink / raw)
  To: Edbrowse-dev

> exit on out-of-memory inside my_ErrorReporter.

Very good.
I pushed a small change to use the symbol and message we already had for this
condition, rather than making a new one.
I try to avoid extra messages, as they have to be translated.
When you do add a message though, append zeros for the other languages,
just so I can keep track of outstanding messages that haven't yet been
translated into this or that.

Yes, as you point out we could exit on

if(stringEqual(message, "out of memory")

I'm thinking maybe not though.
Marching on won't lead to a segfault,
and as Adam notes, another buffer may have a lot of work in it,
so why exit.
It's not worse or better than the other js errors,
like undefined variable.
Of course, if truly out of memory,
the next js get object call will probably fail,
and that one will probably exit.
So maybe

if(stringEqual(message, "out of memory")) {
print some helpful warning about memory and risk of exit
and saving your buffers.
}

Your demo program is simple,
but I would point out that it doesn't fail if you replace {} with 37.
An array with a million elements still fits,
but an array of a million arrays, with all the associated overhead
of all those objects, that doesn't fit.
Hard to imagine a web page making a million arrays.
So it makes me wonder if we ever bump up against this limit
on a real website.
Are we jumping at shadows, or is this really an issue?
If 4 meg isn't enough, 16y probably is.
My gut tells me the segfaults might come from somewhere else.
Then again, you could have many web pages, with many
contexts and pages, in one edbrowse session.
IDK


Karl Dahlke

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [Edbrowse-dev]  Error Legs
@ 2014-02-07 19:37 Karl Dahlke
  2014-02-07 19:55 ` Chris Brannon
  0 siblings, 1 reply; 13+ messages in thread
From: Karl Dahlke @ 2014-02-07 19:37 UTC (permalink / raw)
  To: Edbrowse-dev

youtube example...
It runs fine for me, no memory error.
IDK

Karl Dahlke

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [Edbrowse-dev]  Error Legs
@ 2014-02-07 20:06 Karl Dahlke
  0 siblings, 0 replies; 13+ messages in thread
From: Karl Dahlke @ 2014-02-07 20:06 UTC (permalink / raw)
  To: Edbrowse-dev

> You're still running a 32-bit machine / OS, right? I run 64-bit, so
> maybe the difference is pointer size.

Well if that relatively small difference could push you over the edge,
then likely I would get the memory error if I change my runtime pool
from 4 meg to 2 meg; and I do.
Therefore, real world websites can consume 4 meg js;
and I do remember youtube use to cause a lot of the segfaults.
I suggest we push the size up to 16 meg, or perhaps 32.

Karl Dahlke

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [Edbrowse-dev]  Error Legs
@ 2014-02-09 14:18 Karl Dahlke
  2014-02-09 15:13 ` Adam Thompson
  0 siblings, 1 reply; 13+ messages in thread
From: Karl Dahlke @ 2014-02-09 14:18 UTC (permalink / raw)
  To: Edbrowse-dev

> I'd still prefer it if it just killed the offending context as well

I agree, and I might be the one to work on this -
but that would be one of those major changes that I think we said we would
wait on until our work was stable.
I keep coming back round to the fact that if we can't get this to work
with moz js 24 libraries as distributed, then edbrowse is dead anyways,
except perhaps on our three machines.
If it can't be distributed then I don't know how much time I should spend on it.
I'm not trying to be Debbie Downer, just practical.
We should be doing what we can to get it to function in the debian world.
If that is both in process and/or on hold,
or if one of you is taking that on, then I could work on error legs in parallel,
and would be willing to do that, as it is a systemic change throughout.
I just keep looking up and seeing the sword of damocles overhead.

Karl Dahlke

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [Edbrowse-dev]   Error Legs
@ 2014-02-09 14:48 Karl Dahlke
  2014-02-09 15:21 ` Adam Thompson
  0 siblings, 1 reply; 13+ messages in thread
From: Karl Dahlke @ 2014-02-09 14:48 UTC (permalink / raw)
  To: Edbrowse-dev

It is important not to stop javascript, even the current context,
on a simple error like a syntax error or unreferenced variable.
This happens a lot; some kind of analytics script
that just tracks visitors to the site,
and those tend to be complicated javascript,
so uses a function that I don't have, and stops,
but then the next chunk of code is executed,
and that is the heart of the website, code that we really need to function.
So this is one of those things I should think about for a couple days,
before writing a line of code.

Karl Dahlke

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

end of thread, other threads:[~2014-02-09 15:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-07 14:01 [Edbrowse-dev] Error Legs Karl Dahlke
2014-02-07 15:05 ` Chris Brannon
2014-02-07 17:57 Karl Dahlke
2014-02-07 18:23 ` Chris Brannon
2014-02-09 10:45   ` Adam Thompson
2014-02-09 11:10     ` Adam Thompson
2014-02-07 19:37 Karl Dahlke
2014-02-07 19:55 ` Chris Brannon
2014-02-07 20:06 Karl Dahlke
2014-02-09 14:18 Karl Dahlke
2014-02-09 15:13 ` Adam Thompson
2014-02-09 14:48 Karl Dahlke
2014-02-09 15:21 ` 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).