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: invalid pcsp in x86_64 #644

Merged
merged 1 commit into from
Jun 12, 2024
Merged

fix: invalid pcsp in x86_64 #644

merged 1 commit into from
Jun 12, 2024

Conversation

liuq19
Copy link
Collaborator

@liuq19 liuq19 commented May 30, 2024

  1. calculate the correct PCSP table as Golang
  2. enhanced the PCSP tests through sigtrap handler

Some details:
For calculate PCSP:

  1. we should concern the sp relative instructions: call, ret, subq imm, %rsp, addq imm, %rsp, leaq imm(%rbp), %rsp
  2. we should disable the instruction andq imm, %rsp, because of the lack of an exact delta

For test PCSP:

  1. we register the mock binary (mock with 0xcc instruction) as a mock function, and each 0xcc will cause trap
  2. we linked the testSigtrap function in golang runtime to test backtrace in each trap instruction

Related PR in asm2asm tool is cloudwego/asm2asm#5

@liuq19 liuq19 force-pushed the fix/pcsp branch 4 times, most recently from 0652fa6 to 2a49e8a Compare June 6, 2024 09:08
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.21%. Comparing base (99f5b35) to head (2a49e8a).
Report is 14 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #644      +/-   ##
==========================================
- Coverage   77.56%   71.21%   -6.35%     
==========================================
  Files          83      130      +47     
  Lines       11542     8363    -3179     
==========================================
- Hits         8952     5956    -2996     
+ Misses       2192     2084     -108     
+ Partials      398      323      -75     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@liuq19 liuq19 marked this pull request as ready for review June 6, 2024 09:16
@liuq19 liuq19 changed the title fix: invalid pcsp fix: invalid pcsp in x86_64 Jun 6, 2024
@liuq19 liuq19 force-pushed the fix/pcsp branch 12 times, most recently from d8701d8 to 38178a6 Compare June 12, 2024 07:44
@AsterDY AsterDY merged commit 3b2fa46 into main Jun 12, 2024
33 checks passed
@AsterDY AsterDY deleted the fix/pcsp branch June 12, 2024 09:40
MrAlias referenced this pull request in open-telemetry/opentelemetry-go-contrib Jun 20, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/bytedance/sonic](https://togithub.com/bytedance/sonic) |
`v1.11.8` -> `v1.11.9` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fbytedance%2fsonic/v1.11.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fbytedance%2fsonic/v1.11.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fbytedance%2fsonic/v1.11.8/v1.11.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fbytedance%2fsonic/v1.11.8/v1.11.9?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>bytedance/sonic (github.com/bytedance/sonic)</summary>

###
[`v1.11.9`](https://togithub.com/bytedance/sonic/releases/tag/v1.11.9)

[Compare
Source](https://togithub.com/bytedance/sonic/compare/v1.11.8...v1.11.9)

##### What's Changed

- chore: remove noavx2 mode by
[@&#8203;liuq19](https://togithub.com/liuq19) in
[https://github.com/bytedance/sonic/pull/647](https://togithub.com/bytedance/sonic/pull/647)
- fix: invalid pcsp in x86\_64 by
[@&#8203;liuq19](https://togithub.com/liuq19) in
[https://github.com/bytedance/sonic/pull/644](https://togithub.com/bytedance/sonic/pull/644)
- fix(visitor): unconsumed rbrace in (\*traverser).decodeObject() by
[@&#8203;zhongxinghong](https://togithub.com/zhongxinghong) in
[https://github.com/bytedance/sonic/pull/654](https://togithub.com/bytedance/sonic/pull/654)

**Full Changelog**:
bytedance/sonic@v1.11.8...v1.11.9

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/open-telemetry/opentelemetry-go-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTAuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQxMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

3 participants