Bug 3259 - TestStackBacktrace gives incorrect result for innermost frame
Summary: TestStackBacktrace gives incorrect result for innermost frame
Status: ASSIGNED
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
: 3814 (view as bug list)
Depends on:
Blocks: 1633 2935 2936 3076 3346
  Show dependency treegraph
 
Reported: 2006-09-25 20:04 UTC by Mike Cvet
Modified: 2007-12-11 23:57 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Patch that works around the bug in GCC (563 bytes, patch)
2006-10-06 07:02 UTC, Alexandre Oliva
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Cvet 2006-09-25 20:04:48 UTC
On FC5 gcc (GCC) 4.1.1 20060525:
 testBacktrace(frysk.rt.tests.TestStackBacktrace)junit.framework.AssertionFailedError:
 expected:<62> but was:<61>
    at frysk.rt.tests.TestStackBacktrace.testBacktrace(TestRunner)
    at frysk.junit.Runner.<init>(TestRunner)
    at TestRunner.main(TestRunner)

This should not happen since the fix for the innermost frame is already in.
Comment 1 Alexandre Oliva 2006-10-06 07:02:05 UTC
Created attachment 1352 [details]
Patch that works around the bug in GCC

GCC over-optimizes the empty loop, such that it ends up without line number
notes, which is why debug info only mentions the previous line.  Adding
something that GCC does not understand (an empty asm) will still generate the
same code, but the debug info won't be optimized away.

I'll look into improving GCC so as to not over-optimize debug info in this
case, but it looks hard and it's sort-of pointless.
Comment 2 Alexandre Oliva 2006-10-11 07:51:23 UTC
Discussion about the GCC problem started at
http://gcc.gnu.org/ml/gcc/2006-10/msg00199.html
Comment 3 Tim Moore 2006-10-31 21:28:34 UTC
The bug appears also in the frysk test program funit-rt-threader.c. The while
loop at line 71 is sometimes reported as being at line 71 or at line 72.
Comment 4 Mike Cvet 2006-12-27 18:21:11 UTC
*** Bug 3814 has been marked as a duplicate of this bug. ***
Comment 5 Mike Cvet 2006-12-27 18:21:47 UTC
ping?
Comment 6 Mark Wielaard 2007-10-10 11:49:44 UTC
Confirmed still a problem with: gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-31)

$ frysk-core/frysk/pkglibdir/funit-rt-looper 0 0 &
$ frysk-core/frysk/bindir/fstack -a $!

Task #28422
#0 0x0804864e in baz()
/home/mark/src/frysk-obj/frysk-core/../../frysk/frysk-core/frysk/pkglibdir/funit-rt-looper.c#61
[...] # Line number should be 62, not 61.