Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uprobe:address expansion #2138

Merged
merged 3 commits into from
Feb 4, 2022

Conversation

viktormalik
Copy link
Contributor

uprobe:target:address should never be expanded - neither when target contains a wildcard, nor when, e.g., probe builtin is used within the probe. This makes sure expansion doesn't happen. See individual commits for more details.

Fixes #2135.

Checklist
  • Language changes are updated in man/adoc/bpftrace.adoc and if needed in docs/reference_guide.md
  • User-visible and non-trivial changes updated in CHANGELOG.md
  • The new behaviour is covered by tests

@viktormalik
Copy link
Contributor Author

It looks like CI is broken. #2139 should fix that.

@fbs
Copy link
Member

fbs commented Feb 3, 2022

thanks!

If no function is specified on uprobe (typically when an absolute
address is given), do not run expansion in the probe matcher as that
would match all functions in the target binary which we don't want.

This fixes a bug when trying to attach to an absolute address while
using the "probe" builtin (which requires probe expansion).

See iovisor/bpftrace#2135 for details.
E.g.: uprobe:./prog*:0x1234
This is not supported anyway and would end with "No probes to attach".
This way, we throw an error, which is more informative.
@viktormalik viktormalik merged commit 22a8672 into bpftrace:master Feb 4, 2022
@viktormalik viktormalik deleted the probe-expansion-fix branch February 11, 2022 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessing the current probe name uprobes specified with an address causes some pathological behaviour
2 participants