Live data from Hacker News

Show HN: Using C++23 to get proper crash logs in C++ programs

github.com

1–10 of 95 posts

Re: Show HN: Using C++23 <stacktrace> to get proper crash logs in C++ programs

#3
This is my favorite macro: "#define WIN32_LEAN_AND_MEAN"

Why is it that even though Github or what ever has cutsie unicorns (or whatever it is) as error messages it feels fake and contrived while this define just feels like some random dude at MS naming it before going off to write Solitaire?

Re: Show HN: Using C++23 <stacktrace> to get proper crash logs in C++ programs

#4

Reliable in-process crash reporting is exceptionally difficult. The code must be fully async-safe, which means you cannot use . You also cannot acquire mutexes, use any of the standard allocators, etc etc etc.

What's the benefit of in-process crash reporting compared to just using something like crashpad/breakpad?

To the extent that in-process crash reporting is even possible... seems the most common class of crashes would be entirely unrecoverable.

Re: Show HN: Using C++23 <stacktrace> to get proper crash logs in C++ programs

#5

This is my favorite macro: "#define WIN32_LEAN_AND_MEAN" Why is it that even though Github or what ever has cutsie unicorns (or whatever it is) as error messages it feels fake and contrived while this define just feels like some random dude at MS naming it before going off to write Solitaire?

Don't forget `WIN32_EXTRA_LEAN`! Still no idea what that does/did.

For those curious about WIN32_LEAN_AND_MEAN - it reduces compile time by not auto-including a number of windows headers: https://devblogs.microsoft.com/oldnewthing/20091130-00/?p=15...

Re: Show HN: Using C++23 <stacktrace> to get proper crash logs in C++ programs

#6

This is my favorite macro: "#define WIN32_LEAN_AND_MEAN" Why is it that even though Github or what ever has cutsie unicorns (or whatever it is) as error messages it feels fake and contrived while this define just feels like some random dude at MS naming it before going off to write Solitaire?

[deleted]

Re: Show HN: Using C++23 <stacktrace> to get proper crash logs in C++ programs

#7

This is my favorite macro: "#define WIN32_LEAN_AND_MEAN" Why is it that even though Github or what ever has cutsie unicorns (or whatever it is) as error messages it feels fake and contrived while this define just feels like some random dude at MS naming it before going off to write Solitaire?

We've had to use this at my work a couple times. I forget the exact reasoning, but IIRC if you're using including parts of the Win32 API, you get some things that would stomp on C or C++ names, which is bad. Macros like that one prevent loading things you don't want.

One example was min and max - Win32 includes those which messes with trying to use std::min and std::max.

Re: Show HN: Using C++23 <stacktrace> to get proper crash logs in C++ programs

#8
post #4

Reliable in-process crash reporting is exceptionally difficult. The code must be fully async-safe, which means you cannot use . You also cannot acquire mutexes, use any of the standard allocators, etc etc etc.

What's the benefit of in-process crash reporting compared to just using something like crashpad/breakpad? To the extent that in-process crash reporting is even possible... seems the most common class of crashes would be entirely unrecoverable.

[deleted]

Re: Show HN: Using C++23 <stacktrace> to get proper crash logs in C++ programs

#9
post #4

Reliable in-process crash reporting is exceptionally difficult. The code must be fully async-safe, which means you cannot use . You also cannot acquire mutexes, use any of the standard allocators, etc etc etc.

What's the benefit of in-process crash reporting compared to just using something like crashpad/breakpad? To the extent that in-process crash reporting is even possible... seems the most common class of crashes would be entirely unrecoverable.

I guess it is easier to print out some interesting process variables, compared to trying to save and then make sense of dumps etc.

Re: Show HN: Using C++23 <stacktrace> to get proper crash logs in C++ programs

#10
post #5

This is my favorite macro: "#define WIN32_LEAN_AND_MEAN" Why is it that even though Github or what ever has cutsie unicorns (or whatever it is) as error messages it feels fake and contrived while this define just feels like some random dude at MS naming it before going off to write Solitaire?

Don't forget `WIN32_EXTRA_LEAN`! Still no idea what that does/did. For those curious about WIN32_LEAN_AND_MEAN - it reduces compile time by not auto-including a number of windows headers: https://devblogs.microsoft.com/oldnewthing/20091130-00/?p=15...

Do you mean VC_EXTRALEAN? Or is WIN32_EXTRA_LEAN also a thing?
Post reply on HN