Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Fix incorrect offset in stack reports #658

Merged
merged 3 commits into from
Mar 10, 2021

Conversation

lzybkr
Copy link
Member

@lzybkr lzybkr commented Mar 10, 2021

The wrong PC was from the context record and incorrectly adjusted by 1 which worked well enough to see the correct function name and line numbers, but was the wrong offset.

The correct PC is passed in a STACKFRAME_EX struct.

@ranweiler
Copy link
Member

I assume this changes the OneFuzz crash reports / hashes, due to the changed PC?

@lzybkr
Copy link
Member Author

lzybkr commented Mar 10, 2021

Yes, it could, but I don't think the hashing is used for libfuzzer tasks. Note that my other PR definitely changes the stack hashes as we use the default Rust generated hash impl and I changed the struct to include the offset.

@lzybkr lzybkr merged commit 54e0070 into microsoft:main Mar 10, 2021
@lzybkr lzybkr deleted the jasonsh/fix_fns_offset branch March 10, 2021 22:52
@ranweiler
Copy link
Member

@bmc-msft: I verified that this PR does change the function-relative offsets of stack frames with no source info (e.g. from kernel32, ntdll), and thus changes the call_stack and call_stack_sha256 fields of generic crash reports.

@lzybkr
Copy link
Member Author

lzybkr commented Mar 10, 2021

Note that a Windows update would just as easily change the hash for such stacks.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants