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


Groups > comp.lang.c > #99590

Re: Why is this outputting alternate blank lines?

From Joe Pfeiffer <pfeiffer@cs.nmsu.edu>
Newsgroups comp.lang.c
Subject Re: Why is this outputting alternate blank lines?
Date 2016-12-15 17:43 -0700
Organization A noiseless patient Spider
Message-ID <1bbmwcu2jj.fsf@pfeifferfamily.net> (permalink)
References (7 earlier) <o2skdb$cfs$1@dont-email.me> <1btwa6t4ij.fsf@pfeifferfamily.net> <o2soqd$och$1@dont-email.me> <1bfulpuage.fsf@pfeifferfamily.net> <o2tkjb$ln3$1@dont-email.me>

Show all headers | View raw


Richard Heathfield <rjh@cpax.org.uk> writes:

> On 15/12/16 03:40, Joe Pfeiffer wrote:
>>
>> You have to have expectations.  If 99+% of the systems you're running on
>> have overcommit, it's not a bad assumption.
>
> Yes it is! It's always a bad assumption! It's an assumption that leads
> to sloppy memory management. And I do realise I'm railing against the
> inevitable, and while we're at it let's bring back the birch and get
> the hell out of Europe and put Churchill back in No 10, and several
> other unattainable ideals which I only mention because, after years
> and years of persistent campaigning, one of them turned out not to be
> so unattainable after all. If someone has got into the terrible habit
> of being lazy about memory management, it may well be too late to
> change his or her ways. But let us at least set a good example and
> write code that uses memory properly.

It needn't lead to poor memory management practices -- but it certainly
influences a reasonable response to malloc() failing.

>> The only other real
>> possibility is to have some sort of developer-accessible way to check
>> the memory pool to decide whether you really need to crash, or if you
>> can continue.  If that exists, I'm not aware of it.
>
> "Need to crash"? Thank heaven you're not an airline pilot.
>
> It's a good analogy, actually. (And an illustration, not a proof.)
>
> When things start to go wrong in the air, a good airline pilot
> continually monitors the state of his or her aircraft, warns his or
> her passengers that they may need to fasten their seatbelts, attempts
> at all times to maintain control of the plane, and --- if it turns out
> that there is no way he or she is going to keep it in the air for much
> longer --- try to find a nearby airfield on which to attempt a runway
> landing or, failing that, a road or a bit of flat grass or, in extreme
> cases, the Hudson River. The point is, he or she doesn't just let go
> of the controls and wait for the aircraft to spiral down to the ground
> and be destroyed in a ball of flame that kills everyone on board.
>
> "Need to crash" shows a misunderstanding, and admittedly it is a
> /widespread/ misunderstanding, of what computer programming is
> actually /for/.

A vivid analogy, but not an especially apt one.  I suppose you can hope
your data structures are in good enough shape to try to dump them to a
checkpoint file, but in my experience that's not likely to get very far
before segfault.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Why is this outputting alternate blank lines? DFS <nospam@dfs.com> - 2016-12-13 23:18 -0500
  Re: Why is this outputting alternate blank lines? Melzzzzz <mel@zzzzz.com> - 2016-12-14 05:30 +0100
  Re: Why is this outputting alternate blank lines? mark.bluemel@gmail.com - 2016-12-14 00:59 -0800
  Re: Why is this outputting alternate blank lines? Richard Heathfield <rjh@cpax.org.uk> - 2016-12-14 10:38 +0000
    Re: Why is this outputting alternate blank lines? DFS <nospam@dfs.com> - 2016-12-14 12:53 -0500
      Re: Why is this outputting alternate blank lines? Richard Heathfield <rjh@cpax.org.uk> - 2016-12-14 18:05 +0000
        Re: Why is this outputting alternate blank lines? Keith Thompson <kst-u@mib.org> - 2016-12-14 11:57 -0800
          Re: Why is this outputting alternate blank lines? Richard Heathfield <rjh@cpax.org.uk> - 2016-12-14 20:05 +0000
            Re: Why is this outputting alternate blank lines? "James R. Kuyper" <jameskuyper@verizon.net> - 2016-12-14 15:21 -0500
            Re: Why is this outputting alternate blank lines? Keith Thompson <kst-u@mib.org> - 2016-12-14 12:28 -0800
              Re: Why is this outputting alternate blank lines? supercat@casperkitty.com - 2016-12-14 13:09 -0800
              Re: Why is this outputting alternate blank lines? Jean-Marc Bourguet <jm@bourguet.org> - 2016-12-14 22:53 +0100
                Re: Why is this outputting alternate blank lines? <william@wilbur.25thandClement.com> - 2016-12-14 15:47 -0800
            Re: Why is this outputting alternate blank lines? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-12-14 15:41 -0700
              Re: Why is this outputting alternate blank lines? Richard Heathfield <rjh@cpax.org.uk> - 2016-12-14 23:26 +0000
                Re: Why is this outputting alternate blank lines? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-12-14 17:33 -0700
                Re: Why is this outputting alternate blank lines? Richard Heathfield <rjh@cpax.org.uk> - 2016-12-15 00:42 +0000
                Re: Why is this outputting alternate blank lines? supercat@casperkitty.com - 2016-12-14 17:05 -0800
                Re: Why is this outputting alternate blank lines? Richard Heathfield <rjh@cpax.org.uk> - 2016-12-15 08:21 +0000
                Re: Why is this outputting alternate blank lines? supercat@casperkitty.com - 2016-12-15 09:15 -0800
                Re: Why is this outputting alternate blank lines? Richard Heathfield <rjh@cpax.org.uk> - 2016-12-15 17:50 +0000
                Re: Why is this outputting alternate blank lines? supercat@casperkitty.com - 2016-12-15 12:15 -0800
                Re: Why is this outputting alternate blank lines? Richard Heathfield <rjh@cpax.org.uk> - 2016-12-15 20:37 +0000
                Re: Why is this outputting alternate blank lines? raltbos@xs4all.nl (Richard Bos) - 2016-12-15 20:08 +0000
                Re: Why is this outputting alternate blank lines? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-12-14 20:40 -0700
                Re: Why is this outputting alternate blank lines? Richard Heathfield <rjh@cpax.org.uk> - 2016-12-15 08:36 +0000
                Re: Why is this outputting alternate blank lines? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-12-15 17:43 -0700
                Re: Why is this outputting alternate blank lines? Richard Heathfield <rjh@cpax.org.uk> - 2016-12-16 01:05 +0000
                Re: Why is this outputting alternate blank lines? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2016-12-15 18:34 -0700
                Re: Why is this outputting alternate blank lines? <william@wilbur.25thandClement.com> - 2016-12-15 10:14 -0800
                Re: Why is this outputting alternate blank lines? raltbos@xs4all.nl (Richard Bos) - 2016-12-15 20:15 +0000
            Re: Why is this outputting alternate blank lines? Tim Rentsch <txr@alumni.caltech.edu> - 2016-12-15 01:51 -0800
              Re: Why is this outputting alternate blank lines? asetofsymbols@gmail.com - 2016-12-15 06:09 -0800
                Re: Why is this outputting alternate blank lines? Tim Rentsch <txr@alumni.caltech.edu> - 2016-12-15 17:47 -0800
          Re: Why is this outputting alternate blank lines? Keith Thompson <kst-u@mib.org> - 2016-12-14 12:15 -0800
            Re: Why is this outputting alternate blank lines? <william@wilbur.25thandClement.com> - 2016-12-15 10:24 -0800
          Re: overcommit is the plague Noob <root@127.0.0.1> - 2016-12-17 01:17 +0100
      Re: Why is this outputting alternate blank lines? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-12-14 20:19 +0000
        Re: Why is this outputting alternate blank lines? DFS <nospam@dfs.com> - 2016-12-14 17:44 -0500
          Re: Why is this outputting alternate blank lines? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-12-15 00:21 +0000
            Re: Why is this outputting alternate blank lines? mark.bluemel@gmail.com - 2016-12-15 00:56 -0800
              Re: Why is this outputting alternate blank lines? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-12-15 22:08 +0000
      Re: Why is this outputting alternate blank lines? Geoff <geoff@invalid.invalid> - 2016-12-14 13:39 -0800
      Re: Why is this outputting alternate blank lines? Ike Naar <ike@iceland.freeshell.org> - 2016-12-16 07:12 +0000

csiph-web