1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

dtrace: Disable getf() as it is broken on FreeBSD

getf() on FreeBSD calls _sx_slock(), _sx_sunlock() and fget_locked().
Furthermore, it does not set the per-core fault flag, meaning it
usually ends up in a double fault panic once getf() does get called,
especially from fbt.

Reviewing the DTrace Toolkit + a number of other scripts scattered
around FreeBSD, I have not been able to find one use of getf(). Given
how broken the implementation currently is, we disable it until it
can be implemented properly.

Also comment out a test in aggs/tst.subr.d for getf().

Reviewed by:	markj

(cherry picked from commit 30ec3138ed)
This commit is contained in:
Domagoj Stolfa 2021-12-17 11:01:54 -05:00 committed by Mark Johnston
parent 6d4d4e531d
commit 6c9c924b43
2 changed files with 5 additions and 1 deletions

View File

@ -98,7 +98,7 @@ INTFUNC(ntohll(0x1234567890abcdefL))
STRFUNC(inet_ntoa((ipaddr_t *)alloca(sizeof (ipaddr_t))))
STRFUNC(inet_ntoa6((in6_addr_t *)alloca(sizeof (in6_addr_t))))
STRFUNC(inet_ntop(AF_INET, (void *)alloca(sizeof (ipaddr_t))))
INTFUNC(getf(0))
/* INTFUNC(getf(0)) */
INTFUNC(strtoll("0x12EE5D5", 16))
STRFUNC(json("{\"systemtap\": false}", "systemtap"))

View File

@ -10014,6 +10014,9 @@ dtrace_difo_validate(dtrace_difo_t *dp, dtrace_vstate_t *vstate, uint_t nregs,
}
if (subr == DIF_SUBR_GETF) {
#ifdef __FreeBSD__
err += efunc(pc, "getf() not supported");
#else
/*
* If we have a getf() we need to record that
* in our state. Note that our state can be
@ -10024,6 +10027,7 @@ dtrace_difo_validate(dtrace_difo_t *dp, dtrace_vstate_t *vstate, uint_t nregs,
*/
if (vstate->dtvs_state != NULL)
vstate->dtvs_state->dts_getf++;
#endif
}
break;