Bug 2965

Summary: x86-64 FAILs testGetLine(lib.dw.tests.TestDwfl)junit.framework.AssertionFailedError: expected:<51> but was:<52>
Product: frysk Reporter: Mark Wielaard <mark>
Component: generalAssignee: Andrew Cagney <cagney>
Status: RESOLVED FIXED    
Severity: normal CC: qiyaoltc, timoore
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Project(s) to access: ssh public key:
Bug Depends on:    
Bug Blocks: 2127    

Description Mark Wielaard 2006-07-27 13:06:33 UTC
$ ./TestRunner lib.dw.tests.TestDwfl
Running testGetLine(lib.dw.tests.TestDwfl) ...FAIL
  junit.framework.AssertionFailedError: expected:<51> but was:<52>
Running testGetDie(lib.dw.tests.TestDwfl) ...PASS

Time: 0.003
There was 1 failure:
1) testGetLine(lib.dw.tests.TestDwfl)junit.framework.AssertionFailedError:
expected:<51> but was:<52>
   at lib.dw.tests.TestDwfl.testGetLine(TestRunner)
   at frysk.junit.Runner.<init>(TestRunner)
   at TestRunner.main(TestRunner)

FAILURES!!!
Tests run: 2,  Failures: 1,  Errors: 0

This seems to be an off by one error on x86-64
Comment 1 Adam Jocksch 2006-07-31 19:09:09 UTC
This has now been fixed:

2006-07-31  Adam Jocksch  <ajocksch@redhat.com>

	* tests/TestDwfl.java (testGetLine): Fixed, test now works on x86_64.
Comment 2 Tim Moore 2006-08-11 08:01:05 UTC
On x8664:
1) testGetLine(lib.dw.tests.TestDwfl)junit.framework.AssertionFailedError:
expected:<55> but was:<51>
   at lib.dw.tests.TestDwfl.testGetLine(TestRunner)
   at frysk.junit.Runner.<init>(TestRunner)
   at TestRunner.main(TestRunner)

Perhaps the line number encoded in the Dwarf depends on the exact version of the
system's gcc?
Comment 3 Yao Qi 2006-08-24 07:28:34 UTC
(In reply to comment #2)
> On x8664:
> 1) testGetLine(lib.dw.tests.TestDwfl)junit.framework.AssertionFailedError:
> expected:<55> but was:<51>
>    at lib.dw.tests.TestDwfl.testGetLine(TestRunner)
>    at frysk.junit.Runner.<init>(TestRunner)
>    at TestRunner.main(TestRunner)
> 
> Perhaps the line number encoded in the Dwarf depends on the exact version of the
> system's gcc?

Hi, Tim,
I removed "if (brokenXXX(2965))" to let testGetLine run.
This case could pass on our X86-64 box with 2.6.15-1.2054_FC5.

[qiyao@YZ_X86_64 ~/build-frysk/frysk-imports]$ ./TestRunner lib.dw.tests.TestDwfl
Running testGetLine(lib.dw.tests.TestDwfl) ...PASS
Running testGetDie(lib.dw.tests.TestDwfl) ...PASS

Time: 0.002

OK (2 tests)

[qiyao@YZ_X86_64 ~/build-frysk/frysk-imports]$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)
Comment 4 Mark Wielaard 2006-08-24 08:15:58 UTC
Also passes for me with current CVS and brokenXXX() removed on:
$ uname -a
Linux dijkstra.wildebeest.org 2.6.17-1.2174_FC5 #1 SMP Tue Aug 8 15:30:44 EDT
2006 x86_64 x86_64 x86_64 GNU/Linux
$ gcc --version
gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)
Comment 5 Mark Wielaard 2006-09-12 11:57:18 UTC
Tim, are you still seeing this?
Comment 6 Yao Qi 2006-09-19 03:53:40 UTC
Hi, Tim,
I enabled this test case except on X86_64,

2006-09-19  Yao Qi  <qiyaoltc@cn.ibm.com>

        * TestCase.java (brokenX8664XXX): New method.

2006-09-19  Yao Qi  <qiyaoltc@cn.ibm.com>

        * tests/TestDwfl.java (testGetLine): Skip it when build on X86_64.
        Change the line number result for powerpc64.

If this problem  does not exist on your box, please remove brokenX8664XXX in
TestDwfl.java to make this case run on all the platforms, and close this bug.

Thanks!
Comment 7 Mark Wielaard 2006-09-19 12:08:39 UTC
Should now work similar on all architectures:

2006-09-19  Mark Wielaard  <mark@klomp.org>

        * tests/cni/TestLib.cxx (getFuncAddr): Extract define out of
        function and put whole definition on one line.
        * tests/TestDwfl.java (testGetLine): Use same line number for all
        architectures.