Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751258AbbEFK5N (ORCPT ); Wed, 6 May 2015 06:57:13 -0400 Received: from ares41.inai.de ([46.4.122.207]:60661 "EHLO ares41.inai.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750783AbbEFK5L (ORCPT ); Wed, 6 May 2015 06:57:11 -0400 Date: Wed, 6 May 2015 12:57:08 +0200 (CEST) From: Jan Engelhardt To: "long.wanglong" cc: torvalds@linux-foundation.org, jay.foad@gmail.com, cwhuang@android-x86.org, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, riel@redhat.com, sasha.levin@oracle.com, Michal Hocko , dave@stgolabs.net, koct9i@gmail.com, luto@amacapital.net, pfeiner@google.com, dh.herrmann@gmail.com, vishnu.ps@samsung.com, linux-mm@kvack.org, "linux-kernel@vger.kernel.org" , Wang Kai , peifeiyue , linux-arch@vger.kernel.org Subject: Re: [RFC] kernel random segmentation fault? In-Reply-To: <55498EB0.3080904@huawei.com> Message-ID: References: <1430882810-225406-1-git-send-email-long.wanglong@huawei.com> <55498EB0.3080904@huawei.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 673 Lines: 21 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/