[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LSU.2.20.1505061255360.8975@nerf40.vanv.qr>
Date: Wed, 6 May 2015 12:57:08 +0200 (CEST)
From: Jan Engelhardt <jengelh@...i.de>
To: "long.wanglong" <long.wanglong@...wei.com>
cc: torvalds@...ux-foundation.org, jay.foad@...il.com,
cwhuang@...roid-x86.org, akpm@...ux-foundation.org,
kirill.shutemov@...ux.intel.com, riel@...hat.com,
sasha.levin@...cle.com, Michal Hocko <mhocko@...e.cz>,
dave@...olabs.net, koct9i@...il.com, luto@...capital.net,
pfeiner@...gle.com, dh.herrmann@...il.com, vishnu.ps@...sung.com,
linux-mm@...ck.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Wang Kai <morgan.wang@...wei.com>,
peifeiyue <peifeiyue@...wei.com>, linux-arch@...r.kernel.org
Subject: Re: [RFC] kernel random segmentation fault?
On Wednesday 2015-05-06 05:46, long.wanglong wrote:
>
>int main(int argc, char** argv)
>{
> rlim.rlim_cur=20 MB;
> rlim.rlim_max=20 MB;
> ret = setrlimit(RLIMIT_AS, &rlim);
> [...]
> char tmp[20 MB];
> for (i = 0; i < 20 MB; i++)
> tmp[i]=1;
if tmp already takes 20 MB, where will the remainder of the program find
space if you only allow for 20 MB? This is bound to fail under normal
considerations.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists