From patchwork Tue Jul 29 16:28:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 117205 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8F7883858CD1 for ; Tue, 29 Jul 2025 16:29:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F7883858CD1 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=WxnuSto9; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=WxnuSto9 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11010041.outbound.protection.outlook.com [52.101.84.41]) by sourceware.org (Postfix) with ESMTPS id 93C9E3858C55 for ; Tue, 29 Jul 2025 16:29:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 93C9E3858C55 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 93C9E3858C55 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=52.101.84.41 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1753806542; cv=pass; b=LdzH95W9qpdbI5lkWk0hXA0Y4ZrFLiIXvHsCvGqrGz9fLFA9Fm4bQJ55/EGz8p8iOm89kkXOce23m91m1rlI4Es5lRuGRcxe6sbpGNTyJ3PwW0mRKrYQWTcBZ1no/sQ8F6eRHHxLE/p/Kdg0O0HWpVkOEMaFYGpQWWYAsDetf9c= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1753806542; c=relaxed/simple; bh=bIjXdJ/4IQyqJnhIc0Ntus7BwlhCHif4KsVkX5OoI0w=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=bDmUj1a3lTnvudUZiy6hJzSv2ZSRiffXR2ggVzvvvsMSSRhHF1TcFWpVKSQfIu8Pma9toYVxo9RgX1jH+t7WpLNnJkgF+cfeuhRW6lf2QPAuSZf98nNKXPWzIicAveqZgzlodHAfRmmT6EkYHc4HWELPjtx+kquJAaVDDuLDuXw= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 93C9E3858C55 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=VR2Qa04WI8fE2srW53J3W1KbeWOc85FLkU9nMCYk16Bvw6wMX3wxzNSGbG0CG4KQzQNXs8Q6Fh2wQ+/+uMEraO5iIwpJEAff7Fbc0J96EeRnzsGAIY6SSf8fo1ogYKnc37HEILZrsFOwyFOawGa/RnxLhD+MKtp+2+eL5BBcVyRM7QY8ZV7622PCKmLKWQZTL6bHscFFrbMJuDBEibwwZ2hfTuRAKr5kJChJvVK6WzxwELBisOqG2uhJM9is4U0wCM7NuUlCgiiym2lrqkAAlIdjIDTXN6Pv55d0ZuLSQZTVxQTD7YAt6LFRIkU1fk0c68A7Pn2MwhaUBAoGGp6oXQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KBOWwrIUwrzvr7g820tNJt6p9N7PLgn7UH8akF46C08=; b=I/vZsh1vVktDFcIue36C7HrOBdVw1GOxapSGqPnZ6QefsTbmlq0oQpkPqQORBlNANsPNM4y21zhViuv9ONRmzHJjF3lkmzrLzQc4kMHzqdSZW+tJnysMmpl0GQvP97lrM2vN1BkcAtgwQ1kySPYvlrLp661nyyytM5IrJIT+wJzygnaiYJrNna/ri+Wk7NAPTamK4tCuxSOj0OYBUDpMRgsV75DUMaEppbbN5rOFFJcrVmCuGFIyftaE+I2Di5yOIFRQLcI+zQCtSA6SCklj1X+hD65vJUHXRCoiWvV2PcplcT40iD6ZbMKBJeYI/7c3yaeOoe91aL3c/E+wux58cg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KBOWwrIUwrzvr7g820tNJt6p9N7PLgn7UH8akF46C08=; b=WxnuSto9M8zpX70Rpyz4wwt+IhaLinwaex69r11cdRwH71D8zgyUnznqKzGV6oc39cJdvCyOCf9Na5LWWgrrfjadKC0/TXvbr9tbLecbPn7sbpKpE213yZHwy3Y0WwzOo4tEosgvnZaJLt2GWLqmOfCBUzTlEoKTOmgKm69yGBU= Received: from AM0PR10CA0076.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:15::29) by DU0PR08MB8833.eurprd08.prod.outlook.com (2603:10a6:10:478::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8989.11; Tue, 29 Jul 2025 16:28:56 +0000 Received: from AM2PEPF0001C708.eurprd05.prod.outlook.com (2603:10a6:208:15:cafe::d6) by AM0PR10CA0076.outlook.office365.com (2603:10a6:208:15::29) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8989.11 via Frontend Transport; Tue, 29 Jul 2025 16:28:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by AM2PEPF0001C708.mail.protection.outlook.com (10.167.16.196) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8989.10 via Frontend Transport; Tue, 29 Jul 2025 16:28:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=oyl4Ck4O99Pk816uu/1AzEi7hhHaiidcqtJJiV5cW70jivGpKiCFjZ04g9xJ9nWc+OxaH6G5WmpmqkQIf5iRAwyhZmAxeKTKQOOMtyi60NDnBwfaAtY8pfGDwkZg0DLxNkt11I9JqSA67BOJSPeszkNfCkHuAmf/b9J7BOSU3YEsbLZbZCZcgvzxJHWDcvmvJrXgaL3odON/b2FW/VF4JJKo4sOocr9FIHcKNaB0m9Oc26C9dA8pM72ven46CpT1Yz5QiLacHV1EyDkg7/4xrsRulZ5mHMSXxrLFD2H2aYcq9XYrYccD/9SYWR3/qxecL8scvz9X6BeKrWGA43GL+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KBOWwrIUwrzvr7g820tNJt6p9N7PLgn7UH8akF46C08=; b=dDdjtTy2pJ3a6JLiu+c5Xv1QGkR/v7pYpVWDNWRH017456FpYMXVBzC1F+54v5a96/vQM17DELbw8dxS/XZ9sozT/MhQiGEvFAuXvV4Q37DoY0c+/WoEDT0XcatLI7LylIT+WfJ4/AMyw7bPDt9krCDOYTJcSnk25fGkhVDb1Y2wPysKhjY7WIwJ7e84Q5Jz9ae65wxQ4YnjxzckeMR6Gq1ZLfEVwwalhhgNh7Jb10e/gUlDMxWk1lA3iuJJR0gxlHU/aJ64/u25P39vuWSBuJfG6OXNjOuSBSeI7H9wO5K9Kuf2NIQBGpuK5z8wl4+MppTWqPQeW5pTFBoP3Qr64A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KBOWwrIUwrzvr7g820tNJt6p9N7PLgn7UH8akF46C08=; b=WxnuSto9M8zpX70Rpyz4wwt+IhaLinwaex69r11cdRwH71D8zgyUnznqKzGV6oc39cJdvCyOCf9Na5LWWgrrfjadKC0/TXvbr9tbLecbPn7sbpKpE213yZHwy3Y0WwzOo4tEosgvnZaJLt2GWLqmOfCBUzTlEoKTOmgKm69yGBU= Received: from PAWPR08MB8982.eurprd08.prod.outlook.com (2603:10a6:102:33f::20) by AS8PR08MB10151.eurprd08.prod.outlook.com (2603:10a6:20b:628::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8964.26; Tue, 29 Jul 2025 16:28:22 +0000 Received: from PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::b366:6358:236e:352d]) by PAWPR08MB8982.eurprd08.prod.outlook.com ([fe80::b366:6358:236e:352d%6]) with mapi id 15.20.8964.024; Tue, 29 Jul 2025 16:28:22 +0000 From: Wilco Dijkstra To: glibc developers Subject: [PATCH] malloc: Remove dumped heap support Thread-Topic: [PATCH] malloc: Remove dumped heap support Thread-Index: AQHcAKWnnoOpzIubh06vImxOXEbzZg== Date: Tue, 29 Jul 2025 16:28:22 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: PAWPR08MB8982:EE_|AS8PR08MB10151:EE_|AM2PEPF0001C708:EE_|DU0PR08MB8833:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ac33536-e069-4392-ca79-08ddcebd0378 x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; X-Microsoft-Antispam-Message-Info-Original: =?iso-8859-1?q?LsuATTP547ChTu450?= =?iso-8859-1?q?paXABlIQKveOAfZoeZcJJeeENM6H5wZv5zoaEMql2Xj9FUPy5sK9inYFPYbF?= =?iso-8859-1?q?RkqQROMJTG9rpCWekga+4Jl7zU/CLyZiXF3brwFPhukwQH2VNfXx+H4HFPa4?= =?iso-8859-1?q?ZSNH2y63zRshVH0sn/zCb+dwpyRyaf5oLcOPRgyDtZFi6+Gd9/D9rmzuy11G?= =?iso-8859-1?q?jJAuYOI5sadXee3KaCIggna+KbyASxqsUPyB3QzGybBz98ZdGgLjshM8suem?= =?iso-8859-1?q?GeoFPdIkAMk5avH9AvC67t/2PevEWoM4M44BqSp2veCDi9p776GNdGVWforW?= =?iso-8859-1?q?SH+SpQel1eczRJq8kTM8Nr5rip2Rm+yVufmonrl/XsT7AqJUzkMRGrw8YI+G?= =?iso-8859-1?q?GGa78Z6bkODHLrQPWSmJ9nrU5AWEPR5ml1ELbhgi3g9x8GjDJNAbHrVx+y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83IRcPUvpyG2uVXoMQfOPqBc4RZmRk7YEAASzxv6ERMDnARSAidEEXZQ?= =?iso-8859-1?q?PyjjnDNv93HGEHQWiyTF41jF5IZh2dN9OhBzdLz0kgaw34RTOkWqKEWNdmX1?= =?iso-8859-1?q?RDTMh1Yal9A6ZvduULqlmdks3EFhINUM36ZciMGvbUGt4kgXTLUbKsaW0Tgq?= =?iso-8859-1?q?xgeY68/XX20a7VVmBOISWwmcbN5vAXvXG7k99geq7hnyfgwdoc0k5uXuvQ?= =?iso-8859-1?q?=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAWPR08MB8982.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10151 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM2PEPF0001C708.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 563875e3-cf73-4e95-2422-08ddcebcefa3 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|35042699022|82310400026|376014|14060799003; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?q?jvN0VjxuR4PwMM0ZJiNBuwEpgP?= =?iso-8859-1?q?sGPvV8LQkzbL3JsoBVMERC4Aikclk80+8TB8aCeOiMvPdRmZ3yyzfYtozsud?= =?iso-8859-1?q?8R2PXswxgeyI+CnEAlfiB9UH5MJtY8B8tekehC3x2ExzWrJ3ha0zHUbCT/y4?= =?iso-8859-1?q?6T9+0afpJ5fHdrJOH0c6KAEMS1PARZa3tOy+cvqdEAw1y3IrjmC8viW98D6h?= =?iso-8859-1?q?VA0qPZBAS++xWFtsymDFkv+Y5lSOaLl74xyoDvOl489GwFYlAWE4VFIdL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36RaI2Akdw9CqElon22sZo2AOlG1DPH0/IFd8Vl/keUuL4KBjNu?= =?iso-8859-1?q?TlA35uhVuoCy7tAol3gmuw4+ReLdRlnEd5Hrmrmxt1wOo/CIOBq5ciI9GM5G?= =?iso-8859-1?q?ST3oEBnmSPSgDkvJnnd+yT+K89cTxNclpGLM2hjy7kF/KAQ6GYcm031V+2Ve?= =?iso-8859-1?q?U63Ng0FUIFUrJZLHOeqiYaj8MS8jLvjuM0XcSQashwFuhQiYe/qsjZ0lAagy?= =?iso-8859-1?q?Aq3U6pZJNVPOEjJe8nHdTc2/TaJtb1ImerJ+HHzBc5g3KDUMmdqWSirKhgvY?= =?iso-8859-1?q?S9lZorSUZ9/k8ywvwOnSijXPkIdUVCVdps/ScMJYQchLGK3yC94F9MCC8bcR?= =?iso-8859-1?q?oQUu691kIa21LhVVNJTxIZEWl52PnaP67UpsJBTWMqk/KJbsNA9HgkEattw1?= =?iso-8859-1?q?km8WuaElS1AanKJvd5aIt1hsP+1V4fLA=3D=3D?= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(35042699022)(82310400026)(376014)(14060799003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2025 16:28:55.8474 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0ac33536-e069-4392-ca79-08ddcebd0378 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C708.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8833 X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Remove support for obsolete dumped heaps. Dumping heaps was discontinued 8 years ago, however loading a dumped heap is still supported. This blocks changes and improvements of the malloc data structures - hence it is time to remove this. Ancient binaries that still call malloc_set_state will now get the -1 error code. Update tst-mallocstate.c to just check for this. Passes regress, OK for commit? diff --git a/malloc/malloc-debug.c b/malloc/malloc-debug.c index 8bcb5652e0d40cab49120dd8b98f4657bcd01f82..0bb57841eebb74cb8097577b2577f18d1be6442a 100644 --- a/malloc/malloc-debug.c +++ b/malloc/malloc-debug.c @@ -150,19 +150,6 @@ memalign_hook_ini (size_t alignment, size_t sz, const void *caller) static size_t pagesize; -/* These variables are used for undumping support. Chunked are marked - as using mmap, but we leave them alone if they fall into this - range. NB: The chunk size for these chunks only includes the - initial size field (of SIZE_SZ bytes), there is no trailing size - field (unlike with regular mmapped chunks). */ -static mchunkptr dumped_main_arena_start; /* Inclusive. */ -static mchunkptr dumped_main_arena_end; /* Exclusive. */ - -/* True if the pointer falls into the dumped arena. Use this after - chunk_is_mmapped indicates a chunk is mmapped. */ -#define DUMPED_MAIN_ARENA_CHUNK(p) \ - ((p) >= dumped_main_arena_start && (p) < dumped_main_arena_end) - /* The allocator functions. */ static void * @@ -202,9 +189,7 @@ __debug_free (void *mem) if (__is_malloc_debug_enabled (MALLOC_MCHECK_HOOK)) mem = free_mcheck (mem); - if (DUMPED_MAIN_ARENA_CHUNK (mem2chunk (mem))) - /* Do nothing. */; - else if (__is_malloc_debug_enabled (MALLOC_CHECK_HOOK)) + if (__is_malloc_debug_enabled (MALLOC_CHECK_HOOK)) free_check (mem); else __libc_free (mem); @@ -227,32 +212,7 @@ __debug_realloc (void *oldmem, size_t bytes) if ((!__is_malloc_debug_enabled (MALLOC_MCHECK_HOOK) || !realloc_mcheck_before (&oldmem, &bytes, &oldsize, &victim))) { - mchunkptr oldp = mem2chunk (oldmem); - - /* If this is a faked mmapped chunk from the dumped main arena, - always make a copy (and do not free the old chunk). */ - if (DUMPED_MAIN_ARENA_CHUNK (oldp)) - { - if (bytes == 0 && oldmem != NULL) - victim = NULL; - else - { - const INTERNAL_SIZE_T osize = chunksize (oldp); - /* Must alloc, copy, free. */ - victim = __debug_malloc (bytes); - /* Copy as many bytes as are available from the old chunk - and fit into the new size. NB: The overhead for faked - mmapped chunks is only SIZE_SZ, not CHUNK_HDR_SZ as for - regular mmapped chunks. */ - if (victim != NULL) - { - if (bytes > osize - SIZE_SZ) - bytes = osize - SIZE_SZ; - memcpy (victim, oldmem, bytes); - } - } - } - else if (__is_malloc_debug_enabled (MALLOC_CHECK_HOOK)) + if (__is_malloc_debug_enabled (MALLOC_CHECK_HOOK)) victim = realloc_check (oldmem, bytes); else victim = __libc_realloc (oldmem, bytes); @@ -414,10 +374,6 @@ malloc_usable_size (void *mem) if (__is_malloc_debug_enabled (MALLOC_CHECK_HOOK)) return malloc_check_get_size (mem); - mchunkptr p = mem2chunk (mem); - if (DUMPED_MAIN_ARENA_CHUNK (p)) - return chunksize (p) - SIZE_SZ; - return musable (mem); } @@ -517,43 +473,10 @@ malloc_trim (size_t s) #if SHLIB_COMPAT (libc_malloc_debug, GLIBC_2_0, GLIBC_2_25) -/* Support for restoring dumped heaps contained in historic Emacs - executables. The heap saving feature (malloc_get_state) is no - longer implemented in this version of glibc, but we have a heap - rewriter in malloc_set_state which transforms the heap into a - version compatible with current malloc. */ - -#define MALLOC_STATE_MAGIC 0x444c4541l -#define MALLOC_STATE_VERSION (0 * 0x100l + 5l) /* major*0x100 + minor */ - -struct malloc_save_state -{ - long magic; - long version; - mbinptr av[NBINS * 2 + 2]; - char *sbrk_base; - int sbrked_mem_bytes; - unsigned long trim_threshold; - unsigned long top_pad; - unsigned int n_mmaps_max; - unsigned long mmap_threshold; - int check_action; - unsigned long max_sbrked_mem; - unsigned long max_total_mem; /* Always 0, for backwards compatibility. */ - unsigned int n_mmaps; - unsigned int max_n_mmaps; - unsigned long mmapped_mem; - unsigned long max_mmapped_mem; - int using_malloc_checking; - unsigned long max_fast; - unsigned long arena_test; - unsigned long arena_max; - unsigned long narenas; -}; - -/* Dummy implementation which always fails. We need to provide this - symbol so that existing Emacs binaries continue to work with - BIND_NOW. */ +/* Support for saving/restoring dumped heaps in old GLIBCs is no + longer implemented - instead we provide dummy implementations + which always fail. We need to provide these symbol so that + existing Emacs binaries continue to work with BIND_NOW. */ void * malloc_get_state (void) { @@ -566,81 +489,7 @@ compat_symbol (libc_malloc_debug, malloc_get_state, malloc_get_state, int malloc_set_state (void *msptr) { - struct malloc_save_state *ms = (struct malloc_save_state *) msptr; - - if (ms->magic != MALLOC_STATE_MAGIC) - return -1; - - /* Must fail if the major version is too high. */ - if ((ms->version & ~0xffl) > (MALLOC_STATE_VERSION & ~0xffl)) - return -2; - - if (debug_initialized == 1) - return -1; - - bool check_was_enabled = __is_malloc_debug_enabled (MALLOC_CHECK_HOOK); - - /* It's not too late, so disable MALLOC_CHECK_ and all of the hooks. */ - __malloc_hook = NULL; - __realloc_hook = NULL; - __free_hook = NULL; - __memalign_hook = NULL; - __malloc_debug_disable (MALLOC_CHECK_HOOK); - - /* We do not need to perform locking here because malloc_set_state - must be called before the first call into the malloc subsystem (usually via - __malloc_initialize_hook). pthread_create always calls calloc and thus - must be called only afterwards, so there cannot be more than one thread - when we reach this point. Also handle initialization if either we ended - up being called before the first malloc or through the hook when - malloc-check was enabled. */ - if (debug_initialized < 0) - generic_hook_ini (); - else if (check_was_enabled) - __libc_free (__libc_malloc (0)); - - /* Patch the dumped heap. We no longer try to integrate into the - existing heap. Instead, we mark the existing chunks as mmapped. - Together with the update to dumped_main_arena_start and - dumped_main_arena_end, realloc and free will recognize these - chunks as dumped fake mmapped chunks and never free them. */ - - /* Find the chunk with the lowest address with the heap. */ - mchunkptr chunk = NULL; - { - size_t *candidate = (size_t *) ms->sbrk_base; - size_t *end = (size_t *) (ms->sbrk_base + ms->sbrked_mem_bytes); - while (candidate < end) - if (*candidate != 0) - { - chunk = mem2chunk ((void *) (candidate + 1)); - break; - } - else - ++candidate; - } - if (chunk == NULL) - return 0; - - /* Iterate over the dumped heap and patch the chunks so that they - are treated as fake mmapped chunks. */ - mchunkptr top = ms->av[2]; - while (chunk < top) - { - if (inuse (chunk)) - { - /* Mark chunk as mmapped, to trigger the fallback path. */ - size_t size = chunksize (chunk); - set_head (chunk, size | IS_MMAPPED); - } - chunk = next_chunk (chunk); - } - - /* The dumped fake mmapped chunks all lie in this address range. */ - dumped_main_arena_start = (mchunkptr) ms->sbrk_base; - dumped_main_arena_end = top; - - return 0; + return -1; } compat_symbol (libc_malloc_debug, malloc_set_state, malloc_set_state, GLIBC_2_0); diff --git a/malloc/tst-mallocstate.c b/malloc/tst-mallocstate.c index ccfa055ab0fdf5d9e0d2b1085fcf93f71b53c599..5428d20db2bbc9453a497f6ca7d04a9709f23f19 100644 --- a/malloc/tst-mallocstate.c +++ b/malloc/tst-mallocstate.c @@ -17,7 +17,6 @@ . */ #include -#include #include #include #include @@ -34,36 +33,8 @@ compat_symbol_reference (libc, malloc_get_state, malloc_get_state, GLIBC_2_0); int malloc_set_state (void *); compat_symbol_reference (libc, malloc_set_state, malloc_set_state, GLIBC_2_0); -/* Maximum object size in the fake heap. */ -enum { max_size = 64 }; +#define NBINS 128 -/* Allocation actions. These are randomized actions executed on the - dumped heap (see allocation_tasks below). They are interspersed - with operations on the new heap (see heap_activity). */ -enum allocation_action - { - action_free, /* Dumped and freed. */ - action_realloc, /* Dumped and realloc'ed. */ - action_realloc_same, /* Dumped and realloc'ed, same size. */ - action_realloc_smaller, /* Dumped and realloc'ed, shrunk. */ - action_count - }; - -/* Dumped heap. Initialize it, so that the object is placed into the - .data section, for increased realism. The size is an upper bound; - we use about half of the space. */ -static size_t dumped_heap[action_count * max_size * max_size - / sizeof (size_t)] = {1}; - -/* Next free space in the dumped heap. Also top of the heap at the - end of the initialization procedure. */ -static size_t *next_heap_chunk; - -/* Copied from malloc.c and hooks.c. The version is deliberately - lower than the final version of malloc_set_state. */ -# define NBINS 128 -# define MALLOC_STATE_MAGIC 0x444c4541l -# define MALLOC_STATE_VERSION (0 * 0x100l + 4l) static struct { long magic; @@ -87,407 +58,20 @@ static struct unsigned long arena_test; unsigned long arena_max; unsigned long narenas; -} save_state = - { - .magic = MALLOC_STATE_MAGIC, - .version = MALLOC_STATE_VERSION, - }; - -/* Allocate a blob in the fake heap. */ -static void * -dumped_heap_alloc (size_t length) -{ - /* malloc needs three state bits in the size field, so the minimum - alignment is 8 even on 32-bit architectures. malloc_set_state - should be compatible with such heaps even if it currently - provides more alignment to applications. */ - enum - { - heap_alignment = 8, - heap_alignment_mask = heap_alignment - 1 - }; - _Static_assert (sizeof (size_t) <= heap_alignment, - "size_t compatible with heap alignment"); - - /* Need at least this many bytes for metadata and application - data. */ - size_t chunk_size = sizeof (size_t) + length; - /* Round up the allocation size to the heap alignment. */ - chunk_size += heap_alignment_mask; - chunk_size &= ~heap_alignment_mask; - TEST_VERIFY_EXIT ((chunk_size & 3) == 0); - if (next_heap_chunk == NULL) - /* Initialize the top of the heap. Add one word of zero padding, - to match existing practice. */ - { - dumped_heap[0] = 0; - next_heap_chunk = dumped_heap + 1; - } - else - /* The previous chunk is allocated. */ - chunk_size |= 1; - *next_heap_chunk = chunk_size; - - /* User data starts after the chunk header. */ - void *result = next_heap_chunk + 1; - next_heap_chunk += chunk_size / sizeof (size_t); - - /* Mark the previous chunk as used. */ - *next_heap_chunk = 1; - return result; -} - -/* Global seed variable for the random number generator. */ -static unsigned long long global_seed; - -/* Simple random number generator. The numbers are in the range from - 0 to UINT_MAX (inclusive). */ -static unsigned int -rand_next (unsigned long long *seed) -{ - /* Linear congruential generated as used for MMIX. */ - *seed = *seed * 6364136223846793005ULL + 1442695040888963407ULL; - return *seed >> 32; -} - -/* Fill LENGTH bytes at BUFFER with random contents, as determined by - SEED. */ -static void -randomize_buffer (unsigned char *buffer, size_t length, - unsigned long long seed) -{ - for (size_t i = 0; i < length; ++i) - buffer[i] = rand_next (&seed); -} - -/* Dumps the buffer to standard output, in hexadecimal. */ -static void -dump_hex (unsigned char *buffer, size_t length) -{ - for (int i = 0; i < length; ++i) - printf (" %02X", buffer[i]); -} - -/* Set to true if an error is encountered. */ -static bool errors = false; - -/* Keep track of object allocations. */ -struct allocation -{ - unsigned char *data; - unsigned int size; - unsigned int seed; -}; - -/* Check that the allocation task allocation has the expected - contents. */ -static void -check_allocation (const struct allocation *alloc, int index) -{ - size_t size = alloc->size; - if (alloc->data == NULL) - { - printf ("error: NULL pointer for allocation of size %zu at %d, seed %u\n", - size, index, alloc->seed); - errors = true; - return; - } - - unsigned char expected[4096]; - if (size > sizeof (expected)) - { - printf ("error: invalid allocation size %zu at %d, seed %u\n", - size, index, alloc->seed); - errors = true; - return; - } - randomize_buffer (expected, size, alloc->seed); - if (memcmp (alloc->data, expected, size) != 0) - { - printf ("error: allocation %d data mismatch, size %zu, seed %u\n", - index, size, alloc->seed); - printf (" expected:"); - dump_hex (expected, size); - putc ('\n', stdout); - printf (" actual:"); - dump_hex (alloc->data, size); - putc ('\n', stdout); - errors = true; - } -} - -/* A heap allocation combined with pending actions on it. */ -struct allocation_task -{ - struct allocation allocation; - enum allocation_action action; -}; - -/* Allocation tasks. Initialized by init_allocation_tasks and used by - perform_allocations. */ -enum { allocation_task_count = action_count * max_size }; -static struct allocation_task allocation_tasks[allocation_task_count]; - -/* Fisher-Yates shuffle of allocation_tasks. */ -static void -shuffle_allocation_tasks (void) -{ - for (int i = 0; i < allocation_task_count - 1; ++i) - { - /* Pick pair in the tail of the array. */ - int j = i + (rand_next (&global_seed) - % ((unsigned) (allocation_task_count - i))); - TEST_VERIFY_EXIT (j >= 0 && j < allocation_task_count); - /* Exchange. */ - struct allocation_task tmp = allocation_tasks[i]; - allocation_tasks[i] = allocation_tasks[j]; - allocation_tasks[j] = tmp; - } -} - -/* Set up the allocation tasks and the dumped heap. */ -static void -initial_allocations (void) -{ - /* Initialize in a position-dependent way. */ - for (int i = 0; i < allocation_task_count; ++i) - allocation_tasks[i] = (struct allocation_task) - { - .allocation = - { - .size = 1 + (i / action_count), - .seed = i, - }, - .action = i % action_count - }; - - /* Execute the tasks in a random order. */ - shuffle_allocation_tasks (); - - /* Initialize the contents of the dumped heap. */ - for (int i = 0; i < allocation_task_count; ++i) - { - struct allocation_task *task = allocation_tasks + i; - task->allocation.data = dumped_heap_alloc (task->allocation.size); - randomize_buffer (task->allocation.data, task->allocation.size, - task->allocation.seed); - } - - for (int i = 0; i < allocation_task_count; ++i) - check_allocation (&allocation_tasks[i].allocation, i); -} - -/* Indicates whether init_heap has run. This variable needs to be - volatile because malloc is declared __THROW, which implies it is a - leaf function, but we expect it to run our hooks. */ -static volatile bool heap_initialized; - -/* Executed by glibc malloc, through __malloc_initialize_hook - below. */ -static void -init_heap (void) -{ - if (test_verbose) - printf ("info: performing heap initialization\n"); - heap_initialized = true; - - /* Populate the dumped heap. */ - initial_allocations (); - - /* Complete initialization of the saved heap data structure. */ - save_state.sbrk_base = (void *) dumped_heap; - save_state.sbrked_mem_bytes = sizeof (dumped_heap); - /* Top pointer. Adjust so that it points to the start of struct - malloc_chunk. */ - save_state.av[2] = (void *) (next_heap_chunk - 1); - - /* Integrate the dumped heap into the process heap. */ - TEST_VERIFY_EXIT (malloc_set_state (&save_state) == 0); -} - -/* Interpose the initialization callback. */ -void (*volatile __malloc_initialize_hook) (void) = init_heap; -compat_symbol_reference (libc, __malloc_initialize_hook, - __malloc_initialize_hook, GLIBC_2_0); - -/* Simulate occasional unrelated heap activity in the non-dumped - heap. */ -enum { heap_activity_allocations_count = 32 }; -static struct allocation heap_activity_allocations - [heap_activity_allocations_count] = {}; -static int heap_activity_seed_counter = 1000 * 1000; - -static void -heap_activity (void) -{ - /* Only do this from time to time. */ - if ((rand_next (&global_seed) % 4) == 0) - { - int slot = rand_next (&global_seed) % heap_activity_allocations_count; - struct allocation *alloc = heap_activity_allocations + slot; - if (alloc->data == NULL) - { - alloc->size = rand_next (&global_seed) % (4096U + 1); - alloc->data = xmalloc (alloc->size); - alloc->seed = heap_activity_seed_counter++; - randomize_buffer (alloc->data, alloc->size, alloc->seed); - check_allocation (alloc, 1000 + slot); - } - else - { - check_allocation (alloc, 1000 + slot); - free (alloc->data); - alloc->data = NULL; - } - } -} - -static void -heap_activity_deallocate (void) -{ - for (int i = 0; i < heap_activity_allocations_count; ++i) - free (heap_activity_allocations[i].data); -} - -/* Perform a full heap check across the dumped heap allocation tasks, - and the simulated heap activity directly above. */ -static void -full_heap_check (void) -{ - /* Dumped heap. */ - for (int i = 0; i < allocation_task_count; ++i) - if (allocation_tasks[i].allocation.data != NULL) - check_allocation (&allocation_tasks[i].allocation, i); - - /* Heap activity allocations. */ - for (int i = 0; i < heap_activity_allocations_count; ++i) - if (heap_activity_allocations[i].data != NULL) - check_allocation (heap_activity_allocations + i, i); -} - -/* Used as an optimization barrier to force a heap allocation. */ -__attribute_optimization_barrier__ -static void -my_free (void *ptr) -{ - free (ptr); -} +} save_state; static int do_test (void) { - my_free (malloc (1)); - TEST_VERIFY_EXIT (heap_initialized); - - /* The first pass performs the randomly generated allocation - tasks. */ - if (test_verbose) - printf ("info: first pass through allocation tasks\n"); - full_heap_check (); - - /* Execute the post-undump tasks in a random order. */ - shuffle_allocation_tasks (); - - for (int i = 0; i < allocation_task_count; ++i) - { - heap_activity (); - struct allocation_task *task = allocation_tasks + i; - switch (task->action) - { - case action_free: - check_allocation (&task->allocation, i); - free (task->allocation.data); - task->allocation.data = NULL; - break; - - case action_realloc: - check_allocation (&task->allocation, i); - task->allocation.data = xrealloc - (task->allocation.data, task->allocation.size + max_size); - check_allocation (&task->allocation, i); - break; + /* Check the dummy implementations always fail. */ + TEST_VERIFY_EXIT (malloc_set_state (&save_state) == -1); - case action_realloc_same: - check_allocation (&task->allocation, i); - task->allocation.data = xrealloc - (task->allocation.data, task->allocation.size); - check_allocation (&task->allocation, i); - break; - - case action_realloc_smaller: - check_allocation (&task->allocation, i); - size_t new_size = task->allocation.size - 1; - task->allocation.data = xrealloc (task->allocation.data, new_size); - if (new_size == 0) - { - if (task->allocation.data != NULL) - { - printf ("error: realloc with size zero did not deallocate\n"); - errors = true; - } - /* No further action on this task. */ - task->action = action_free; - } - else - { - task->allocation.size = new_size; - check_allocation (&task->allocation, i); - } - break; - - case action_count: - FAIL_EXIT1 ("task->action should never be action_count"); - } - full_heap_check (); - } - - /* The second pass frees the objects which were allocated during the - first pass. */ - if (test_verbose) - printf ("info: second pass through allocation tasks\n"); - - shuffle_allocation_tasks (); - for (int i = 0; i < allocation_task_count; ++i) - { - heap_activity (); - struct allocation_task *task = allocation_tasks + i; - switch (task->action) - { - case action_free: - /* Already freed, nothing to do. */ - break; - - case action_realloc: - case action_realloc_same: - case action_realloc_smaller: - check_allocation (&task->allocation, i); - free (task->allocation.data); - task->allocation.data = NULL; - break; - - case action_count: - FAIL_EXIT1 ("task->action should never be action_count"); - } - full_heap_check (); - } - - heap_activity_deallocate (); - - /* Check that the malloc_get_state stub behaves in the intended - way. */ errno = 0; - if (malloc_get_state () != NULL) - { - printf ("error: malloc_get_state succeeded\n"); - errors = true; - } - if (errno != ENOSYS) - { - printf ("error: malloc_get_state: %m\n"); - errors = true; - } + TEST_VERIFY_EXIT (malloc_get_state () == NULL); + + TEST_VERIFY_EXIT (errno == ENOSYS); - return errors; + return 0; } #include