Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761819AbZCaTCi (ORCPT ); Tue, 31 Mar 2009 15:02:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753500AbZCaTC2 (ORCPT ); Tue, 31 Mar 2009 15:02:28 -0400 Received: from lazybastard.de ([212.112.238.170]:35184 "EHLO longford.logfs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751822AbZCaTC1 (ORCPT ); Tue, 31 Mar 2009 15:02:27 -0400 X-Greylist: delayed 921 seconds by postgrey-1.27 at vger.kernel.org; Tue, 31 Mar 2009 15:02:27 EDT Date: Tue, 31 Mar 2009 21:02:14 +0200 From: =?utf-8?B?SsO2cm4=?= Engel To: Stefani Seibold Cc: Andi Kleen , linux-kernel , linux-mm , Peter Zijlstra , Ingo Molnar Subject: Re: Detailed Stack Information Patch [0/3] Message-ID: <20090331190214.GB25879@logfs.org> References: <1238511498.364.60.camel@matrix> <87eiwdn15a.fsf@basil.nowhere.org> <1238523735.3692.30.camel@matrix> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1238523735.3692.30.camel@matrix> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1378 Lines: 42 On Tue, 31 March 2009 20:22:15 +0200, Stefani Seibold wrote: > Am Dienstag, den 31.03.2009, 17:49 +0200 schrieb Andi Kleen: > > Stefani Seibold writes: > > > > - Misuse the thread stack for big temporary data buffers > > > > That would be better checked for at compile time > > (except for alloca, but that is quite rare) > > Fine but it did not work for functions like: > > void foo(int n) > { > char buf[n*1024]; > > } > > This is valid with gcc. Good call. checkstack should look for those as well. It is certainly possible to detect statically and warn about: 10: 29 c4 sub %eax,%esp Runaway recursions are a different matter, though. The code I once had to detect them depends on an old version of smatch, which in turn depends on gcc 3.1. And even assuming this was in a reasonable shape, I still don't know what to do about it. The kernel has thousands of recursions and trying to work out how deep each one may stack is a never-ending project. Jörn -- A quarrel is quickly settled when deserted by one party; there is no battle unless there be two. -- Seneca -- 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/