[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] symbols: ensure sorting by value yields reproducible outcome


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 21 Jan 2026 18:22:19 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • 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=5zGftGTYjP7yuwq+tx02Mk2FlcNJSw+Iwt+/cRGtx7w=; b=gimVI4YSgVKcvDYlPgGNo4sm01Bu9nhmPiefrzR5Itdq4mOeFIhDCW5Aiok14OelWfU2xRuoj4/PUp9Qjk2XRJHLiHGBgjs26Li1WqWSHLPwseuF3SQu4sXRkmnesNNMDpte9VTsC+wFq5oWizVDwrL5KeJi2up7DQWI0EnBmdmirAc305NZNQeVV8uUJXcwigweb3i9xGt8vUc6LZg4WRpSlQiXiva0VX1MP4644ICq1k2bcQ3rarYOr4a4OvikaDRYBGVW3oi4wIae7MLRdFRB6ieWiSYS10wv8RG7McjpbZUJWUS/SgnXd7KP5ypE57x/HfXEHEQEdPlOTdrMhA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lsWM9C4FU7yyj0obhNdgq5YDT91qFH/8vHaXiKsH63A486khHJn2+vMLwutWamGnDp4Jldm7eUWs30BZp3wvdpXj7xXElv3E8FOnuBOBgl0CmjgFxWuOTSAiMMmf6k0IzRLTwnxhQmcTwqT3t1mzr3vVmHwkpSLAN3qZSNDyfcE0Ak9OBKcmcAltKbUTrHekTa6GXW0ln+sCYm0BEbmGZu1YJCKLk+d5qbNpeMFOhv6kt5uq1Cbs9q69Bs7hMaMrlH7GZBzbPFP6Ibv8Pq4qziGNoLGtvbNofY6R0j3rRHD9tOXwdZQDzJQuBfeH1my7IVGdoX8kxlU9RXKVIhHwPQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Wed, 21 Jan 2026 17:22:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Jan 21, 2026 at 04:24:43PM +0100, Jan Beulich wrote:
> qsort() implementations have freedom towards actions taken when two items
> compare equal. The latest with the introduction of fake "end" symbols,
> inconsistent sorting between the 1st and 2nd run can lead to extra "end"
> symbols in one of the runs, making the resulting symbol table partly
> unusable. (Note in particular that --warn-dup or --error-dup are passed
> only on the 2nd run, and only for xen.syms, and that option has the effect
> of doing a name sort ahead of doing the address sort. I.e. the inputs to
> the 2nd qsort() are pretty different between the 1st and 2nd runs.)
> 
> Make the result stable by using original order to break ties.
> 
> Fixes: d3b637fba31b ("symbols: arrange to know where functions end")
> Reported-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

> ---
> I can't exclude the unreliable sorting could have other bad effects, in
> which case some much older commit would likely need referencing by Fixes:.

Lacking a more clear indicator I'm fine to use the current Fixes
reference.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.