# Fix stack traces with non-null \`first_address\` on Windows · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/a76775b50a65fd0ea0fd17d6ef3c42058df13997)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: a76775b50a65fd0ea0fd17d6ef3c42058df13997

Requested commit: a76775b50a65fd0ea0fd17d6ef3c42058df13997

Commit: a76775b50a65fd0ea0fd17d6ef3c42058df13997

Tree: 46fea00ce7c12e66d898d02eff0c94b2d5ef0d4d

Author: Ryan Liptak

Committer: Veikka Tuominen

## Message

```
Fix stack traces with non-null `first_address` on Windows

Before this commit, the passed in length would always be given to the RtlCaptureStackBackTrace call. Now we always give the length of the actual buffer we're using (the addr_buf_stack size of 32 or the passed in length if it's larger than 32; this matches what the doc comment says the function was meant to be doing as well).

This was causing empty stack traces for things like the GeneralPurposeAllocator leak checking.

Fixes #6687

```

## Parents

- [76f83282776151bd79715c4c00d13d06de633354](https://git.cafe/gitcafe/zig/commit/76f83282776151bd79715c4c00d13d06de633354?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/a76775b50a65fd0ea0fd17d6ef3c42058df13997?format=markdown)
