CONSOLE_INFORMATION has an ODR violation contributing to test instability #4424

Closed
opened 2026-01-30 23:47:27 +00:00 by claunia · 2 comments
Owner

Originally created by @DHowett-MSFT on GitHub (Oct 13, 2019).

It turns out that there's an ODR violation! CONSOLE_INFORMATION changes size based on whether UNIT_TESTING is defined (VtIo got a new UNIT_TESTING-only member in #2525), and that gets rolled up into Host.unittest.lib. InteractivityBase.lib has a compile-time dependency on the layout of CONSOLE_INFORMATION, but InteractivityBase isn't built with a UNIT_TESTING variant. CI gets constructed in InteractivityBase, and as the linker can resolve the ODR violation in whatever way it sees fit it ends up choosing the shorter layout when packing in file-level statics.

This bug only exists in our tests. The fix in 83fcb6c moves the trampled global out of the way... but just fixes the symptom. :|

Originally posted by @DHowett-MSFT in https://github.com/microsoft/terminal/pull/3107#issuecomment-541369066

Originally created by @DHowett-MSFT on GitHub (Oct 13, 2019). > It turns out that there's an ODR violation! `CONSOLE_INFORMATION` changes size based on whether `UNIT_TESTING` is defined (VtIo got a new `UNIT_TESTING`-only member in #2525), and that gets rolled up into Host.unittest.lib. InteractivityBase.lib has a compile-time dependency on the layout of `CONSOLE_INFORMATION`, but InteractivityBase isn't built with a `UNIT_TESTING` variant. CI gets _constructed_ in InteractivityBase, and as the linker can resolve the ODR violation in whatever way it sees fit it ends up choosing the shorter layout when packing in file-level statics. > This bug only exists in our tests. The fix in 83fcb6c moves the trampled global out of the way... but just fixes the symptom. :| _Originally posted by @DHowett-MSFT in https://github.com/microsoft/terminal/pull/3107#issuecomment-541369066_
Author
Owner

@zadjii-msft commented on GitHub (Dec 6, 2021):

With the revert of #2525 in #3488, I don't think this is relevant anymore. There's no longer a debug-only member of CONSOLE_INFORMATION, so we can close this one out, yea? @DHowett

@zadjii-msft commented on GitHub (Dec 6, 2021): With the revert of #2525 in #3488, I don't _think_ this is relevant anymore. There's no longer a debug-only member of `CONSOLE_INFORMATION`, so we can close this one out, yea? @DHowett
Author
Owner

@DHowett commented on GitHub (Dec 8, 2021):

I believe so! Thanks.

@DHowett commented on GitHub (Dec 8, 2021): I believe so! Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4424