# debug: msync only current page when validation frame pointer · gitcafe/zig

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

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

Visibility: public

Requested revision: fdee7dd60dccd184a4fd4023ad03c4236f6a20b3

Requested commit: fdee7dd60dccd184a4fd4023ad03c4236f6a20b3

Commit: fdee7dd60dccd184a4fd4023ad03c4236f6a20b3

Tree: 81220e0bcc142c185300922dce2f480a7574e7de

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
debug: msync only current page when validation frame pointer

This fixes lack of stack traces on arm64 macOS which were regressed
and not getting generated at all after this addition to write
current stack traces. Prior to this, function `isValidMemory` would
sync two subsequent pages if the aligned (base) address was different
than the frame pointer. I fail to see what the logic for such assumption
here is as the manual of `msync` clearly states it will fail with error
if the passed in memory region length contains unmapped regions.

This was the very reason why there were no stack traces print on
arm64 macOS as the second page was unmapped thus incorrectly flagging
the frame pointer as invalid.

```

## Parents

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

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