From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [RFC Patch 0/2] Improvements to stack traces Date: Thu, 08 Aug 2013 18:23:45 +0100 Message-ID: References: <1375978750-25898-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1375978750-25898-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Xen-devel Cc: Tim Deegan , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 08/08/2013 17:19, "Andrew Cooper" wrote: > This series is RFC for two reasons; firstly because I have not dev-tested it > yet, but mainly because of a specific question. > > In the algorithm using frame pointers, the lower bound is adjusted by two > words from the provided stack pointer. > > This appears to be the behaiour right from its introduction in: > > commit aa24d38a469b59abf1b95b732b6ea9ed86e511cf > Author: kaf24@firebug.cl.cam.ac.uk > Date: Thu Sep 1 15:31:12 2005 +0000 > > What is the reason for the adjustment? Tim and I couldn't think of a case > where a valid frame pointer could be outside the stack. Any well formed use of > frame pointers should require the callee to push the old frame pointer at > entry, and pop it on right before exit. > > Am I missing something obvious? > > The potential problem comes in the stack overflow case, where rsp points to > the boundary of the primary stack, and rbp points just below it, at which > point the bounday condition will pass but referencing rbp will cause a triple > fault. > > This can be detected and worked around, but if the adjustment is erronious > then by far the easiest solution is to just discard the adjustment. I think it was just an attempt at paranoia when I implemented this. I'm happy for it to be ripped out. -- Keir > ~Andrew > > CC: Keir Fraser > CC: Jan Beulich > CC: Tim Deegan > > -- > 1.7.10.4 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel