Patent ID: 11922168
Assignee: MICROSOFT TECHNOLOGY LICENSING, LLC
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 0:
1. A method comprising:
executing, by a processor, a program comprising functions, each function comprising code for respective calls invoking a respective function, the executing comprising:
maintaining a call stack comprised of frames corresponding to respective invocations of the functions by the calls, each frame comprising a corresponding return address;
maintaining a shadow stack by:
adding return addresses to the shadow stack in correspondence with adding the frames to the call stack; and
removing return addresses from the shadow stack in correspondence with removing the frames from the call stack; and

in response to receiving a request for a stack trace, generating the stack trace by accessing the shadow stack, the accessing comprising:
referencing a first contiguous set of return addresses in the shadow stack;
detecting one or more contiguous corrupted return addresses in the shadow stack contiguously after the first contiguous set of return addresses in the shadow stack;
skipping the one or more contiguous corrupted return addresses; and
generating the stack trace by referencing a second contiguous set of return addresses in the shadow stack, the second contiguous set of return addresses being contiguously after the one or more contiguous corrupted return addresses in the shadow stack.