From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Mon, 26 Jan 2015 06:13:04 -0800 To: 9fans@9fans.net Message-ID: <4c37cf728d5b0e7ae4ebd3c2e0c2cee4@brasstown.quanstro.net> In-Reply-To: <7A132462-4747-471A-A4BF-D9381E38A4EA@ar.aichi-u.ac.jp> References: <0F748B67-FB11-464C-84FA-66B4E0B29918@9.offblast.org> <44900c0d4896622fa8a9411b05efe730@brasstown.quanstro.net> <7A132462-4747-471A-A4BF-D9381E38A4EA@ar.aichi-u.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] protection against resource exhaustion Topicbox-Message-UUID: 3b8270a4-ead9-11e9-9d60-3106f5b1d025 On Mon Jan 26 03:43:36 PST 2015, arisawa@ar.aichi-u.ac.jp wrote: > Hello, >=20 > I have been playing the following program. > I tried on official plan9, 9front, and 9atom. > none of them showed messages that come from: > sysfatal("fork: %r=E2=80=9D); > sysfatal("exec: %r"); > I suspect that > fork() > does not return -1 even if it failed in creating new process. exactly. the reason it never returns -1, is that introduces a new failure case in every program running, and testing seems like a huge pain. just testing for "handles fork returning -1" is not good enough, it has to hav= e a reasonable strategy for deailing with no procs. this is hard to get ri= ght. just reboot. i have never been able to recover a system that hit noprocs= . i ended up wasting people's time trying. - erik ps. how may lines like this have you seen. p =3D malloc(n); if(p =3D=3D nil){ ... } is this really useful in most tools?