Oh where oh where can my arg5 be?

Open
#62 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
macos, rust

Research direction

Start by reproducing the issue on an M1 macOS system with the port-process-return DTrace probe, then run the OPTE tests using cargo test --features usdt from the opte checkout. The work is done when a probe with six arguments reports the value passed in the arg5 position instead of NULL.

Written by the indexing model from the issue text.

Description

As I mentioned in #61, I'm seeing some issues around usdt while working on oxidecomputer/opte#145. I'm going to eschew the background and get straight to it.

Issue

EDIT: This is an M1 (ARM) mac.

On macOS I cannot seem to pass more than five arguments to a probe. As part of my change to OPTE (in the above link) I added an epoch argument to the port__process__return probe, now giving it a total of six arguments, pushing the res argument to arg5 position. After doing this the probe always fires with an arg5 of NULL.

$ sudo dtrace -Zn 'port-process-return { trace(arg5); }'
Password:
dtrace: description 'port-process-return ' matched 0 probes
CPU     ID                    FUNCTION:NAME
  5  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  2  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  4  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  9  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  6  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  7  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  8  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  8  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  7  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  8  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  8  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  6  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0
  6  14747 _ZN4opte6engine4port4Port25port_process_return_probe17hec39bcf71fd676a8E:port-process-return                 0

Reproduce

  1. Clone the opte repo onto a macOS box and checkout the opte-143-set-fw-rules branch.
  2. In one window trace arg5 of the port-process-return probe.
$ sudo dtrace -Zn 'port-process-return { trace(arg5); }'
  1. In another window run the OPTE unit tests with the usdt feature.
$ cd opte
$ cargo test --features usdt
Dominant language
Rust
Stars
145
Forks
15
Avg merge
14m
Merged PRs (30d)
6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from oxidecomputer/usdt

All issues in oxidecomputer/usdt

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.