Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #15377

Re: Buffer access with bounds checking...

From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.forth
Subject Re: Buffer access with bounds checking...
References (1 earlier) <5040ff49$0$281$14726298@news.sunsite.dk> <7x8vcu246o.fsf@ruckus.brouhaha.com> <5041308f$0$285$14726298@news.sunsite.dk> <7xr4qmg1fm.fsf@ruckus.brouhaha.com> <c581eecc-6999-4dd3-a1cb-77f5eded845f@v22g2000vbu.googlegroups.com>
Date 2012-09-01 14:06 -0700
Message-ID <7xd325qwpx.fsf@ruckus.brouhaha.com> (permalink)
Organization Nightsong/Fort GNOX

Show all headers | View raw


Mark Wills <forthfreak@gmail.com> writes:
> The test guys said that buffer overflows should be
> trapped, logged, and the system halt. I said "Please prove it is
> possible to overrun the serial input and output buffers". 

But that's backwards.  They shouldn't have to prove something is
possible.  If you're asserting the checks should be removed, you are the
one who has to prove overruns are impossible.

> I also argued that a halt was useless - from the users perspective
> (who would be some 1800 meters above the embedded device, in the
> warmth and dryness of a nice drilling rig) a halt was a crash.

If there is a buffer overrun, the result might be much worse than a mere
crash (where the thing stops operating).  It gadget might keep operating
while doing something completely crazy, setting itself on fire,
whatever.

> Best you can is re-start the thing.

Yes.  That sounds better than letting the program keep running into the
weeds.  It's no longer under the programmer's control, so it's better to
shut it off.

> I mean, okay, you've detected a run-time fault, for example
> dereferencing null memory.

If the fault didn't show up during testing, chances are it was caused by
some weird, non-deterministic condition unlikely to repeat.  So log the
error, restart the program, and analyze the log later.

Erlang is written around this idea, that software failures are
inevitable, so there are extensive provisions for recovering from them.
Programs are organized into isolated processes and there is a
supervision tree that restarts crashed ones.

> That's what we do in the subsea industry - we fail over to the
> redundant device - but the devices tend to be identical. Though we're
> mostly in the non SIL or SIL-1 territory.

Yeah, I gather that ultra-critical stuff has backups using completely
different hardware and software developed by separate teams.

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Buffer access with bounds checking... Mark Wills <markrobertwills@yahoo.co.uk> - 2012-08-31 06:51 -0700
  Re: Buffer access with bounds checking... Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-08-31 11:04 -0500
  Re: Buffer access with bounds checking... Alex McDonald <blog@rivadpm.com> - 2012-08-31 09:20 -0700
    Re: Buffer access with bounds checking... Mark Wills <markrobertwills@yahoo.co.uk> - 2012-08-31 12:57 -0700
      Re: Buffer access with bounds checking... "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-08-31 18:46 -0400
        Re: Buffer access with bounds checking... Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-09-01 04:05 -0500
          Re: Buffer access with bounds checking... "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-01 13:45 -0400
            Re: Buffer access with bounds checking... Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-09-02 04:19 -0500
              Re: Buffer access with bounds checking... "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-09-02 16:15 -0400
                Re: Buffer access with bounds checking... Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-09-04 12:02 -0500
  Re: Buffer access with bounds checking... Doug Hoffman <glidedog@gmail.com> - 2012-08-31 14:15 -0400
    Re: Buffer access with bounds checking... Mark Wills <markrobertwills@yahoo.co.uk> - 2012-08-31 12:56 -0700
    Re: Buffer access with bounds checking... Paul Rubin <no.email@nospam.invalid> - 2012-08-31 13:32 -0700
      Re: Buffer access with bounds checking... Doug Hoffman <glidedog@gmail.com> - 2012-08-31 17:45 -0400
        Re: Buffer access with bounds checking... Paul Rubin <no.email@nospam.invalid> - 2012-08-31 15:07 -0700
          Re: Buffer access with bounds checking... Mark Wills <forthfreak@gmail.com> - 2012-09-01 00:49 -0700
            Re: Buffer access with bounds checking... Paul Rubin <no.email@nospam.invalid> - 2012-09-01 14:06 -0700
              Re: Buffer access with bounds checking... Andrew Haley <andrew29@littlepinkcloud.invalid> - 2012-09-02 04:21 -0500
              Re: Buffer access with bounds checking... anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2012-09-02 10:27 +0000
          Re: Buffer access with bounds checking... Doug Hoffman <glidedog@gmail.com> - 2012-09-01 06:59 -0400
  Re: Buffer access with bounds checking... humptydumpty <ouatubi@gmail.com> - 2012-08-31 14:21 -0700
  Re: Buffer access with bounds checking... "Rod Pemberton" <do_not_have@notemailnot.cmm> - 2012-08-31 18:48 -0400
  Re: Buffer access with bounds checking... Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-01 01:41 +0200
    Re: Buffer access with bounds checking... Bernd Paysan <bernd.paysan@gmx.de> - 2012-09-01 02:37 +0200
    Re: Buffer access with bounds checking... mhx@iae.nl (Marcel Hendrix) - 2012-09-01 11:11 +0200

csiph-web