public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Abort backtrace when consecutive zero PCs?
@ 2004-09-15 17:36 Andrew Cagney
  2004-09-15 18:47 ` Michael Chastain
  2004-09-15 22:13 ` Daniel Jacobowitz
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Cagney @ 2004-09-15 17:36 UTC (permalink / raw)
  To: gdb

Hello,

One backtrace infinite loop case I've noticed (especially on ia64) is 
where successive frames all have a zero PC.

While we definitly need to allow a backtrace through a single zero PC 
(for a NULL pointer call - signull.exp) should we make GDB abort when 
two or more consecutive frames have a zero PC?

(mumble something about a runtime option)

thoughts?
Andrew

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Abort backtrace when consecutive zero PCs?
  2004-09-15 17:36 Abort backtrace when consecutive zero PCs? Andrew Cagney
@ 2004-09-15 18:47 ` Michael Chastain
  2004-09-15 20:13   ` Andrew Cagney
  2004-09-15 22:13 ` Daniel Jacobowitz
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Chastain @ 2004-09-15 18:47 UTC (permalink / raw)
  To: gdb, cagney

Andrew Cagney <cagney@gnu.org> wrote:
> While we definitly need to allow a backtrace through a single zero PC 
> (for a NULL pointer call - signull.exp) should we make GDB abort when 
> two or more consecutive frames have a zero PC?

Perhaps abort it after an identical frame is seen a second time?
It's not the zero-ness that kills us, it's the repetition.

The naive check would take O(n^2/2) time for n stack frames,
but if you use a clever data structure, it would be O(n lg n) time.

Michael

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Abort backtrace when consecutive zero PCs?
  2004-09-15 18:47 ` Michael Chastain
@ 2004-09-15 20:13   ` Andrew Cagney
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Cagney @ 2004-09-15 20:13 UTC (permalink / raw)
  To: Michael Chastain; +Cc: gdb

> Andrew Cagney <cagney@gnu.org> wrote:
> 
>>> While we definitly need to allow a backtrace through a single zero PC 
>>> (for a NULL pointer call - signull.exp) should we make GDB abort when 
>>> two or more consecutive frames have a zero PC?
> 
> 
> Perhaps abort it after an identical frame is seen a second time?
> It's not the zero-ness that kills us, it's the repetition.

For the case I'm looking at, successive frames have a zero PC and a 
monotonic changing stack pointer, so there is no repetition.

Andrew


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Abort backtrace when consecutive zero PCs?
  2004-09-15 17:36 Abort backtrace when consecutive zero PCs? Andrew Cagney
  2004-09-15 18:47 ` Michael Chastain
@ 2004-09-15 22:13 ` Daniel Jacobowitz
  2004-09-15 22:46   ` Andrew Cagney
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2004-09-15 22:13 UTC (permalink / raw)
  To: gdb

On Wed, Sep 15, 2004 at 01:34:21PM -0400, Andrew Cagney wrote:
> Hello,
> 
> One backtrace infinite loop case I've noticed (especially on ia64) is 
> where successive frames all have a zero PC.
> 
> While we definitly need to allow a backtrace through a single zero PC 
> (for a NULL pointer call - signull.exp) should we make GDB abort when 
> two or more consecutive frames have a zero PC?
> 
> (mumble something about a runtime option)
> 
> thoughts?

I still think that you want to reject zero PC followed by a normal
(non-signal/dummy) frame, for exactly this reason...

-- 
Daniel Jacobowitz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Abort backtrace when consecutive zero PCs?
  2004-09-15 22:13 ` Daniel Jacobowitz
@ 2004-09-15 22:46   ` Andrew Cagney
  2004-09-15 23:10     ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2004-09-15 22:46 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

> On Wed, Sep 15, 2004 at 01:34:21PM -0400, Andrew Cagney wrote:
> 
>>> Hello,
>>> 
>>> One backtrace infinite loop case I've noticed (especially on ia64) is 
>>> where successive frames all have a zero PC.
>>> 
>>> While we definitly need to allow a backtrace through a single zero PC 
>>> (for a NULL pointer call - signull.exp) should we make GDB abort when 
>>> two or more consecutive frames have a zero PC?
>>> 
>>> (mumble something about a runtime option)
>>> 
>>> thoughts?
> 
> 
> I still think that you

me or we?  Do you have a pointer to the thread?

 > want to reject zero PC followed by a normal
> (non-signal/dummy) frame, for exactly this reason...

That sounds like a NULL pointer function call, which is what signull.exp 
is all about.

Andrew


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Abort backtrace when consecutive zero PCs?
  2004-09-15 22:46   ` Andrew Cagney
@ 2004-09-15 23:10     ` Daniel Jacobowitz
  2004-09-15 23:35       ` Andrew Cagney
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2004-09-15 23:10 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb

On Wed, Sep 15, 2004 at 06:43:48PM -0400, Andrew Cagney wrote:
> >On Wed, Sep 15, 2004 at 01:34:21PM -0400, Andrew Cagney wrote:
> >
> >>>Hello,
> >>>
> >>>One backtrace infinite loop case I've noticed (especially on ia64) is 
> >>>where successive frames all have a zero PC.
> >>>
> >>>While we definitly need to allow a backtrace through a single zero PC 
> >>>(for a NULL pointer call - signull.exp) should we make GDB abort when 
> >>>two or more consecutive frames have a zero PC?
> >>>
> >>>(mumble something about a runtime option)
> >>>
> >>>thoughts?
> >
> >
> >I still think that you
> 
> me or we?  Do you have a pointer to the thread?

I think that I want it; it was a form of speech indicating it would
address this problem.  I swear it's in the archives but I can't find
the right thing to search for.

> > want to reject zero PC followed by a normal
> >(non-signal/dummy) frame, for exactly this reason...
> 
> That sounds like a NULL pointer function call, which is what signull.exp 
> is all about.

"followed" in the other direction.  If we unwind a normal frame, and
the next outer frame has a PC of zero, stop unwinding.  We briefly had
this check for "if the next frame is not the innermost frame" and that
broke the equivalent of signull.exp; I think I proposed this in follow
discussion to that.

-- 
Daniel Jacobowitz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Abort backtrace when consecutive zero PCs?
  2004-09-15 23:10     ` Daniel Jacobowitz
@ 2004-09-15 23:35       ` Andrew Cagney
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Cagney @ 2004-09-15 23:35 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

>>>want to reject zero PC followed by a normal
>>>> >(non-signal/dummy) frame, for exactly this reason...
>>
>>> 
>>> That sounds like a NULL pointer function call, which is what signull.exp 
>>> is all about.
> 
> 
> "followed" in the other direction.  If we unwind a normal frame, and
> the next outer frame has a PC of zero, stop unwinding.  We briefly had
> this check for "if the next frame is not the innermost frame" and that
> broke the equivalent of signull.exp; I think I proposed this in follow
> discussion to that.

Ah, now that makes sense.

Andrew


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-09-15 23:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-15 17:36 Abort backtrace when consecutive zero PCs? Andrew Cagney
2004-09-15 18:47 ` Michael Chastain
2004-09-15 20:13   ` Andrew Cagney
2004-09-15 22:13 ` Daniel Jacobowitz
2004-09-15 22:46   ` Andrew Cagney
2004-09-15 23:10     ` Daniel Jacobowitz
2004-09-15 23:35       ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).