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


Groups > comp.lang.c > #142289

OT: crashing malloc [was Re: heap memory indexed as an array]

From nobody@example.org (Scott)
Newsgroups comp.lang.c
Subject OT: crashing malloc [was Re: heap memory indexed as an array]
Date 2019-03-23 15:27 +0000
Organization XMission http://xmission.com/
Message-ID <5c964dc4.429114439@news.xmission.com> (permalink)
References (3 earlier) <5c925e27.171165954@news.xmission.com> <d5ukE.129284$%55.80346@fx40.iad> <5c93be66.261340189@news.xmission.com> <sMPkE.179115$KB3.56762@fx02.iad> <5c945dc4.302138986@news.xmission.com>

Show all headers | View raw


On Fri, 22 Mar 2019 04:29:43 GMT, nobody@example.org (Scott) wrote:
[Following up my own article, 'cause I'm classy that way]

>I previously checked on, IIRC, FreeBSD 8.4-R. I began re-running some
>of my tests today on a fresh install of FreeBSD 12.0-R on an i5 PC
>with 8Gb RAM and no swap. The test program is just a loop to allocate
>a 1Gb block and memset it to a random value, repeatedly, until malloc
>returns null or any signal is caught.
>
>My results today were consistent over several runs. When memory was
>exhausted, the system logged errors and began killing unrelated jobs,
>ending with an uncrashed but unusable system. It was running, had a
>login prompt, but logging in (even as root) just kicked you back to
>the login prompt without comment. Notably, while my program was among
>those killed, it never received a signal, and never got a null return
>from malloc.

Another round of testing, on Linux this time (Ubuntu Server 18.04),
produced similar results. Memory and swap exhausted, malloc never
returned null, and jobs killed with no signal received. But the OS did
not degenerate into a useless state this time. (That's a bit of an ego
blow, I've been a stout BSD weenie for years, but, meh.)

I guess I should test Windows next, and in fairness I should test it
natively instead of through cygwin. Another day though.

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


Thread

heap memory indexed as an array sinbad <sinbad.sinbad@gmail.com> - 2019-03-19 20:05 -0700
  Re: heap memory indexed as an array Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2019-03-19 21:37 -0600
    Re: heap memory indexed as an array Spiros Bousbouras <spibou@gmail.com> - 2019-03-20 04:40 +0000
      Re: heap memory indexed as an array nobody@example.org (Scott) - 2019-03-20 15:56 +0000
        Re: heap memory indexed as an array scott@slp53.sl.home (Scott Lurndal) - 2019-03-20 16:43 +0000
          Re: heap memory indexed as an array fir <profesor.fir@gmail.com> - 2019-03-20 10:00 -0700
          Re: heap memory indexed as an array William Ahern <william@25thandClement.com> - 2019-03-20 15:07 -0700
            Re: heap memory indexed as an array fir is a sexy shemale <cdalten@gmail.com> - 2019-03-20 23:52 -0700
          Re: heap memory indexed as an array nobody@example.org (Scott) - 2019-03-21 16:50 +0000
            Re: heap memory indexed as an array scott@slp53.sl.home (Scott Lurndal) - 2019-03-21 17:23 +0000
              Re: heap memory indexed as an array nobody@example.org (Scott) - 2019-03-22 04:29 +0000
                OT: crashing malloc [was Re: heap memory indexed as an array] nobody@example.org (Scott) - 2019-03-23 15:27 +0000
                Re: heap memory indexed as an array Spiros Bousbouras <spibou@gmail.com> - 2019-03-23 19:24 +0000
                Re: heap memory indexed as an array Melzzzzz <Melzzzzz@zzzzz.com> - 2019-03-23 20:20 +0000
      Re: heap memory indexed as an array Tim Rentsch <tr.17687@z991.linuxsc.com> - 2019-03-21 22:35 -0700
  Re: heap memory indexed as an array Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-03-20 07:05 +0000
  Re: heap memory indexed as an array Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-03-20 12:12 +0000

csiph-web