Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check Delta Valgrind Logs #21

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft

Conversation

sherry-yuan
Copy link
Contributor

No description provided.

@sherry-yuan sherry-yuan self-assigned this Nov 26, 2021
@sherry-yuan sherry-yuan added the enhancement New feature or request label Nov 26, 2021
@sherry-yuan sherry-yuan added this to the 2022.2 milestone Nov 26, 2021
@sherry-yuan
Copy link
Contributor Author

sherry-yuan commented Dec 2, 2021

Caveat: valgrind suppression is too specific, sometimes it filter out memcheck of type Addr2 (invalid read of size 2), but Addr1,4,8 might also happen for the same valgrind error.

Next step: add additional script for duplicating Addr memcheck types so that it won't miss the same valgrind issue.

@pcolberg pcolberg modified the milestones: 2022.2, 2022.3 Dec 7, 2021
@sherry-yuan sherry-yuan modified the milestones: 2022.3, 2022.4 Mar 14, 2022
@sherry-yuan
Copy link
Contributor Author

sherry-yuan commented Mar 14, 2022

This is potentially a no go given the suppression are noisy and the valgrind errors are not consistent across the runs. Push to 2022.4 for now. The better alternative is to fix all current valgrind issues, then apply this CI/CD. Will wait until its dependency are done.

@pcolberg pcolberg assigned pcolberg and unassigned sherry-yuan Apr 30, 2022
@pcolberg pcolberg removed this from the 2023.0 milestone Oct 19, 2022
pcolberg added a commit to pcolberg/fpga-runtime-for-opencl that referenced this pull request Oct 28, 2022
The buffer passed to acl_pkg_add_data_section() is read later in
acl_pkg_close_file() which invokes elf_update() to flush dirty
information associated with the ELF file descriptor to disk,
at which point the buffer has already gone out of scope.

==677==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffdcce29100 at pc 0x7f3e2e3c92b7 bp 0x7ffdcce1fe10 sp 0x7ffdcce1f5c8
READ of size 7 at 0x7ffdcce29100 thread T0
    #0 0x7f3e2e3c92b6 in __interceptor_pwrite ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1175
    intel#1 0x7f3e2e372d53  (/lib/x86_64-linux-gnu/libelf.so.1+0x7d53)
    intel#2 0x7f3e2e37e9db in elf_update (/lib/x86_64-linux-gnu/libelf.so.1+0x139db)
    intel#3 0x55ceab33a474 in flush_elf_edits /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/pkg_editor/src/pkg_editor.c:297
    intel#4 0x55ceab33f46b in acl_pkg_close_file /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/pkg_editor/src/pkg_editor.c:1059
    intel#5 0x55ceab31caa6 in CppUTestGroupsample_file::close_file(acl_pkg_file*) /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/pkg_editor/test/pkg_editor_test.cpp:124
    intel#6 0x55ceab31caa6 in sample_file_update_same_size_Test::testBody() /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/pkg_editor/test/pkg_editor_test.cpp:303
    intel#7 0x55ceab3353a4 in Utest::executePlatformSpecificTestBody() /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/CppUTest/src/UtestPlatformGcc.cpp:82
    intel#8 0x55ceab3317db in Utest::runInThread() /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/CppUTest/src/Utest.cpp:99
    intel#9 0x55ceab324642 in sample_file_update_same_size_Test::runInThreadOnCopy() (/__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/build/lib/pkg_editor/test/pkg_editor_test+0x23642)
    intel#10 0x55ceab335744 in Utest::executePlatformSpecificRunInThreads() /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/CppUTest/src/UtestPlatformGcc.cpp:175
    intel#11 0x55ceab33172c in Utest::run(TestResult&) /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/CppUTest/src/Utest.cpp:83
    intel#12 0x55ceab331635 in Utest::runOneTest(TestPlugin*, TestResult&) /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/CppUTest/src/Utest.cpp:69
    intel#13 0x55ceab3354e2 in Utest::executePlatformSpecificRunOneTest(TestPlugin*, TestResult&) /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/CppUTest/src/UtestPlatformGcc.cpp:100
    intel#14 0x55ceab3315a0 in Utest::runOneTestWithPlugins(TestPlugin*, TestResult&) /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/CppUTest/src/Utest.cpp:63
    intel#15 0x55ceab32f93d in TestRegistry::runAllTests(TestResult&) /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/CppUTest/src/TestRegistry.cpp:72
    intel#16 0x55ceab326222 in CommandLineTestRunner::runAllTests() /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/CppUTest/src/CommandLineTestRunner.cpp:105
    intel#17 0x55ceab3265a8 in CommandLineTestRunner::runAllTestsMain() /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/CppUTest/src/CommandLineTestRunner.cpp:81
    intel#18 0x55ceab326809 in CommandLineTestRunner::RunAllTests(int, char const**) /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/CppUTest/src/CommandLineTestRunner.cpp:63
    intel#19 0x55ceab318364 in main /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/pkg_editor/test/pkg_editor_test.cpp:57
    intel#20 0x7f3e2de1dd8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    intel#21 0x7f3e2de1de3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    intel#22 0x55ceab313264 in _start (/__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/build/lib/pkg_editor/test/pkg_editor_test+0x12264)

Address 0x7ffdcce29100 is located in stack of thread T0 at offset 48 in frame
    #0 0x55ceab31c4bd in sample_file_update_same_size_Test::testBody() /__w/fpga-runtime-for-opencl/fpga-runtime-for-opencl/lib/pkg_editor/test/pkg_editor_test.cpp:280

  This frame has 15 object(s):
    [48, 55) 'name' (line 105) <== Memory access at offset 48 is inside this variable
    [80, 88) 'data_size' (line 309)
    [112, 120) '<unknown>'
    [144, 152) '<unknown>'
    [176, 184) '<unknown>'
    [208, 216) '<unknown>'
    [240, 248) '<unknown>'
    [272, 280) '<unknown>'
    [304, 312) '<unknown>'
    [336, 344) '<unknown>'
    [368, 408) '_f' (line 312)
    [448, 488) '_f' (line 314)
    [528, 568) '_f' (line 330)
    [608, 648) '_f' (line 333)
    [688, 1688) 'buf' (line 305)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-use-after-scope ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:1175 in __interceptor_pwrite
Shadow bytes around the buggy address:
  0x1000399bd1d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000399bd1e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000399bd1f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000399bd200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1000399bd210: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f1 f1
=>0x1000399bd220:[f8]f2 00 00 00 f2 00 00 00 f2 00 00 00 f2 00 00
  0x1000399bd230: 00 f2 00 00 00 f2 00 00 00 f2 00 00 00 f2 00 00
  0x1000399bd240: 00 f2 00 00 00 f2 f2 f2 00 00 00 00 00 f2 f2 f2
  0x1000399bd250: f2 f2 00 00 00 00 00 f2 f2 f2 f2 f2 00 00 00 00
  0x1000399bd260: 00 f2 f2 f2 f2 f2 00 00 00 00 00 f2 f2 f2 f2 f2
  0x1000399bd270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==677==ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants