Bug 253440 - dtrace failing to resolve some fbt probe argument types
Summary: dtrace failing to resolve some fbt probe argument types
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-11 19:16 UTC by Mark Johnston
Modified: 2021-02-22 22:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Johnston freebsd_committer freebsd_triage 2021-02-11 19:16:43 UTC
We have:

> dtrace -lv -n fbt::ifa_alloc:entry
   ID   PROVIDER            MODULE                          FUNCTION NAME
52703        fbt            kernel                         ifa_alloc entry

        Probe Description Attributes
                Identifier Names: Private
                Data Semantics:   Private
                Dependency Class: Unknown

        Argument Attributes
                Identifier Names: Private
                Data Semantics:   Private
                Dependency Class: ISA

        Argument Types
                args[0]: (unknown)
                args[1]: int

But:

> ctfdump -f /boot/kernel/kernel | grep ifa_alloc
  [28508] FUNC (ifa_alloc) returns: 533 args: (35, 66)
> ctfdump -t /boot/kernel/kernel | grep -B3 '<35>'
  <32> INTEGER unsigned long encoding=0x0 offset=0 bits=64
  <33> TYPEDEF __uint64_t refers to 32
  <34> TYPEDEF __size_t refers to 33
  <35> TYPEDEF size_t refers to 34

So the type info is there.  DTRACE_DEBUG shows

libdtrace DEBUG: discovering probe fbt:kernel:ifa_alloc:entry id=52703
libdtrace DEBUG: failed to resolve input type size_t for fbt:kernel:ifa_alloc:entry arg #1: syntax error near "
Comment 1 commit-hook freebsd_committer freebsd_triage 2021-02-17 08:26:40 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=6b7e592c215fb76ea027f25030ddc9a697184fbe

commit 6b7e592c215fb76ea027f25030ddc9a697184fbe
Author:     Jung-uk Kim <jkim@FreeBSD.org>
AuthorDate: 2021-02-17 07:22:47 +0000
Commit:     Jung-uk Kim <jkim@FreeBSD.org>
CommitDate: 2021-02-17 07:22:47 +0000

    lex: Do not let input() return 0 when end-of-file is reached

    Importing flex 2.6.4 has introduced a regression: input() now returns 0
    instead of EOF to indicate that the end of input was reached, just like
    traditional AT&T and POSIX lex.  Note the behavior contradicts flex(1).
    See "INCOMPATIBILITIES WITH LEX AND POSIX" section for information.
    This incompatibility traces back to the original version and documented
    in its manual page by the Vern Paxson.

    Apparently, it has been reported in a few places, e.g.,

    https://github.com/westes/flex/issues/448
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911415

    Unfortunately, this also breaks the scanner used by libdtrace and
    dtrace is unable to resolve some probe argument types as a result.  See
    PR253440 for more information.

    Note the regression was introduced by the following upstream commit
    without any explanation or documentation change:

    https://github.com/westes/flex/commit/f863c9490e6912ffcaeb12965fb3a567a10745ff

    Now we restore the traditional flex behavior unless lex-compatibility
    mode is set with "-l" option because I believe the author originally
    wanted to make it more lex and POSIX compatible.

    PR:             253440
    Reported by:    markj

 contrib/flex/src/flex.skl | 4 ++++
 1 file changed, 4 insertions(+)
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-02-17 16:02:52 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8ba333e02eaa59337a4e1d5534d4e894344c8226

commit 8ba333e02eaa59337a4e1d5534d4e894344c8226
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-02-17 15:49:38 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-02-17 15:57:19 +0000

    libdtrace: Stop relying on lex compatibility

    It does not appear to be required, and as of commit 6b7e592c215f
    ("lex: Do not let input() return 0 when end-of-file is reached") it
    causes input to return 0 instead of EOF when end-of-input is reached.

    PR:             253440
    MFC after:      3 days
    Sponsored by:   The FreeBSD Foundation

 cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h | 2 +-
 cddl/lib/libdtrace/Makefile                             | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-02-20 16:41:10 UTC
A commit in branch stable/13 references this bug:

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

commit af80731179386cf019463e392370b6478a714aea
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-02-17 15:49:38 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-02-20 02:39:51 +0000

    libdtrace: Stop relying on lex compatibility

    It does not appear to be required, and as of commit 6b7e592c215f
    ("lex: Do not let input() return 0 when end-of-file is reached") it
    causes input to return 0 instead of EOF when end-of-input is reached.

    PR:             253440
    Sponsored by:   The FreeBSD Foundation

    (cherry picked from commit 8ba333e02eaa59337a4e1d5534d4e894344c8226)

 cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h | 2 +-
 cddl/lib/libdtrace/Makefile                             | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-02-22 21:15:49 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=80cb372e2ad847c4093f9cf7ddfe4b6355520c1b

commit 80cb372e2ad847c4093f9cf7ddfe4b6355520c1b
Author:     Jung-uk Kim <jkim@FreeBSD.org>
AuthorDate: 2021-02-17 07:22:47 +0000
Commit:     Jung-uk Kim <jkim@FreeBSD.org>
CommitDate: 2021-02-22 21:13:50 +0000

    lex: Do not let input() return 0 when end-of-file is reached

    Importing flex 2.6.4 has introduced a regression: input() now returns 0
    instead of EOF to indicate that the end of input was reached, just like
    traditional AT&T and POSIX lex.  Note the behavior contradicts flex(1).
    See "INCOMPATIBILITIES WITH LEX AND POSIX" section for information.
    This incompatibility traces back to the original version and documented
    in its manual page by the Vern Paxson.

    Apparently, it has been reported in a few places, e.g.,

    https://github.com/westes/flex/issues/448
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911415

    Unfortunately, this also breaks the scanner used by libdtrace and
    dtrace is unable to resolve some probe argument types as a result.  See
    PR253440 for more information.

    Note the regression was introduced by the following upstream commit
    without any explanation or documentation change:

    https://github.com/westes/flex/commit/f863c9490e6912ffcaeb12965fb3a567a10745ff

    Now we restore the traditional flex behavior unless lex-compatibility
    mode is set with "-l" option because I believe the author originally
    wanted to make it more lex and POSIX compatible.

    PR:             253440
    Reported by:    markj

    (cherry picked from commit 6b7e592c215fb76ea027f25030ddc9a697184fbe)

 contrib/flex/src/flex.skl | 4 ++++
 1 file changed, 4 insertions(+)
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-02-22 21:34:55 UTC
A commit in branch releng/13.0 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=4e3fa977a14f7c69a39aacd8788a437527767dac

commit 4e3fa977a14f7c69a39aacd8788a437527767dac
Author:     Jung-uk Kim <jkim@FreeBSD.org>
AuthorDate: 2021-02-17 07:22:47 +0000
Commit:     Jung-uk Kim <jkim@FreeBSD.org>
CommitDate: 2021-02-22 21:28:53 +0000

    lex: Do not let input() return 0 when end-of-file is reached

    Importing flex 2.6.4 has introduced a regression: input() now returns 0
    instead of EOF to indicate that the end of input was reached, just like
    traditional AT&T and POSIX lex.  Note the behavior contradicts flex(1).
    See "INCOMPATIBILITIES WITH LEX AND POSIX" section for information.
    This incompatibility traces back to the original version and documented
    in its manual page by the Vern Paxson.

    Apparently, it has been reported in a few places, e.g.,

    https://github.com/westes/flex/issues/448
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911415

    Unfortunately, this also breaks the scanner used by libdtrace and
    dtrace is unable to resolve some probe argument types as a result.  See
    PR253440 for more information.

    Note the regression was introduced by the following upstream commit
    without any explanation or documentation change:

    https://github.com/westes/flex/commit/f863c9490e6912ffcaeb12965fb3a567a10745ff

    Now we restore the traditional flex behavior unless lex-compatibility
    mode is set with "-l" option because I believe the author originally
    wanted to make it more lex and POSIX compatible.

    PR:             253440
    Reported by:    markj
    Approved by:    re (gjb)

    (cherry picked from commit 6b7e592c215fb76ea027f25030ddc9a697184fbe)

 contrib/flex/src/flex.skl | 4 ++++
 1 file changed, 4 insertions(+)
Comment 6 commit-hook freebsd_committer freebsd_triage 2021-02-22 22:00:00 UTC
A commit in branch releng/13.0 references this bug:

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

commit ae093a0614f30d4cdffb853e4eba93322e8ed8f4
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-02-17 15:49:38 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-02-22 21:59:36 +0000

    libdtrace: Stop relying on lex compatibility

    It does not appear to be required, and as of commit 6b7e592c215f
    ("lex: Do not let input() return 0 when end-of-file is reached") it
    causes input to return 0 instead of EOF when end-of-input is reached.

    Approved by:    re (gjb)
    PR:             253440
    Sponsored by:   The FreeBSD Foundation

    (cherry picked from commit 8ba333e02eaa59337a4e1d5534d4e894344c8226)
    (cherry picked from commit af80731179386cf019463e392370b6478a714aea)

 cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h | 2 +-
 cddl/lib/libdtrace/Makefile                             | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)