On Fri, 8 Dec 2023, Patrick Welche wrote:

When profiling my simulation with

dtrace -x ustackframes=100 -n 'profile-9 / execname == "mds" / { @[ustack()] = 
count(); } tick-180s { exit(0); }' -o /tmp/out.stacks

every function name is preceded by c0 df ff ff 7f 7f e.g.,

00000060  20 20 20 20 20 20 20 20  20 c0 df ff ff 7f 7f 60  |         ......`|
00000070  66 5f 70 61 69 72 5f 44  4c 56 4f 28 61 74 6f 6d  |f_pair_DLVO(atom|

which is making perl, i.e., FlameGraph unhappy.

6 bytes seems a strange number.

Is this normal / any hints on what I can do about it?


This looks like junk on the stack:

src/external/cddl/osnet/dist/lib/libdtrace/common/dt_consume.c:dt_print_ustack()
doesn't initialize `objname' and doesn't check the return of proc_objname()
(line 1385) either.

Can you try this patch (fudged from FreeBSD)?

```
diff -urN a/src/external/bsd/libproc/dist/proc_sym.c 
b/src/external/bsd/libproc/dist/proc_sym.c
--- a/src/external/bsd/libproc/dist/proc_sym.c  2017-06-16 00:44:58.000000000 
+0100
+++ b/src/external/bsd/libproc/dist/proc_sym.c  2023-12-27 00:05:55.133763583 
+0000
@@ -141,6 +141,10 @@
        size_t i;
        rd_loadobj_t *rdl;

+       if (p->nobjs == 0)
+               if (proc_rdagent(p) == NULL)
+                       return (NULL);
+
        for (i = 0; i < p->nobjs; i++) {
                rdl = &p->rdobjs[i];
                if (addr >= rdl->rdl_saddr && addr < rdl->rdl_eaddr) {
```

-RVP

Reply via email to