Bug 488441 - Add the tests for for --track-fds=yes --xml=yes and file descriptor suppression tests
Summary: Add the tests for for --track-fds=yes --xml=yes and file descriptor suppressi...
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-13 10:32 UTC by Alexandra Hajkova
Modified: 2024-06-14 23:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
patch (3.03 KB, patch)
2024-06-13 10:32 UTC, Alexandra Hajkova
Details
patch (38.36 KB, patch)
2024-06-13 10:32 UTC, Alexandra Hajkova
Details
patch (11.72 KB, patch)
2024-06-13 10:32 UTC, Alexandra Hajkova
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandra Hajkova 2024-06-13 10:32:12 UTC
Created attachment 170454 [details]
patch

Improve none/tests/double_close_range test.

Add the tests for --track-fds=yes --xml=yes
    
    - none/tests/double_close_range_xml.vgtest
    - none/tests/fdleak_cmsg_xml.vgtest
    - none/tests/fdleak_creat_xml.vgtest
    - none/tests/fdleak_dup_xml.vgtest
    - none/tests/fdleak_dup2_xml.vgtest
    - none/tests/fdleak_fcntl_xml.vgtest
    - none/tests/fdleak_ipv4_xml.vgtest
    - none/tests/fdleak_open_xml.vgtest
    - none/tests/fdleak_pipe_xml.vgtest
    - none/tests/fdleak_socketpair_xml.vgtest
    - none/tests/file_dclose_xml.vgtest
    - none/tests/socket_close_xml.vgtest
    
    Add a new filter_xml. Note the use of --child-silent-after-fork=yes
    usage in two vgtests. Maybe this should be the default for --xml=yes?
    Otherwise xml output will be "corrupted" by output from a fork.
    
    Also fix a minor xml output issue in VG_(show_open_fds).

Add file descriptor suppression tests
    
    - none/tests/double_close_range_sup.vgtest
    - none/tests/fdleak_cmsg_supp.vgtest
    - none/tests/fdleak_creat_sup.vgtest
    - none/tests/file_dclose_sup.vgtest
    
    Adjust none/tests/file_dclose, none/tests/fdleak_ipv4
    iand socket_close to fit the changes in filter_fdleak.
Comment 1 Alexandra Hajkova 2024-06-13 10:32:30 UTC
Created attachment 170456 [details]
patch
Comment 2 Alexandra Hajkova 2024-06-13 10:32:51 UTC
Created attachment 170457 [details]
patch
Comment 3 Mark Wielaard 2024-06-14 23:50:51 UTC
Thanks, it is good to see more tests for the file descriptor tracking, xml and suppression support.

I swapped a few things around, so each commit stands on its own.
And added some tweaks for older ppc64 rhel7 (with broken backtraces).

commit 8864c92efb8f65d8a56153f3bc8f7d2ac907b6cb
Author: Alexandra Hájková <ahajkova@redhat.com>
Date:   Thu May 23 04:39:54 2024 -0400

    Add file descriptor suppression tests
    
    - none/tests/double_close_range_sup.vgtest
    - none/tests/fdleak_cmsg_supp.vgtest
    - none/tests/fdleak_creat_sup.vgtest
    - none/tests/file_dclose_sup.vgtest
    
    https://bugs.kde.org/show_bug.cgi?id=488441

commit 6369c67d37c40c312f5403a08a23e5da878688db
Author: Alexandra Hájková <ahajkova@redhat.com>
Date:   Tue Apr 23 09:17:03 2024 -0400

    Add the tests for --track-fds=yes --xml=yes
    
    - none/tests/double_close_range_xml.vgtest
    - none/tests/fdleak_cmsg_xml.vgtest
    - none/tests/fdleak_creat_xml.vgtest
    - none/tests/fdleak_dup_xml.vgtest
    - none/tests/fdleak_dup2_xml.vgtest
    - none/tests/fdleak_fcntl_xml.vgtest
    - none/tests/fdleak_ipv4_xml.vgtest
    - none/tests/fdleak_open_xml.vgtest
    - none/tests/fdleak_pipe_xml.vgtest
    - none/tests/fdleak_socketpair_xml.vgtest
    - none/tests/file_dclose_xml.vgtest
    - none/tests/socket_close_xml.vgtest
    
    Add a new filter_xml. Note the use of --child-silent-after-fork=yes
    usage in two vgtests. Maybe this should be the default for --xml=yes?
    Otherwise xml output will be "corrupted" by output from a fork.
    
    https://bugs.kde.org/show_bug.cgi?id=488441

commit 8b374fd2bce60a58809b4f95a93d7e2f01929a08
Author: Alexandra Hájková <ahajkova@redhat.com>
Date:   Thu May 23 04:46:26 2024 -0400

    Improve none/tests/double_close_range test and filter_fdleak
    
    Adjust none/tests/file_dclose, none/tests/fdleak_ipv4
    and socket_close to fit the changes in filter_fdleak.
    
    https://bugs.kde.org/show_bug.cgi?id=488441