While playing around with stddev() I discovered that it's possible to crash libdtrace by printing a stddev aggregation immediately after clearing it: $ cat test.d dtrace:::BEGIN { @a = stddev(0); clear(@a); printa("%@d", @a); } $ sudo dtrace -s test.d dtrace: script 'test.d' matched 1 probe CPU ID FUNCTION:NAME Assertion failed: (divisor != 0), file /home/mark/src/freebsd/cddl/lib/libdtrace/../../../cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c, line 240. 4 1 :BEGIN This doesn't happen with other aggregation functions (avg, max, min).
A commit references this bug: Author: markj Date: Mon Feb 2 20:48:32 UTC 2015 New revision: 278114 URL: https://svnweb.freebsd.org/changeset/base/278114 Log: Let the standard deviation of the empty set be 0. This is consistent with the behaviour for averages, and fixes a crash that can occur when attempting to print a stddev aggregation containing no elements: dtrace:::BEGIN { @ = stddev(0); clear(@); printa("%@d", @); } PR: 197260 MFC after: 2 week Changes: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
A commit references this bug: Author: markj Date: Sun Apr 12 21:35:14 UTC 2015 New revision: 281472 URL: https://svnweb.freebsd.org/changeset/base/281472 Log: MFC r278114: libdtrace: Let the standard deviation of the empty set be 0. PR: 197260 Changes: _U stable/10/ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c