From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id PDNmCFmLlWozmRcAWB0awg (envelope-from ) for ; Mon, 31 Aug 2026 10:10:33 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=AM0NoCps; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=RiumedsI; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id F37041E033; Mon, 31 Aug 2026 10:10:32 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A65001E033 for ; Mon, 31 Aug 2026 10:10:30 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0CC5B4BA2E1F for ; Mon, 31 Aug 2026 14:10:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0CC5B4BA2E1F Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=AM0NoCps; dkim=pass (2048-bit key, unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=RiumedsI Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by sourceware.org (Postfix) with ESMTPS id 2BF4A4BA2E12 for ; Mon, 31 Aug 2026 14:10:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2BF4A4BA2E12 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oss.qualcomm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2BF4A4BA2E12 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788185407; cv=none; b=r+ppjqlZ44bcIEaW65upfxs2fxBWYWIvP/wow6TXpmVh7id6MkA/Jurs0tK7e9N2uxPBkyjpO6RXrQew48RPAR43Z7kQzr/q6j9evsDcAbcdH5L0IJtPGmSZyhmBkdnzNG5riZwbjsSVATeyjcOG7KP05cl0aeQ54sD43jWcxZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788185407; c=relaxed/simple; bh=h+/ZwlAv03D4+FgH3QR3sStL5yiVotlIfNM1lZe0RwU=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=S8CMoChJPPheqtdw9kIt86KWjkN7zTMh7ci+is/K3qePdeFP4IcALY1C6qRVyiuVxhtmOurhXnenlkQDx7xvzyNwizQJ+4OAlVsaiTDqnopCO4+Grgif+tvHbOTUlk1zoET+xLn/cRS7ZDqW8VMG0EoZ8D8WVb1ohJWub31x2xY= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=AM0NoCps; dkim=pass (2048-bit key, unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=RiumedsI DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2BF4A4BA2E12 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67VBALs33862476 for ; Mon, 31 Aug 2026 14:10:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 5vnIJpaoypdu8m1QBdKs/fBToZzEhNH1qgUIh7vwHa4=; b=AM0NoCpsVELlt5pH jlKBT5olPym9DuljZWV7Aiwb3umQZu5bObhgLaNMRCDTotKDaSopvF0UIulow6KP TwlRaydeG8dFJVd4stXR9MnOtVaQOgejpy6GwldgbrznmcsVLV+tQRzaYOvruo3P d4syFDMyw1B7C7XMox4AFFBp7kGs7CA10Kw28K6PwhzYwKUQ5swRlIsyFL+9mIwk BOVtqSiC5DUftwkD6cqD0i5TxlPLH3bF33ySmimvZe26Nsn0KbXLbwERG+C2rfBE hEG2Ufj+QC4uLzCsRlz4oautSEzAs4DJAY+BFKi+KXoK4gCaAtyBZnED1iK23FUr LuCPaw== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gd4pm9uax-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 31 Aug 2026 14:10:06 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2cfc52ddc55so64407155ad.3 for ; Mon, 31 Aug 2026 07:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788185405; x=1788790205; darn=sourceware.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=5vnIJpaoypdu8m1QBdKs/fBToZzEhNH1qgUIh7vwHa4=; b=RiumedsINiz2+EFkp6X5Au0R/qI90AOkaycnskGHHetGKXXOvpxKJckXyQv2Dsknl2 ZeDWk3e8wcMjIWiFJq0i7Z1CMTW/jl+EabwBDsoFtTq954Owz0TYVsCRNVO+SjodsbTi lgRcLysiNHQwac5b+1OQmpHWYem1qNndw5VuesnFCa1YMuFmlqrdirWkPPnuInmovK4k 05V67aScUqp8ZpB/8Wxq/Riy1KjAY6UCFlTD1M0IQdrIvUymGb28TZF9N35lOLDL0nVC /6OFFBVwawORUHQ+Hhdl1+IovWd2tuqwer+5Y38rZv/CRtBa9GMH493/m8Jc863MwjdA a8lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788185405; x=1788790205; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=5vnIJpaoypdu8m1QBdKs/fBToZzEhNH1qgUIh7vwHa4=; b=bVzI3gU6GiOWKqd4K8rDcOK5DQlGvQoNuGqa8BovFGR3/EbfkR+N2s8NwCLOKsx8Th iGz08E/RgJ7aMqoATMBCzO4xlzqlT2GhMM+AmoJUd+4er8Sa3hJ1CLyidbqUBBuSTdEJ VndTHFCDnv/tMQqRV3FMmuP9zlbzKwh/6jeNLCT6vn1jxmF5UPV1Uv65ugzd/m0dsUXQ pK69xak6dwrCtiJewmdHLDavRCOw0unmFn35I+lSWOUeDdcDgkb/ifgdoYfD3aC4d6ih jpQpO0lqY6DIqtN0fNXSbmvf/JRc2zym3UDtnmhdfEJlkiJN3E8iCiiKYveM48KuClYg 0lvA== X-Gm-Message-State: AFuF++nAhUwG8vA+X67DUuDUwCILTFsEA6rODk2Mbhh2024lVv0dxEQy 8MXoAnYxWy21eeP407BS3BqeQuxjljzbl95jSeJCPKtxssa8WfjEIREhtyZBuWgRxgY3ulTK7rE RhFMeBWIA5qVfulnoSV0K5GxMYGjsIUqdASjbHjSSrWFAXHPwvs1M05sVo7vPawPR X-Gm-Gg: AYBFou0jw1gpt5IGgHLffSmU4F0MhAuPBoEKOSawqdxlefdz3edQISSpg8ko3JTbnEK a7732uSe63/StTVFINOpvAhZzphToskYgYYLfjYvk+YSS6BKtVeEPLfygSJdlv1ueHGstoQP0hR K+2wb5uQ7Kj4ty532bN9jIdTcg/QN9q1PHKx5C8g9rs2RCZrfOXejo0m9mJu9O9AZzCCrG/oug5 SAzuu1nDUYurZawvSA+8MrO0wENp0IM5pQQdAFcRATRbSU5FR+IrAZwbRKkWTKJcTIMaUoKVr+M BH5t9vRcIyKMaJAcvxRvzkjPtAuiNseh8wRigNrN/Ohy0GnHLC1blxmWFcuKYNv702TGxnTemIx qJv0z8s7ob/SqEXY= X-Received: by 2002:a17:903:1b63:b0:2d9:e83:4de with SMTP id d9443c01a7336-2d90e830846mr126677335ad.7.1788185405307; Mon, 31 Aug 2026 07:10:05 -0700 (PDT) X-Received: by 2002:a17:903:1b63:b0:2d9:e83:4de with SMTP id d9443c01a7336-2d90e830846mr126676605ad.7.1788185404783; Mon, 31 Aug 2026 07:10:04 -0700 (PDT) Received: from [172.31.0.28] ([136.38.201.137]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-32b28ab0571sm21882284eec.4.2026.08.31.07.10.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Aug 2026 07:10:04 -0700 (PDT) Message-ID: Date: Mon, 31 Aug 2026 08:09:33 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] H8/300: sim: Fix simulator hang caused by qsort on Windows/MinGW. To: Jan Dubiec , Tom Tromey Cc: gdb-patches@sourceware.org References: <20260822110423.1569154-1-jdx@o2.pl> <878q5rbngh.fsf@tromey.com> <140cc872-432a-4b4d-85d6-c93ac879bafb@o2.pl> Content-Language: en-US From: Jeff Law In-Reply-To: <140cc872-432a-4b4d-85d6-c93ac879bafb@o2.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: 0cZc5EsXTV1FqCXwjPCPAwpx95kSu7y7 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODMxMDEyMiBTYWx0ZWRfXxfzmUgQektKQ xUAzpoM16LpNujAxdSpktVX2FpK3cNEVlpTeXda13/RnAtJyuCKIGC4L1coeh3kzXvcbtp51z72 dwqSi6s3hPoHFg/v3DhN3fqt22LBV2B+xcT5uRbbFt11TAnMsEJ95Dl1h36ogdifbvfoao+8eDK K6wzejWD1qJCNpywUDMEu/SyjjWzq23TzQKhDbnRx0nbgB0O/tjLWOMIjqFHD7NcRAQa05EhmeM Zdyd56Jv+394FGcbjqkd1f+rlu167hBfFAzF/yqg0tU4CSmaKSr3Jt3oPkoCjKEMI6k5sWykKWC BQZ9cfV8O8CZnXB99TZ46srX+UWQevCQjYUiDIm2AFWMMbXPL5P45lRzXRGd8qpFILyejUOwfjz kOQkZsGexSqgtDs+Wz9GoIFDDrKgpZjvuXNsEvpi2qVZX7AFKFa95LYyUglih4gpwtEIJXDDN8E OW/wObaOhuNjT5yrTvA== X-Proofpoint-GUID: 0cZc5EsXTV1FqCXwjPCPAwpx95kSu7y7 X-Proofpoint-Spam-Info: AW1haW4tMjYwODMxMDEyMiBTYWx0ZWRfXxopE0AmK7cPJ r35jbevpWypVqnOYa4YTFKcxQH9FyqonhAtekJT9tmees7FaShmujabhqJPEtYeXMUMCkKH1ga5 UqsZ2jegwV/tk8Koi2Bpfs5L6Y1/1Vk= X-Authority-Analysis: v=2.4 cv=GbQnWwXL c=1 sm=1 tr=0 ts=6a958b3e cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=asGLMfRmzhnGNxaIYohjRg==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=-2wST4T2ELPKgtDaG_AA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-31_04,2026-08-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1011 bulkscore=0 priorityscore=1501 adultscore=0 malwarescore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608310122 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 8/29/26 7:40 PM, Jan Dubiec wrote: > On 27.08.2026 17:19, Tom Tromey wrote: >>>>>>> "Jan" == Jan Dubiec writes: >> >> Jan> So I think the best solution is to use a sorting algorithm known >> to be >> Jan> stable on every host, e.g. the insertion sort implementation >> from my >> Jan> previous message. >> >> Would it be possible to change the comparison function to be stable? > > It is impossible by definition, because stability is a property of the > sorting algorithm, not the comparator. However, the comparator can be > modified in such a way that an unstable sorting algorithm produces a > “good enough” result. When the comparator returns "0", the order of those two elements is unspecified  in the final output of qsort.  That introduces host dependencies in behavior that we very much want to avoid. The traditional way to fix that is to fix the comparator to not return 0 by introducing additional sort keys.    He may have been a bit imprecise by saying "change the comparison function to be stable", but the intent is clear and consistent with how this issue has been handled through the decades. Jeff