From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) From: arisawa In-Reply-To: <4c37cf728d5b0e7ae4ebd3c2e0c2cee4@brasstown.quanstro.net> Date: Tue, 27 Jan 2015 09:33:05 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: References: <0F748B67-FB11-464C-84FA-66B4E0B29918@9.offblast.org> <44900c0d4896622fa8a9411b05efe730@brasstown.quanstro.net> <7A132462-4747-471A-A4BF-D9381E38A4EA@ar.aichi-u.ac.jp> <4c37cf728d5b0e7ae4ebd3c2e0c2cee4@brasstown.quanstro.net> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] protection against resource exhaustion Topicbox-Message-UUID: 3b931f12-ead9-11e9-9d60-3106f5b1d025 Hello, many of resource exhaustion come from careless programming. I would like such processes to be killed immediately. throwing up to broken state might be better. I prefer an option to plan9.ini that enable resrcwait(), because the = call breaks traditional programming style and probably we need more time to have=20 right solution. > 2015/01/26 23:13=E3=80=81erik quanstrom = =E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=EF=BC=9A >=20 > 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. >=20 > exactly. >=20 > 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 = have > a reasonable strategy for deailing with no procs. this is hard to get = right. > just reboot. i have never been able to recover a system that hit = noprocs. > i ended up wasting people's time trying. >=20 > - erik >=20 > ps. how may lines like this have you seen. >=20 > p =3D malloc(n); > if(p =3D=3D nil){ > ... > } >=20 > is this really useful in most tools? >=20