Skip to content

Conversation

@jiangenj
Copy link
Contributor

@jiangenj jiangenj commented Apr 7, 2025


Before sending a pull request, please review Contribution Guidelines:
https://github.com/google/syzkaller/blob/master/docs/contributing.md


@tarasmadan
Copy link
Collaborator

Hi @jiangenj , what is precise coverage?

@jiangenj
Copy link
Contributor Author

jiangenj commented Apr 7, 2025

Hi @jiangenj , what is precise coverage?

@tarasmadan
It's introduced in

commit da07505f2b87b144347aa19597979d340b134b06
Author: Dmitry Vyukov <dvyukov@google.com>
Date:   Tue Apr 9 09:02:58 2024 +0200

    pkg/cover: don't memorize all coverage points twice

    Currently we memorize all coverage points twice:
    as a slice and as a map.
    The map also contains __sanitizer_cov_trace_cmp PCs,
    but I think that's wrong, it should contain only
    __sanitizer_cov_trace_pc callbacks.
    We were careful to put as least pressure on the GC as possible
    by keeping all PCs as a dense allCoverPoints slice and subslicing it
    in all symbol/compilation unit objects.
    Don't duplicate coverage points in the map and just use the same slice
    we store for other purposes.

commit 991a98f41ea59aba246c9165c8d9539d780a2544
Author: Alexander Potapenko <glider@google.com>
Date:   Wed Jan 10 16:17:08 2024 +0100

    pkg/cover: ensure that all PCs returned by kcov have matching callbacks

    In the case some modules' addresses are off, certain kernel addresses
    returned by kcov may not have corresponding coverage callbacks in the
    .ko files. Keep an additional map in the backend to verify those
    addresses and report an error if that is the case.

    Because GCC < 14 may tail-call coverage callbacks, the described check
    is not performed for binaries which mention GCC in their .comment
    section.

    Also adjust text expectations in pkg/cover/report_test.go, so that
    non-GCC targets check for PCs matching the callbacks.

    See https://github.com/google/syzkaller/issues/4447 for more details.

@a-nogikh a-nogikh requested a review from ramosian-glider April 7, 2025 10:30
@a-nogikh
Copy link
Collaborator

a-nogikh commented Apr 7, 2025

@jiangenj why do you need to override the logic? If you observe non-matching PCs, it is possible to fix it on your side? Or, if these are unavoidable in some cases, adjust the existing logic to handle it better?

I believe we are adding way too many new parameters to pkg/mgrconfig.

@jiangenj
Copy link
Contributor Author

jiangenj commented Apr 8, 2025

@jiangenj why do you need to override the logic? If you observe non-matching PCs, it is possible to fix it on your side? Or, if these are unavoidable in some cases, adjust the existing logic to handle it better?

I believe we are adding way too many new parameters to pkg/mgrconfig.

update the commit msg on why we need the config, paste here too

Some module.ko doesn't have debug info, coverage won't be shown if
preciseCoverage is true.
We don't care about these module's coverage in some setup, so adding
precise_coverage in config will be easier to switch.

Some module.ko doesn't have debug info, coverage won't be shown if
preciseCoverage is true.
We don't care about these module's coverage in some setup, so adding
precise_coverage in config will be easier to switch.
@jiangenj
Copy link
Contributor Author

close since there is ?debug=true in /cover page

@jiangenj jiangenj closed this Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants