Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Tsan】How Tsan shadow memory mapping is chosen ? #1790

Open
yinchuang-code opened this issue Sep 5, 2024 · 0 comments
Open

【Tsan】How Tsan shadow memory mapping is chosen ? #1790

yinchuang-code opened this issue Sep 5, 2024 · 0 comments

Comments

@yinchuang-code
Copy link

yinchuang-code commented Sep 5, 2024

/*
C/C++ on linux/aarch64 (39-bit VMA)
0000 0010 00 - 0100 0000 00: main binary // ~4G
0100 0000 00 - 0400 0000 00: -
0400 0000 00 - 1000 0000 00: shadow memory
2000 0000 00 - 3100 0000 00: -
3100 0000 00 - 3400 0000 00: metainfo
3400 0000 00 - 5500 0000 00: -
5500 0000 00 - 5600 0000 00: main binary (PIE) // 4G
5600 0000 00 - 7c00 0000 00: -
7c00 0000 00 - 7d00 0000 00: heap  // 4G
7d00 0000 00 - 7fff ffff ff: modules and main thread stack  // 8GB
*/
struct MappingAarch64_39 {
  static const uptr kLoAppMemBeg   = 0x0000001000ull;
  static const uptr kLoAppMemEnd   = 0x0100000000ull;
  static const uptr kShadowBeg = 0x0400000000ull;
  static const uptr kShadowEnd = 0x1000000000ull;
  static const uptr kMetaShadowBeg = 0x3100000000ull;
  static const uptr kMetaShadowEnd = 0x3400000000ull;
  static const uptr kMidAppMemBeg  = 0x5500000000ull;
  static const uptr kMidAppMemEnd = 0x5600000000ull;
  static const uptr kHeapMemBeg    = 0x7c00000000ull;
  static const uptr kHeapMemEnd    = 0x7d00000000ull;
  static const uptr kHiAppMemBeg   = 0x7e00000000ull;
  static const uptr kHiAppMemEnd   = 0x7fffffffffull;
  static const uptr kShadowMsk = 0x7800000000ull;
  static const uptr kShadowXor = 0x0200000000ull;
  static const uptr kShadowAdd = 0x0000000000ull;
  static const uptr kVdsoBeg       = 0x7f00000000ull;
};```

1、The memory available to the user is only “8G”? except main binary
2、Why is it not consistent with asan’s shadow?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant