Valgrind macOs and error Syscall param msg->desc.port.name points to uninitialised byte(s)

前端 未结 2 1513
傲寒
傲寒 2021-02-20 00:09

I tried to run valgrind 3.13 and 3.14 (on macOs 10.12.6) in very simple project but I got strange error who I never got in my linux before.

  1. Very simple C progra

2条回答
  •  长情又很酷
    2021-02-20 00:59

    I just checked the bug status here and it appears solved, so I just checked out the corresponding commit and compile. It solves the issue of the uninitialised byte(s) but seams to create new problems: unhandled MACH_SEND_TRAILER ?

    1) clone master branch

    $ git clone git://sourceware.org/git/valgrind.git
    

    2) patch it with the fix:

    $ cd valgrind
    
    $ git checkout 128fd6e
    

    3) configure compile and install as usual, instructions here

    4) test it with a simple program

    $ cd /bin
    $ ./valgrind ls -l
    
    ==19116== Memcheck, a memory error detector
    ==19116== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
        ==19116== Using Valgrind-3.14.0.GIT and LibVEX; rerun with -h for copyright info
    ==19116== Command: ls -l
    ==19116== 
    --19116-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option
    --19116-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 2 times)
    --19116-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 4 times)
    --19116-- UNKNOWN mach_msg unhandled MACH_SEND_TRAILER option (repeated 8 times)
    total 552
    -rwxr-xr-x  1 user  student  41642 Sep 11 15:55 callgrind_annotate
    -rwxr-xr-x  1 user  student  12020 Sep 11 15:55 callgrind_control
    -rwxr-xr-x  1 user  student  32174 Sep 11 15:55 cg_annotate
    -rwxr-xr-x  1 user  student  10422 Sep 11 15:55 cg_diff
    -rwxr-xr-x  1 user  student  29964 Sep 11 15:55 cg_merge
    -rwxr-xr-x  1 user  student  24402 Sep 11 15:55 ms_print
    -rwxr-xr-x  1 user  student  24468 Sep 11 15:55 valgrind
    -rwxr-xr-x  1 user  student  39048 Sep 11 15:55 valgrind-di-server
    -rwxr-xr-x  1 user  student  15056 Sep 11 15:55 valgrind-listener
    -rwxr-xr-x  1 user  student  40216 Sep 11 15:55 vgdb
    ==19116== 
    ==19116== HEAP SUMMARY:
    ==19116==     in use at exit: 136,779 bytes in 225 blocks
    ==19116==   total heap usage: 420 allocs, 195 frees, 202,112 bytes allocated
    ==19116== 
    ==19116== LEAK SUMMARY:
    ==19116==    definitely lost: 0 bytes in 0 blocks
    ==19116==    indirectly lost: 0 bytes in 0 blocks
    ==19116==      possibly lost: 72 bytes in 3 blocks
    ==19116==    still reachable: 114,861 bytes in 71 blocks
    ==19116==         suppressed: 21,846 bytes in 151 blocks
    ==19116== Rerun with --leak-check=full to see details of leaked memory
    ==19116== 
    ==19116== For counts of detected and suppressed errors, rerun with: -v
    ==19116== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
    

    The same test done on linux ubuntu 16.04, with valgrind 3.11.0 provides a clean output.

提交回复
热议问题