From fe98b5048e88f6ff2c846bb3a805e08ede931170 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Tue, 25 Aug 2026 15:43:54 +0800 Subject: [PATCH] =?UTF-8?q?fix(memhub):=20=5F=5Finit=5F=5F=20=E6=98=BE?= =?UTF-8?q?=E5=BC=8F=E5=88=9D=E5=A7=8B=E5=8C=96=20detection=20=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E9=98=B2=E9=BB=98=E8=AE=A4=E5=80=BC=E5=A4=B1=E6=95=88?= =?UTF-8?q?=20-=20TPC=20=E7=B1=BB=E5=AD=97=E6=AE=B5=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E5=AF=B9=20CDefine=20=E5=B8=B8=E9=87=8F=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E4=B8=8D=E7=94=9F=E6=95=88=EF=BC=8Cdetection=5Fsize?= =?UTF-8?q?=3D=E5=9E=83=E5=9C=BE=20=E2=86=92=20malloc(=E5=9E=83=E5=9C=BE)?= =?UTF-8?q?=201-byte=20=E8=AE=B0=E5=BD=95=E5=8C=BA=20=E2=86=92=20=E6=89=A9?= =?UTF-8?q?=E5=AE=B9=20realloc=20double-free(ASAN=20=E6=8D=95=E8=8E=B7)?= =?UTF-8?q?=EF=BC=9B=E6=98=BE=E5=BC=8F=E8=B5=8B=E5=80=BC=20detection=5Fsiz?= =?UTF-8?q?e/MEMBUDDY=5FDET=5FRECORD=5FSIZE=20+=20=5Fdet=5Farena/=5Fdet=5F?= =?UTF-8?q?records/=5Fdet=5Fcount/=5Fdet=5Fcap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/memhub.vp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/memhub.vp b/includes/memhub.vp index f6d63f1..07f0ce0 100644 --- a/includes/memhub.vp +++ b/includes/memhub.vp @@ -333,6 +333,14 @@ class MemBuddy(MemManager): self.base = base self.size = size self.detection = detection + # 显式赋值(不能依赖字段默认值——TPC 类字段默认值对 CDefine 常量 + # 可能不生效,垃圾 detection_size → malloc(垃圾) 1-byte 记录区 → + # 扩容 realloc double-free,ASAN 已捕获) + self.detection_size = MEMBUDDY_DET_RECORD_SIZE + self._det_arena = None + self._det_records = None + self._det_count = 0 + self._det_cap = 0 self.max_order = 0 self.free_lists = None self.lock_val = 0