Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/808234/?format=api
{ "id": 808234, "url": "http://patchwork.ozlabs.org/api/patches/808234/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20170831130210.9520943994318@oldenburg.str.redhat.com/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170831130210.9520943994318@oldenburg.str.redhat.com>", "list_archive_url": null, "date": "2017-08-31T13:02:10", "name": "malloc: Resolve compilation failure in NDEBUG mode", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "cb644dc81fb1501ac5876ade2d36a0ed3a3c8116", "submitter": { "id": 14312, "url": "http://patchwork.ozlabs.org/api/people/14312/?format=api", "name": "Florian Weimer", "email": "fweimer@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20170831130210.9520943994318@oldenburg.str.redhat.com/mbox/", "series": [ { "id": 821, "url": "http://patchwork.ozlabs.org/api/series/821/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=821", "date": "2017-08-31T13:02:10", "name": "malloc: Resolve compilation failure in NDEBUG mode", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/821/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/808234/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/808234/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-return-83915-incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "mailing list libc-alpha@sourceware.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-83915-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"DSFHuHVx\"; dkim-atps=neutral", "sourceware.org; auth=none", "ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=fweimer@redhat.com" ], "Received": [ "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjjFw6f0cz9sMN\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 23:02:28 +1000 (AEST)", "(qmail 31360 invoked by alias); 31 Aug 2017 13:02:23 -0000", "(qmail 30139 invoked by uid 89); 31 Aug 2017 13:02:22 -0000" ], "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:to:subject:mime-version:content-type\n\t:content-transfer-encoding:message-id:from; q=dns; s=default; b=\n\tcaOiPajcvokS+PZFNq5wqotXUe5HstysEGQWGcqAQTLHq0jLtGF9iR8LaH2N29sl\n\tatEyhhT52I6Hh1nitWvbfR+T9BhcVuup3osFel+/ab2BzsnXhgEEvH83YaYXCGHn\n\tJ9trXTth88V/BPnG/lLTXTMud4qooCiLPKV9g8KduaU=", "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:to:subject:mime-version:content-type\n\t:content-transfer-encoding:message-id:from; s=default; bh=oxbw5E\n\tBC1CpDbBKrwv0odaROpVc=; b=DSFHuHVxPYarqXSzqYyawt5P1I8opfHG6M2pvo\n\ts3q1QP7Sa3+7BAc7AnVmRk1qHjIgeUJagYuczxpv9TLjJxSiSi0/Cja6HYyDkePe\n\tK0ZVay5w6D73vPN7DuoSUpRWfIBHM+JhQ/foEEWnXjv9WlCrmvkNQHzRMF2P2wKu\n\tqvQgs=", "Mailing-List": "contact libc-alpha-help@sourceware.org; run by ezmlm", "Precedence": "bulk", "List-Id": "<libc-alpha.sourceware.org>", "List-Unsubscribe": "<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>", "List-Subscribe": "<mailto:libc-alpha-subscribe@sourceware.org>", "List-Archive": "<http://sourceware.org/ml/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>", "Sender": "libc-alpha-owner@sourceware.org", "X-Virus-Found": "No", "X-Spam-SWARE-Status": "No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0,\n\tGIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD,\n\tSPF_HELO_PASS autolearn=ham version=3.3.2 spammy=hurt", "X-HELO": "mx1.redhat.com", "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 8A14491FEA", "Date": "Thu, 31 Aug 2017 15:02:10 +0200", "To": "libc-alpha@sourceware.org", "Subject": "[PATCH] malloc: Resolve compilation failure in NDEBUG mode", "User-Agent": "Heirloom mailx 12.5 7/5/10", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=us-ascii", "Content-Transfer-Encoding": "7bit", "Message-Id": "<20170831130210.9520943994318@oldenburg.str.redhat.com>", "From": "fweimer@redhat.com (Florian Weimer)" }, "content": "In _int_free, the locked variable is not used if NDEBUG is defined.\n\n2017-08-31 Florian Weimer <fweimer@redhat.com>\n\n\t* malloc/malloc.c (_int_free): Remove locked variable and related\n\tasserts.", "diff": "diff --git a/malloc/malloc.c b/malloc/malloc.c\nindex 768670ccf6..e1159a5bce 100644\n--- a/malloc/malloc.c\n+++ b/malloc/malloc.c\n@@ -4106,8 +4106,6 @@ _int_free (mstate av, mchunkptr p, int have_lock)\n mchunkptr bck; /* misc temp for linking */\n mchunkptr fwd; /* misc temp for linking */\n \n- int locked = 0;\n-\n size = chunksize (p);\n \n /* Little security check which won't hurt performance: the\n@@ -4162,19 +4160,14 @@ _int_free (mstate av, mchunkptr p, int have_lock)\n \t/* We might not have a lock at this point and concurrent modifications\n \t of system_mem might have let to a false positive. Redo the test\n \t after getting the lock. */\n-\tif (have_lock\n-\t || ({ assert (locked == 0);\n-\t\t __libc_lock_lock (av->mutex);\n-\t\t locked = 1;\n+\tif (!have_lock\n+\t || ({ __libc_lock_lock (av->mutex);\n \t\t chunksize_nomask (chunk_at_offset (p, size)) <= 2 * SIZE_SZ\n-\t\t || chunksize (chunk_at_offset (p, size)) >= av->system_mem;\n-\t }))\n+\t\t || chunksize (chunk_at_offset (p, size)) >= av->system_mem;\n+\t }))\n \t malloc_printerr (\"free(): invalid next size (fast)\");\n \tif (! have_lock)\n-\t {\n-\t __libc_lock_unlock (av->mutex);\n-\t locked = 0;\n-\t }\n+\t __libc_lock_unlock (av->mutex);\n }\n \n free_perturb (chunk2mem(p), size - 2 * SIZE_SZ);\n@@ -4211,10 +4204,8 @@ _int_free (mstate av, mchunkptr p, int have_lock)\n */\n \n else if (!chunk_is_mmapped(p)) {\n- if (! have_lock) {\n+ if (!have_lock)\n __libc_lock_lock (av->mutex);\n- locked = 1;\n- }\n \n nextchunk = chunk_at_offset(p, size);\n \n@@ -4328,10 +4319,8 @@ _int_free (mstate av, mchunkptr p, int have_lock)\n }\n }\n \n- if (! have_lock) {\n- assert (locked);\n+ if (!have_lock)\n __libc_lock_unlock (av->mutex);\n- }\n }\n /*\n If the chunk was allocated via mmap, release via munmap().\n", "prefixes": [] }