pmem / pmdk

Persistent Memory Development Kit
https://pmem.io
Other
1.34k stars 510 forks source link

pmem2_map_prot/TEST7: failed (short/release/memcheck) #5599

Open szadam opened 1 year ago

szadam commented 1 year ago

ISSUE:

Environment Information

Please provide a reproduction of the bug:

[pmdk_thread_1] Last 30 lines of /home/jenkins-slave/workspace/PMDK-unittests-linux-py/pmdk_1/src/test/pmem2_map_prot/memcheck7.log below (whole file has 30036 lines):
[pmdk_thread_1] ==41698==    by 0x404AA4: TEST_CASE_PROCESS (unittest.h:700)
[pmdk_thread_1] ==41698==    by 0x405F36: main (pmem2_map_prot.c:571)
[pmdk_thread_1] ==41698== 
[pmdk_thread_1] ==41698== 
[pmdk_thread_1] ==41698== More than 1000 different errors detected.  I'm not reporting any more.
[pmdk_thread_1] ==41698== Final error counts will be inaccurate.  Go fix your program!
[pmdk_thread_1] ==41698== Rerun with --error-limit=no to disable this cutoff.  Note
[pmdk_thread_1] ==41698== that errors may occur in your program without prior warning from
[pmdk_thread_1] ==41698== Valgrind, because errors are no longer being displayed.
[pmdk_thread_1] ==41698== 
[pmdk_thread_1] vex amd64->IR: unhandled instruction bytes: 0xA7 0x8 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
[pmdk_thread_1] vex amd64->IR:   REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
[pmdk_thread_1] vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=NONE
[pmdk_thread_1] vex amd64->IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
[pmdk_thread_1] ==41698== 
[pmdk_thread_1] ==41698== HEAP SUMMARY:
[pmdk_thread_1] ==41698==     in use at exit: 3,261 bytes in 40 blocks
[pmdk_thread_1] ==41698==   total heap usage: 6,656 allocs, 6,616 frees, 12,664,579 bytes allocated
[pmdk_thread_1] ==41698== 
[pmdk_thread_1] ==41698== LEAK SUMMARY:
[pmdk_thread_1] ==41698==    definitely lost: 0 bytes in 0 blocks
[pmdk_thread_1] ==41698==    indirectly lost: 0 bytes in 0 blocks
[pmdk_thread_1] ==41698==      possibly lost: 0 bytes in 0 blocks
[pmdk_thread_1] ==41698==    still reachable: 3,149 bytes in 38 blocks
[pmdk_thread_1] ==41698==         suppressed: 112 bytes in 2 blocks
[pmdk_thread_1] ==41698== Reachable blocks (those to which a pointer was found) are not shown.
[pmdk_thread_1] ==41698== To see them, rerun with: --leak-check=full --show-leak-kinds=all
[pmdk_thread_1] ==41698== 
[pmdk_thread_1] ==41698== For lists of detected and suppressed errors, rerun with: -s
[pmdk_thread_1] ==41698== ERROR SUMMARY: 1982 errors from 1000 contexts (suppressed: 0 from 0)

How often bug is revealed: (always, often, rare):

always

Actual behavior:

Tests failed.

Expected behavior:

Tests should pass

grom72 commented 1 year ago

Disable under Valgrind

janekmi commented 1 year ago

This test writes an assembler code into mmap'ed memory in order to test executing it. It might confuse Valgrind and be unportable between architectures (?). It probably should not be run under Valgrind.

janekmi commented 1 year ago

The latest manual execution does not show the exact issue as it was reported initially.

Source code: 1.13.0-115-g9e8754752 Comment out the code disabling the test here. Command line: ./RUNTESTS.py pmem2_map_prot -u 7 --force-enable memcheck -o 1d

pmem2_map_prot_TES7_memcheck7.log

It might be due to a premature exit. The log is still not clean though.

==43049== Jump to the invalid address stated on the next line
==43049==    at 0x8200000: ???
==43049==    by 0x4046A3: TEST_CASE_PROCESS (unittest.h:700)
==43049==    by 0x405B35: main (pmem2_map_prot.c:571)
==43049==  Address 0x8200000 is 552,128 bytes inside an unallocated block of size 3,087,520 in arena "client"
==43049== 
grom72 commented 1 year ago

Let's check and fix it within 1.14