Skip to content

Canary: enable STL hardening and destructor tombstoning in all builds - #20544

Merged
Dustin L. Howett (DHowett) merged 5 commits into
mainfrom
dev/duhowett/harder
Aug 12, 2026
Merged

Canary: enable STL hardening and destructor tombstoning in all builds#20544
Dustin L. Howett (DHowett) merged 5 commits into
mainfrom
dev/duhowett/harder

Conversation

@DHowett

@DHowett Dustin L. Howett (DHowett) commented Aug 12, 2026

Copy link
Copy Markdown
Member

This may cause us some pain, but having a safer codebase is worth some pain.

More info at https://github.com/microsoft/STL/wiki/STL-Hardening.

Comment thread src/common.build.pre.props Outdated
Hardening prevents the misuse of containers more strictly than Container Debug and Iterator Debug.
Tombstoning prevents use-after-free by filling deleted pointers with a sentintel value.
-->
<PreprocessorDefinitions Condition="'$(WindowsTerminalBranding)'=='Canary'">_MSVC_STL_HARDENING=1;_MSVC_STL_DESTRUCTOR_TOMBSTONES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should consider including Dev as well, for local builds. That will probably prevent our future vexation when we can't repro an issue under debug :P

Comment thread src/common.build.pre.props Fixed
Comment thread src/common.build.pre.props Fixed
@github-actions

This comment has been minimized.

@DHowett

Copy link
Copy Markdown
Member Author

To reiterate the last point, an important design principle is that hardening needs to be lightweight enough for production use by a wide variety of real-world programs.

Comment thread src/common.build.post.props Fixed
@github-actions

This comment has been minimized.

Comment thread .github/actions/spelling/expect/expect.txt Fixed
Comment thread .github/actions/spelling/expect/expect.txt Fixed
@github-actions

This comment has been minimized.

@DHowett

Copy link
Copy Markdown
Member Author

Josh Soref (@jsoref) i think the check spelling bot is having a stronk

image

i can't get it to accept the more generic variant it tells me i have

tmultiple
tofrom
tombstoning
Tombstoning

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding only the lowercase variant makes it work for the capitalized one too!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leonard Hecker (@lhecker) you say that, and it is what I thought too, but the spell checker did not agree (or I have subtly spelled it wrong in an undetectable way)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete the lowercase and all caps flavors -- that should fix it. it says that it can't find the lowercase flavor anymore.

I'm more worried about the ⚠️ Dictionary not found, that usually means something's gone fairly wrong...

Indeed, this doesn't work:

"cspell":"https://raw.githubusercontent.com/check-spelling/cspell-dicts/v20241114/dictionaries/"
cspell:django/dict/django.txt

maps to:
https://raw.githubusercontent.com/check-spelling/cspell-dicts/v20241114/dictionaries/django/dict/django.txt

I'll have to look later to see what's causing the config to be confused.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh fascinating, it's the title-case one that counts for both and not the lowercase one. thank you

that dictionary error, yeah, honestly I've been ignoring it forever :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .github/actions/spelling/expect/expect.txt Outdated
@DHowett
Dustin L. Howett (DHowett) merged commit 128bffd into main Aug 12, 2026
18 of 20 checks passed
@DHowett
Dustin L. Howett (DHowett) deleted the dev/duhowett/harder branch August 12, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants