Message ID | 20230324133625.450723-1-nick.alcock@oracle.com |
---|---|
State | Repeat Merge |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp631084vqo; Fri, 24 Mar 2023 06:37:00 -0700 (PDT) X-Google-Smtp-Source: AKy350bEWU2ReHBy9VZmYSzGkDSJRTi7ZUgiORmyBQWMfwquuFeh+baPXknmW3QnU9ojdY04rS8x X-Received: by 2002:a17:907:170d:b0:92f:f2cc:93 with SMTP id le13-20020a170907170d00b0092ff2cc0093mr2719268ejc.22.1679665020397; Fri, 24 Mar 2023 06:37:00 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id gx10-20020a170906f1ca00b008cc93fd1626si20778216ejb.954.2023.03.24.06.37.00 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Mar 2023 06:37:00 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=MH0EPomC; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8698B387688D for <ouuuleilei@gmail.com>; Fri, 24 Mar 2023 13:36:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8698B387688D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679665004; bh=2pVPIu7UDXMN7wkLRonoPzrjKV+8Zlp0M2+4lmBKe0M=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=MH0EPomC/XguqEt3lLVzjMxHRq2BKgTF8BFg2hvyg1/cetoAqdQ6ZuvMj73s/muFi 94ssxxlgtaJO9XGpLqzr4WZOfVwJomA8yWr8Yi96SWpq8KVi8AvLrNaV5FwWPPXHKR 27g4lRk0zDdy045efNYWzjBCtO+RPB0LojURV6jU= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id DC9F538708F3 for <binutils@sourceware.org>; Fri, 24 Mar 2023 13:36:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC9F538708F3 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32ODJmFQ004625 for <binutils@sourceware.org>; Fri, 24 Mar 2023 13:36:36 GMT Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3phcn181vb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <binutils@sourceware.org>; Fri, 24 Mar 2023 13:36:36 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 32OCn8RQ001643 for <binutils@sourceware.org>; Fri, 24 Mar 2023 13:36:35 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2173.outbound.protection.outlook.com [104.47.73.173]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3pgxk42144-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for <binutils@sourceware.org>; Fri, 24 Mar 2023 13:36:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NrbJG7wJgFcgcXHqPOBe0EzgWwaOvoxYCGNXUcDoRJG+KAACYybhZpBk+llxUsmrc59Ldcnjx4Dz7V0IHAu868IRDddTIOr3W/xZ30PDvTK9PDCMG/lmDbUrn6yd9wcnfF+LCfK7O7VwEvxuiWfYXzzDr9Uai9zugbfsrqZkXyMVtCbDZtmTWHcDjqGweSTJG2eM2rs4+7/asd1YmNKmxn4wv7Y80DUjxnefTuoSM8puJBuIgq/uVYyWYiMTuNKcPtPTfu5Hx3D2ZDpkjpYK6VIbCuK976wo4POToxfndCbkcgy0/UlTDvA7ZrjlDTCL1mStUe5xC5JVpaGyTXavug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=2pVPIu7UDXMN7wkLRonoPzrjKV+8Zlp0M2+4lmBKe0M=; b=Vt4Iy/j+t0RadmgOMsl1gZQciBJ1U9ScbW8+gYtnxXwKW6tN8XX9RoW7p/mhTUW9pTKK+uW6lEtL4VTxaMyngQJD50BlQWmjmK3ZUvHlmWZDtgiwIRCZSs7nmUest0E10jRB5sPViCWALXlI9/9MUL0NdBtaMVz8PbtwIrNSEqonBGgNeFDO55UqnB5yN3nmKChNA/S8ZoA1Zgfbwm3AhfUUk+4S8BuVWfp45TSAD+DtaGeI7kYDPA5n/8pKRKAcn/B+2EEg1GhVkgW3282CQ//d9YIGz+bkp1E23yIfl20Z81MIPW67+2Z4LFfwu+bij44T7Apz/zzxWOMvZ8cUVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from DS0PR10MB6798.namprd10.prod.outlook.com (2603:10b6:8:13c::20) by BY5PR10MB4257.namprd10.prod.outlook.com (2603:10b6:a03:211::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Fri, 24 Mar 2023 13:36:33 +0000 Received: from DS0PR10MB6798.namprd10.prod.outlook.com ([fe80::d0f7:e4fd:bd4:b760]) by DS0PR10MB6798.namprd10.prod.outlook.com ([fe80::d0f7:e4fd:bd4:b760%3]) with mapi id 15.20.6178.038; Fri, 24 Mar 2023 13:36:33 +0000 To: binutils@sourceware.org Subject: [PATCH 1/4] libctf: fix assertion failure with no system qsort_r Date: Fri, 24 Mar 2023 13:36:22 +0000 Message-Id: <20230324133625.450723-1-nick.alcock@oracle.com> X-Mailer: git-send-email 2.39.1.268.g9de2f9a303 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: LO2P123CA0039.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600::27) To DS0PR10MB6798.namprd10.prod.outlook.com (2603:10b6:8:13c::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR10MB6798:EE_|BY5PR10MB4257:EE_ X-MS-Office365-Filtering-Correlation-Id: 65db8876-a680-4865-3b8a-08db2c6cc846 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uzI9+EldSFyKtHkPmp3AvxvXdib1GdRL+kZ3RdsnbHzzNQc8ZcH7G8qCwV6iZyy2D6EQksNPdMvnHPCRmKEWlkeqAaSg9UecJPAFz3HOhGyqOBzw+pVZGdXzn3UdkMv0aGUxdeNW52gIQhCASqabfkb3p3PhLqJhzppgdqoEN+yOICwgyXSp55S0yxM0XAB2tXOzCo43luxqdPHIjXeUE1iBKQ3wjdrm4zEerzlLFlk0y82bilek+CQlTw22wCVXItWvK9sFzS6sqy/BTP5foP7n8HIlK4/+OX0OSdlZ+6+LH9WIg/9G+gAeLFvisbJeXa7QQCivSqewEXDQSXADOOYVrBKXlmWY5y39u7eB1KAAKy+ONm8OdY4ul1OKpVB2gyRr3cn6Jwj5usMpq+e43+NKzaNsvUiNTd8ETBC4LH6dxG9I+XS1rL+UhpVVqDWh4pXpwf3l0BlCqdESWsOGp3TcvLiD8pUDx0qv0fFPRKr7MLcpxNWo3VYnibkQMfsJYIXY0MDYzvaWK+h/c6SOKGoxUhNX+yU1beNrrxaS0jOClaa1W3Ap++YREkqhDuCeEDMDgZXdlM2A8m7do1TDLCU+R+yEWYwH1UHBxrifbVluakUGItZk9CSEKE0KMI8IbK2tQ0ZINZjnsHXymt0RAA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR10MB6798.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(376002)(136003)(396003)(366004)(346002)(39860400002)(451199018)(2906002)(38100700002)(478600001)(83380400001)(6486002)(186003)(2616005)(36756003)(86362001)(316002)(66946007)(66476007)(8676002)(5660300002)(66556008)(6666004)(6916009)(8936002)(1076003)(6506007)(6512007)(44832011)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k08gAvGBxkNrXmH4Deuq74cm/GT8dEiH4A02+w77onQBw3z5oqwkz3QnvA/gQWf5wYxVwu6+bh34ATo6efmDTx0p1uhT6fw7BCqobPuwN//37sGAL8Qn2JqBr3MU8nXVrDn0X25DNquzAF5/rYSTgFxTOCY3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NSDEIS9LCibZYPm21CGxLsnvJ74XZtsR066aOItJ98abCxR2/i3LeB/RdjneFRMnaUt1VZsJjfuIEWMtTD+g8EjIzMvIq83LPG04VvC0x4NGMkjOeShu19yT8KGspuNIcUy391jLgEDSs+4yaiMbSWQr3DUnvb7se0s5eaa7FY/5Saq8+88VFdGW3o5tT4aDC3GXAtZSdSi/l0PrWg8WQAC+gjHkursiR1ny+6M1BNc0QK4PktNbRRAGugD4FanUHLEgNwVUXfVyruZbcVzQoQpM26vgJDy2QgBUVZyEmJS/qXj5QuvS0er2DRk/zUrXGuz8uSacul+xzUzNaPQpFhiGuXil4ikl7TjqWgZrJtIObqA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: chlGt1CZ7rTpCj6BauYGiwVUsdb4L0IOS0fgn1OmFFHlQCKmPIF9t2p8kgFHLGTd8xYcUbIAf1+7l0eClI6UPl9tRWfdixhEf0kdBNJ4ea7DZO25msNelF1K8LxXVEzh2i+hUpCfomiO/gIJoxnj3hjGo661hh0WDdV7HSCgPbpNSyIenmWxmwqU+gMYE0WsPC6Z88A2HE4rnx0xRlOjvtTHptauFSmeH9WvNYuwAUP0wvePM9UC4R4jFfJz34Nq53yK2Q3EfkVjs/XxkOKFy8cuziBUcCAB6f8Bw5E88MGOQVIkX1rjefYdmhupx5TREgivTsfjRDngDLec0y2fLTaSDtNwByBdhGM1zKcHqGu8aQqEExJN28AgNaBVZAGsyWgn0RjxJ45DndEbnc7Njdmdl4zqSfTfOm+rMD9KH0dx1xnhm4bwIWWYYo5uVTpsX/YFbEf32xry6m8XxIPhdskPZPfbJ3GMAgx7N5SwBuVde3FF8yRyMtzA2LCSudeIqz7w5rxSvlKz3KeR/f7oA+2/9mB+D6VwPHzvfQN09WdksX46mly2dCf4kNJvFG51UxTFd3r+rBSUeaACiRmUuJg29nHqSPzsXFea5zYD0DqDb7DUKFGAOn3joomU/O29tRefAMnRnuqNQOtN1j5okuVrKiQ1At3MmkxCQeg/g4nqVi4yjcLuTySBsY6ITti6/A7J4QO9+sjDoXoDd6gY+wGc8bPr1/FHBPzhE0hheuOQpICCWmY1b/6yZ30tB0aT X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65db8876-a680-4865-3b8a-08db2c6cc846 X-MS-Exchange-CrossTenant-AuthSource: DS0PR10MB6798.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2023 13:36:33.2599 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wv4S6TPk8izArZu4g+uhaR2hJq6uYgLi3V3NN06fX7azQdGG+h0RUXFdzI+EbE1GKlXChjGW/hsZl9Gqxo3Ogg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4257 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_08,2023-03-24_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303240109 X-Proofpoint-ORIG-GUID: cAknOahoTexycSIHeTuIdITyF_5tLTCw X-Proofpoint-GUID: cAknOahoTexycSIHeTuIdITyF_5tLTCw X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> From: Nick Alcock via Binutils <binutils@sourceware.org> Reply-To: Nick Alcock <nick.alcock@oracle.com> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761256428220443664?= X-GMAIL-MSGID: =?utf-8?q?1761256428220443664?= |
Series |
[1/4] libctf: fix assertion failure with no system qsort_r
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | warning | Git am fail log |
Commit Message
Nick Alcock
March 24, 2023, 1:36 p.m. UTC
If no suitable qsort_r is found in libc, we fall back to an implementation in ctf-qsort.c. But this implementation routinely calls the comparison function with two identical arguments. The comparison function that ensures that the order of output types is stable is not ready for this, misinterprets it as a type appearing more that once (a can-never-happen condition) and fails with an assertion failure. Fixed, audited for further instances of the same failure (none found) and added a no-qsort test to my regular testsuite run. libctf/: PR libctf/30013 * ctf-dedup.c (sort_output_mapping): Inputs are always equal to themselves. --- libctf/ctf-dedup.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/libctf/ctf-dedup.c b/libctf/ctf-dedup.c index c46f69e7449..6297c45c84d 100644 --- a/libctf/ctf-dedup.c +++ b/libctf/ctf-dedup.c @@ -2306,6 +2306,10 @@ sort_output_mapping (const ctf_next_hkv_t *one, const ctf_next_hkv_t *two, ctf_id_t one_type; ctf_id_t two_type; + /* Inputs are always equal to themselves. */ + if (one == two) + return 0; + one_gid = ctf_dynhash_lookup (d->cd_output_first_gid, one_hval); two_gid = ctf_dynhash_lookup (d->cd_output_first_gid, two_hval);