dkogan / ltrace

GNU General Public License v2.0
47 stars 17 forks source link

Incorrect tests in dwarf.exp #6

Open greno4ka opened 6 years ago

greno4ka commented 6 years ago

# I found several incorrect tests in dwarf.exp!

When I make check on i586, I have next results:

libdwarftest.so->treetest({ 2, nil, nil })       = { 3, nil, nil }
libdwarftest.so->treetest({ 3, nil, { 4, nil, nil } } <unfinished ...>
libdwarftest.so->treetest({ 4, nil, nil })       = { 5, nil, nil }
<... treetest resumed> )                         = { 4, nil, { 5, nil, nil } }
<... treetest resumed> )                         = { 2, { 3, nil, nil }, { 4, nil, { 5, nil, nil } } }

It seems that they are right, but they fail tests

On x86_64 the picture is following:

libdwarftest.so->treetest({ 2, nil, nil })       = nil
libdwarftest.so->treetest({ 3, nil, { 4, nil, nil } } <unfinished ...>
libdwarftest.so->treetest({ 4, nil, nil })       = nil
<... treetest resumed> )                         = { 5, nil, nil }
<... treetest resumed> )                         = { 2, { 3, nil, nil }, { 4, nil, { 5, nil, nil } } }

The tests are passed, but I think values are wrong. Probably solution is to add some actions with tree in treetest function, such as this.

struct tree treetest(struct tree* t)
{
    if(t->left  != NULL) printf("%d",treetest(t->left).x);
    if(t->right != NULL) printf("%d",treetest(t->right).x);
    t->x++;
    return *t;
}

With such addition, the results on x86_64 the same as on i586. I propose, that gcc optimizes this function. Even with -O0.

Please, can you verify your tests?

greno4ka commented 6 years ago

Here list of all errors:

FAIL: libdwarftest.so->treetest({ 2, nil, nil }) * = nil in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: libdwarftest.so->treetest({ 4, nil, nil }) * = nil in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: <... treetest resumed> ) * = { 5, nil, nil } in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: linkedlisttest@libdwarftest.so({ 5, nil }) * = <void> in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: treetest@libdwarftest.so({ 2, nil, nil }) * = nil in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: treetest@libdwarftest.so({ 4, nil, nil }) * = nil in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: looptest@libdwarftest.so({ { recurse^, 6 }, 5 }) * = <void> in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: enumtest@libdwarftest.so(A, B) * = 0 in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: arraytest@libdwarftest.so(.* 1.000000, 2.000000, 1.000000, 2.000000, 1.000000 [^\.*]* * = 1.000000 in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: _Z3f127Colors2@libdwarftest.so(GREEN2) * = RED1 in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: _Z3f347Colors4@libdwarftest.so(BLUE4) * = RED3 in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: _Z3f557Colors5@libdwarftest.so(RED5) * = RED5 in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: stringtest@libdwarftest.so('t') * = 4 in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: stringtest@libdwarftest.so(nil) * = -1 in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: FILEtest@libdwarftest.so(0x[0-9a-z]*, 0x[0-9a-z]*) * = <void> in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: voidfunc@libdwarftest.so() * = <void> in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: libdwarftest.so->treetest({ 2, nil, nil }) * = nil in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: libdwarftest.so->treetest({ 4, nil, nil }) * = nil in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: <... treetest resumed> ) * = { 5, nil, nil } in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: dwarf->usleep(33) * = 0 in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: usleep@libc.so.6(33 <unfinished ...> in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: ftell@libc.so.6(0x[0-9a-z]*) * = -1 in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
FAIL: ftell@libc.so.6(0x[0-9a-z]*) * = -1 in /usr/src/RPM/BUILD/ltrace-0.7.91.0.198.git82c6640/testsuite/ltrace.main/dwarf.ltrace for 0 times, should be 1
dkogan commented 6 years ago

Thanks for the report. Just so you know, this isn't the primary ltrace repo, but I'll get it to the right place. Also, keep in mind that this project is a bit dormant right now, so don't expect a lot of activity. I want to make a release of what we have now, and if you have fixes, those should make it in.