-2

Using C++ 20 with VS 2022 Community create a std::vector attempt to get an element outside the max bounds - you will get an assertion requestor, and you will see what happens :)

The stack trace is available in all the other cases I have encountered.

I have tried in all the "exception settings" turning on everything to no avail and still the call stack is wiped when this assertion is hit. I also tried finding a place in <vector> where I could manually put in a break point before the requestor is launched as well. Of course it is under many layers of templates and macros. Seemingly it triggers an internal runtime error "std::error report" requestor.

enter image description here

peterk
  • 5,136
  • 6
  • 33
  • 47
  • Does reading [the documentation](https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-use-the-call-stack-window?view=vs-2022) help? – Some programmer dude Nov 18 '22 at 09:49
  • "Seemingly it triggers an internal compiler error" why do you think that? My guess is that your symbols are not set up correctly. Try turning on the MS Symbol Server (Tools>Options>Debugging>Symbols>check Microsoft symbol server) – tenfour Nov 18 '22 at 09:54
  • Please elaborate, don't you see any call stack *at all* in the debugger? When that crash happens, please take a screenshot and add it to your question to we can see what you see yourself. – Some programmer dude Nov 18 '22 at 10:04
  • @Someprogrammerdude Yes MS puts up a requestor for the assertion ( from inside their standard library ) when that occurs there is no stack trace available. I tried to find and put a break point at the spot that (apparently) launches the assertion but it will not take – peterk Nov 18 '22 at 16:34
  • also I don't care about the inside the MS code it can remain private - I just want to know the place where I gave it an invalid index. I manage to find it by a binary search form of putting log lines in my code but this is somethign that will happen again. – peterk Nov 18 '22 at 16:36
  • Usually when you get a message box about a crash or an exception, you usually get an alternative to actually enter the debugger, where the call stach should be obvious. What alternatives do you get from your dialog? Which one do you select? What happens then? – Some programmer dude Nov 18 '22 at 16:39
  • you are right but this case is different :) Using C++ 20 with VS 2022 community create a std::vector attempt to get an element outside the max bounds - you will get a requestor, you will see what happens :) :) – peterk Nov 18 '22 at 20:32
  • I can't, I don't have Windows. Please [edit] your question to give us all details needed to solve your problem. And perhaps take some time to refresh [the help pages](http://stackoverflow.com/help), take the SO [tour], read [ask], as well as [this question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/). – Some programmer dude Nov 18 '22 at 21:21
  • 1
    Bottom line of that message is **(Press Retry to debug the application)**. Have you tried that? – Ben Voigt Nov 18 '22 at 22:02
  • yes only "Ignore" shows a path to show the call stack in this case. – peterk Nov 18 '22 at 22:08
  • If you press "Retry" to go into the actual debugger, there's a whole pane which shows the full call stack. As well as the possibility to examine variables and their values. Please take some time to really learn how to use the [debugger](https://stackoverflow.com/questions/25385173/what-is-a-debugger-and-how-can-it-help-me-diagnose-problems), it's an important tool for all programmers. – Some programmer dude Nov 19 '22 at 08:27
  • Another thing, why didn't you actually start your program in the debugger to begin with? Then you wouldn't have gotten the dialog and the debugger would have caught the exception immediately and placed you at the location of the exception being thrown (which would not have been in your code, but since you have the call stack pane it's easy to go up to your code). – Some programmer dude Nov 19 '22 at 08:28
  • @Someprogrammerdude I did - this is solved it is basically the UI is inconsistent and the requiestor in the std::xxx assert is different than other types of exceptions and that was confusing. Now that I "know" through trial and error etc OK. The question was to eliminate that need :) – peterk Dec 03 '22 at 22:24

1 Answers1

1

Ok - found it - it will only show the call stack after you hit "ignore", then it will put up a second requestor with a small print "show call stack" blue link-like button.

enter image description here

peterk
  • 5,136
  • 6
  • 33
  • 47