You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I slightly changed how CGUs are named in #112946 and the fuchsia developers reported an ICE on their Windows CI builds. I created #113402 to give a more informative error message.
@ComputerDruid responded with an updated crash here. I'm now moving this problem into its own issue.
Thanks, this is exactly the information I was after. Something weird is going on here -- those numeric suffixes are supposed to be zero-padded, e.g. 00 to 10 for the first examples, and 00 to 15 for the second example. Because then they'd be in name-sorted order. (Without the zero-padding, the one with the 10 suffix is considered lower than the one with the 9 suffix.)
The code responsible for creating the CGU name is here. It uses let num_digits = codegen_units.len().ilog10() as usize + 1; to compute how many digits the suffix must be, and then creates the suffix with let suffix = format!("{index:0num_digits$}");. Nothing too complicated, except for the use of the magic trailing $ to allow a variable padding amount. And platform independent. The number of CGUs involved in the examples (11 and 16) are completely normal, anything up to 16 is normal, though the code should handle any number. Seems like the kind of code that should not be failing on a single project's CI on a single platform!
Makes me wonder if there could be a bug on Windows with either ilog10 or the use of 0num_digits$ padding in format!? Though if that was the case every Windows nightly user would be hitting this problem. Hmm.
Activity
[-]unsorted CGUs[/-][+]ICE: "unsorted CGUs"[/+]nnethercote commentedon Jul 6, 2023
[Responding to this comment from the original PR]
When you have
jemalloc=trueon linux do you encounter the problem?Thanks, this is exactly the information I was after. Something weird is going on here -- those numeric suffixes are supposed to be zero-padded, e.g.
00to10for the first examples, and00to15for the second example. Because then they'd be in name-sorted order. (Without the zero-padding, the one with the10suffix is considered lower than the one with the9suffix.)The code responsible for creating the CGU name is here. It uses
let num_digits = codegen_units.len().ilog10() as usize + 1;to compute how many digits the suffix must be, and then creates the suffix withlet suffix = format!("{index:0num_digits$}");. Nothing too complicated, except for the use of the magic trailing$to allow a variable padding amount. And platform independent. The number of CGUs involved in the examples (11 and 16) are completely normal, anything up to 16 is normal, though the code should handle any number. Seems like the kind of code that should not be failing on a single project's CI on a single platform!Makes me wonder if there could be a bug on Windows with either
ilog10or the use of0num_digits$padding informat!? Though if that was the case every Windows nightly user would be hitting this problem. Hmm.ComputerDruid commentedon Jul 7, 2023
No, I just tried that too and neither way can I reproduce the issue on my linux machine
lqd commentedon Jul 7, 2023
@ComputerDruid your config uses ThinLTO and LLD: I believe you're hitting #109114.
Removing
lto = "thin"will fix it.