[PATCH] dtrace crashes when trying to trace fbt probes without CTF data

From: Ryan Stone <rysto32_at_gmail.com>
Date: Sun, 25 Sep 2011 18:50:54 -0400
I get a panic if I try to run a dtrace script that uses an fbt probe
from a module that does not have CTF data.  The polling patch resolves
the issue for me:

Index: sys/cddl/dev/fbt/fbt.c
===================================================================
--- sys/cddl/dev/fbt/fbt.c      (revision 225756)
+++ sys/cddl/dev/fbt/fbt.c      (working copy)
_at__at_ -1261,7 +1261,7 _at__at_
        desc->dtargd_ndx = DTRACE_ARGNONE;

        /* Get a pointer to the CTF data and it's length. */
-       if (linker_ctf_get(ctl, &lc) != 0)
+       if (linker_ctf_get(ctl, &lc) != 0 || lc.ctfoffp == NULL)
                /* No CTF data? Something wrong? *shrug* */
                return;

However, I'm not entirely sure whether this is the correct approach to
fixing the problem(making linker_ctf_get() return an error seems to
break dtrace entirely).  Does anybody who has familiarity with
dtrace's internals have an opinion?
Received on Sun Sep 25 2011 - 20:50:55 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:18 UTC