Bug 266098 - dtrace: error on enabled probe ID 2 (ID 79710: io:kernel:none:start): invalid address (0x20) in action #4 at DIF offset 16
Summary: dtrace: error on enabled probe ID 2 (ID 79710: io:kernel:none:start): invalid...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Johnston
URL:
Keywords:
: 220965 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-08-29 12:31 UTC by Mateusz Piotrowski
Modified: 2022-09-21 20:12 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mateusz Piotrowski freebsd_committer freebsd_triage 2022-08-29 12:31:18 UTC
I'm executing the following DTrace program on FreeBSD 13.1-RELEASE amd64 (the classic bitesize.d ported to FreeBSD):

    dtrace:::BEGIN {
            printf("Tracing... Hit Ctrl-C to end.\n");
    }
    
    io:::start {
            @size[pid, execname] = quantize(args[0]->bio_bcount);
    }
    
    dtrace:::END {
            printf("\n%8s  %s\n", "PID", "CMD");
            printa("%8d  %s\n%@d\n", @size);
    }

and I'm getting a lot of the following log messages shorty after the script is started:

    dtrace: error on enabled probe ID 2 (ID 79710: io:kernel:none:start): invalid address (0x20) in action #4 at DIF offset 16

I tested that on multiple amd64 machines on 13.1-RELEASE. The result is the same. What could be causing that?
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2022-08-29 17:21:07 UTC
It's because there is a io:::start probe in devstat_start_transaction(), but there is no BIO to reference.  I'll commit a patch to remove those probes, since I don't think they're very useful.

BTW, this script isn't going to give you much information on FreeBSD.  The io probes are too "deep" in the I/O path to retain any association with the process that initiated the I/O.  That is, "execname" will not tell you much.  In some cases it might, but that depends on the filesystem and GEOM providers in use.
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-08-29 17:36:36 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=32faf071bd54c0e2e1ac07700f7ea5a3d6fa8d51

commit 32faf071bd54c0e2e1ac07700f7ea5a3d6fa8d51
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-08-29 17:22:36 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-08-29 17:22:36 +0000

    devstat: Remove DTrace io probes lacking a BIO reference

    The io:::start and end probes trace individual I/O requests.

    Also remove the unimplemented wait-start and wait-done probes.

    PR:             266098
    MFC after:      1 week

 sys/kern/subr_devstat.c | 10 ----------
 1 file changed, 10 deletions(-)
Comment 3 Mark Johnston freebsd_committer freebsd_triage 2022-08-29 17:37:06 UTC
*** Bug 220965 has been marked as a duplicate of this bug. ***
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-09-21 20:09:53 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=22ea3be839edcc877c4199081147499065595d09

commit 22ea3be839edcc877c4199081147499065595d09
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-08-29 17:22:36 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-09-21 20:09:25 +0000

    devstat: Remove DTrace io probes lacking a BIO reference

    The io:::start and end probes trace individual I/O requests.

    Also remove the unimplemented wait-start and wait-done probes.

    PR:             266098

    (cherry picked from commit 32faf071bd54c0e2e1ac07700f7ea5a3d6fa8d51)

 sys/kern/subr_devstat.c | 10 ----------
 1 file changed, 10 deletions(-)