[compiler-rt] [scudo] limit VMA size for riscv64 for DefaultConfig (PR #76013)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 11:02:16 PST 2024


================
@@ -124,8 +124,14 @@ struct DefaultConfig {
   struct Primary {
     using SizeClassMap = DefaultSizeClassMap;
 #if SCUDO_CAN_USE_PRIMARY64
+#if SCUDO_RISCV64
+    // Support 39-bit VMA for riscv-64
+    static const uptr RegionSizeLog = 30U;
+    static const uptr GroupSizeLog = 19U;
+#else
----------------
ChiaHungDuan wrote:

The reason for this crash is that the kernel can't reserve a contiguous pages which is big enough for this configuration. It pretty depends on how the VMA is managed in a process and how the libs are loaded. Besides, I suppose this change is only for tests. To avoid any other size change because of the same reason, a number as small as possible to pass the tests is more ideal.  If this is not only for the tests, then I would suggest having a custom config for your project instead.

BTW, as mentioned above, we will have a different approach for this issue and the change is only a workaround

https://github.com/llvm/llvm-project/pull/76013


More information about the llvm-commits mailing list