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

add symbol and module names to StackFrame #723

Merged
21 commits merged into from
Mar 24, 2021

Conversation

bmc-msft
Copy link
Contributor

@bmc-msft bmc-msft commented Mar 23, 2021

This exposes the module_info and symbol name from debugger in the StackFrame. This enables the stack minimization function work on function names.

This exposes the module_info and symbol name from debugger in the StackFrame
@bmc-msft
Copy link
Contributor Author

bmc-msft commented Mar 23, 2021

Current output:

{
  "crash_report": {
    "input_sha256": "8abb9b1b07f17b5442c5d71b38eaf599ddd37fa38a3062c709a7e68412e57922",
    "executable": "C:\\Users\\bcaswell\\projects\\test-artifacts\\windows-trivial-crash\\fuzz.exe",
    "crash_type": "WriteAccessViolation",
    "crash_site": "fuzz!strncpy minkernel\\crts\\ucrt\\src\\appcrt\\string\\amd64\\strncpy.asm:46",
    "call_stack": [
      "fuzz!strncpy minkernel\\crts\\ucrt\\src\\appcrt\\string\\amd64\\strncpy.asm:46",
      "fuzz!check D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:21",
      "fuzz!from_file D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:67",
      "<corrupt frame(s)>"
    ],
    "call_stack_sha256": "8c0026819742a73973b587fd9e18545b1fd2770ebd65b9141f24bcc6c4e47b9c",
    "minimized_stack": [
      "fuzz!strncpy minkernel\\crts\\ucrt\\src\\appcrt\\string\\amd64\\strncpy.asm:46",
      "fuzz!check D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:21",
      "fuzz!from_file D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:67",
      "<corrupt frame(s)>"
    ],
    "minimized_stack_sha256": "8c0026819742a73973b587fd9e18545b1fd2770ebd65b9141f24bcc6c4e47b9c",
    "minimized_stack_function_names": [
      "fuzz!strncpy",
      "fuzz!check",
      "fuzz!from_file"
    ],
    "minimized_stack_function_names_sha256": "58cd174f108dcd9cf568209a818dcae72d4fb7b0b85037598e26c214f3c44fce",
    "task_id": "00000000-0000-0000-0000-000000000000",
    "job_id": "00000000-0000-0000-0000-000000000000"
  }
}

New output:

{
  "crash_report": {
    "input_sha256": "8abb9b1b07f17b5442c5d71b38eaf599ddd37fa38a3062c709a7e68412e57922",
    "executable": "C:\\Users\\USERNAME\\projects\\test-artifacts\\windows-trivial-crash\\fuzz.exe",
    "crash_type": "WriteAccessViolation",
    "crash_site": "fuzz!strncpy minkernel\\crts\\ucrt\\src\\appcrt\\string\\amd64\\strncpy.asm:46",
    "call_stack": [
      "fuzz!strncpy minkernel\\crts\\ucrt\\src\\appcrt\\string\\amd64\\strncpy.asm:46",
      "fuzz!check D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:21",
      "fuzz!from_file D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:67",
      "<corrupt frame(s)>"
    ],
    "call_stack_sha256": "8c0026819742a73973b587fd9e18545b1fd2770ebd65b9141f24bcc6c4e47b9c",
    "minimized_stack": [
      "fuzz!check D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:21",
      "fuzz!from_file D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:67",
      "<corrupt frame(s)>"
    ],
    "minimized_stack_sha256": "bc7b98cd717cc6a77450c7456d6f3e4a0fb7af2c3f80f8af6c6ea0ae4eb23784",
    "minimized_stack_function_names": [
      "check",
      "from_file"
    ],
    "minimized_stack_function_names_sha256": "a6577cb7f0b98e9eb955baedc8ed6d2192852f1aa2acb562985c853748a9f664",
    "task_id": "00000000-0000-0000-0000-000000000000",
    "job_id": "00000000-0000-0000-0000-000000000000"
  }
}

@bmc-msft bmc-msft requested review from lzybkr and ranweiler March 23, 2021 19:47
@bmc-msft bmc-msft requested review from lzybkr and ranweiler March 24, 2021 00:22
src/agent/debugger/src/stack.rs Outdated Show resolved Hide resolved
@bmc-msft bmc-msft requested a review from ranweiler March 24, 2021 15:44
@bmc-msft
Copy link
Contributor Author

Note, with the above changes, the output now looks like:

{
  "crash_report": {
    "input_sha256": "24c3bb3be2e50c36320b9e737f81438e0ec34835ce39def8bec9921b64ac17e8",
    "executable": "C:\\Users\\USERNAME\\projects\\test-artifacts\\windows-trivial-crash\\fuzz.exe",
    "crash_type": "WriteAccessViolation",
    "crash_site": "fuzz!strncpy+0x30 minkernel\\crts\\ucrt\\src\\appcrt\\string\\amd64\\strncpy.asm:46",
    "call_stack": [
      "fuzz!strncpy+0x30 minkernel\\crts\\ucrt\\src\\appcrt\\string\\amd64\\strncpy.asm:46",
      "fuzz!check+0x1d D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:21",
      "fuzz!from_file+0xa7 D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:67",
      "<corrupt frame(s)>"
    ],
    "call_stack_sha256": "da4ee7a170c47a7d34d92bda06d030e84060120396f26e8f938538e2dae9ceba",
    "minimized_stack": [
      "fuzz!check+0x1d D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:21",
      "fuzz!from_file+0xa7 D:\\a\\onefuzz\\onefuzz\\src\\integration-tests\\trivial-crash\\fuzz.c:67",
      "<corrupt frame(s)>"
    ],
    "minimized_stack_sha256": "9d706a2aadca7cb39d81b01a0bab178c17792c83baa2a085baa2bfe167e5711e",
    "minimized_stack_function_names": [
      "check",
      "from_file"
    ],
    "minimized_stack_function_names_sha256": "a6577cb7f0b98e9eb955baedc8ed6d2192852f1aa2acb562985c853748a9f664",
    "task_id": "00000000-0000-0000-0000-000000000000",
    "job_id": "00000000-0000-0000-0000-000000000000"
  }
}

@ghost
Copy link

ghost commented Mar 24, 2021

Hello @bmc-msft!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit fd6f9eb into microsoft:main Mar 24, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 24, 2021
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants