From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id BF25B3858C36 for ; Mon, 20 Nov 2023 14:15:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF25B3858C36 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BF25B3858C36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700489742; cv=none; b=og/Epxq4V9194abU5QB/3JxYJHNV41YPjgI/q5eGBSP6MFPDTNWnRJ9w+TvJl8tyYDU9oIlwQ7YvNO6H1iwZAXgGQR9gJKQdeLj+eApz2ZbgA+qxaAT3Cmvyso+czz9bGDnyieoZ/YTSKfddphNTEEwkxGIV9v/HcqsTB3kjKvQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700489742; c=relaxed/simple; bh=nwIKJlNZmzb0crkN1tXuRMJGcG2nWS1x/Yyrxuw3VAA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=fYkGHTyI3r71ekfq5o73cmk7mD6Gi/isW71WwaCbGqGbVlNlky9pk6sUtT9oBze/zhkplyC6nXeI54nTGbGMnSBgY5kSY70v9bc5CBMyZ6hB8d2uALaRGvyhm3y4ARIKMogIHK7dWDijqqm7UgCvEXGVc6f7Lsb8QqB0f8ICmoE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6c32a20d5dbso3847993b3a.1 for ; Mon, 20 Nov 2023 06:15:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700489736; x=1701094536; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=strBoT1keNdzLCWSRDSK9X23RSyg+nhr7YwdOEcxxao=; b=NnlZMgSAyUqNzWAGXp7roYKPn4AkV49tSOVbNcEeST+1aTabgQuk0JQAlFNBk7fqW8 aTNjQeIfkzc/jQRC56HUqWTh8FQuy/QpPJhsc57h9uMZyl2Gx2eEw44gk+/LrzA5CTKp b779GU4KJ687eoU47UhDdOXsnW+uSaEFJe+R7apwyzb1gVqbFpWBs9Jb0kTs2iTH2k8P 6yKaoGzigId+ahuedJikhKlesRe5RTn/PB4fXbFThMGxGcE5QxvfprYF5rn7zJE5gHi6 mGEbI3Ti2fkfHeReeZDinKqB3uKPM1/EieNKR/4X2ynrZgijMr6wDRIxf7WJiIEw4Aps IqgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700489736; x=1701094536; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=strBoT1keNdzLCWSRDSK9X23RSyg+nhr7YwdOEcxxao=; b=NMXf93B+UAqdwuMWKxlCjlGOgA9UKKWkUw9/3fM9pCsS7qPTHu/niHfeYgaHod5evQ AV/aqzt/sJRzjQC0b5qc8NDeBSJK90D/yJIXcmIvb36u6L4VOaaAH/YWTNf/Iq8vidNY Pyn4EQ8YKXQLQ4lH/HGHVkik+QWQl0PSas8mlwBp4BC21odF3dUvd+mBFUDsxMTt8DMp nlhxRgHd/U4p49Jkye1KA60yq0fyJ9jRBA8N1DmWWywiav+vS2BnA2/lrxAVPAG4JUzH PmyfSwFBkRVecpZgN65sszt+e/gqG8YZYRtTMjJJh3nMsnufBKJ1cI57VDvEr6syY9Iy 1Kbw== X-Gm-Message-State: AOJu0YysMAv50WQfkt2ghYJdHEJeF302MEaLxkMO4pVttijJDebzYhO7 9inVtPWii7MqY3xKTzqKZNnmmrVXqAhF0DXjtYoC6w== X-Google-Smtp-Source: AGHT+IHhPgChE6vcMsxOeO72alfG9IhcQy2fo7zTYcl5Iz83Rm0r0LANZXoXj5/Cd8JTmBALQUr0Aw== X-Received: by 2002:a05:6a20:8e23:b0:135:1af6:9a01 with SMTP id y35-20020a056a208e2300b001351af69a01mr5779763pzj.8.1700489736141; Mon, 20 Nov 2023 06:15:36 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c2:94e:b99b:7812:71a8:3bda? ([2804:1b3:a7c2:94e:b99b:7812:71a8:3bda]) by smtp.gmail.com with ESMTPSA id s21-20020a056a0008d500b006b2677d3685sm6109051pfu.207.2023.11.20.06.15.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Nov 2023 06:15:35 -0800 (PST) Message-ID: <8158d73b-333e-47e5-ba6d-164f801c13ff@linaro.org> Date: Mon, 20 Nov 2023 11:15:33 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/3] Various qsort fixes Content-Language: en-US To: libc-alpha@sourceware.org, Florian Weimer References: From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 17/11/23 15:44, Florian Weimer wrote: > The first patch is basically a repost, with the condition tweaked for > consistency with the other self-comparison avoidance we have. > > The second patch addresses Stepan's observation regarding incorrect > node-index computation in the fallback heapsort heapsort implementation. > > The third patch activates the heapsort fallback in more cases, to avoid > denial-of-service issues. I will review these today, thanks! > > Thanks, > Florian > > Florian Weimer (3): > stdlib: Avoid another self-comparison in qsort > stdlib: Handle various corner cases in the fallback heapsort for qsort > stdlib: The qsort implementation needs to use heapsort in more cases > > stdlib/Makefile | 4 ++ > stdlib/qsort.c | 74 +++++++++++++------ > stdlib/tst-qsort4.c | 134 ++++++++++++++++++++++++++++++++++ > stdlib/tst-qsort5.c | 171 ++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 361 insertions(+), 22 deletions(-) > create mode 100644 stdlib/tst-qsort4.c > create mode 100644 stdlib/tst-qsort5.c > > > base-commit: dae3cf4134d476a4b4ef86fd7012231d6436c15e