Apps built with VS2017 in C++ in Release mode do not break on unhandled exceptionIs there “Break on Exception” in IntelliJ?What happens if a throw; statement is executed outside of catch block?Unhandled exceptions in BackgroundWorkerHow to debug a program that is terminating in an unhandled exception?Exception handling problem in release modeWhy are unhandled exceptions thrown in win32 timer callbacks not treated as unhandled exceptions by the debugger?Program runs good in Turbo C, but fails in MSVC, unhandled exception comesC++ Exception “Skips” Try-Catch Clause in MSVC x64C++ exception, thow const char* type and catchC++ try-catch block doesn't catch hardware exception

Can a 40amp breaker be used safely and without issue with a 40amp device on 6AWG wire?

What is the color associated with lukewarm?

Manager wants to hire me; HR does not. How to proceed?

The title "Mord mit Aussicht" explained

Is there a risk to write an invitation letter for a stranger to obtain a Czech (Schengen) visa?

mathrm in LaTeX

Is it a good security practice to force employees hide their employer to avoid being targeted?

I sent an angry e-mail to my interviewers about a conflict at my home institution. Could this affect my application?

Will users know a CardView is clickable

New Site Design!

Is fission/fusion to iron the most efficient way to convert mass to energy?

How do you translate “talk shit”?

ISP is not hashing the password I log in with online. Should I take any action?

Interview was just a one hour panel. Got an offer the next day; do I accept or is this a red flag?

Sakkāya-Ditthi and Self-View

What made the Ancient One do this in Endgame?

What did the 8086 (and 8088) do upon encountering an illegal instruction?

Is it true that "only photographers care about noise"?

What should I be aware of in buying second-hand sinks and toilets?

What does the "titan" monster tag mean?

Skills with different abilities: How to adjudicate what combination to use?

Dedicated bike GPS computer over smartphone

Must a CPU have a GPU if the motherboard provides a display port (when there isn't any separate video card)?

Can I give my friend the sour dough "throw away" as a starter to their sourdough starter?



Apps built with VS2017 in C++ in Release mode do not break on unhandled exception


Is there “Break on Exception” in IntelliJ?What happens if a throw; statement is executed outside of catch block?Unhandled exceptions in BackgroundWorkerHow to debug a program that is terminating in an unhandled exception?Exception handling problem in release modeWhy are unhandled exceptions thrown in win32 timer callbacks not treated as unhandled exceptions by the debugger?Program runs good in Turbo C, but fails in MSVC, unhandled exception comesC++ Exception “Skips” Try-Catch Clause in MSVC x64C++ exception, thow const char* type and catchC++ try-catch block doesn't catch hardware exception






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















This question refers to native C++ programs built by VS2017 but executed OUTSIDE of the VS IDE:



Why unhandled exceptions are silently ignored in native C++ Release builds, while Debug builds catch the same exception and display the nice expected error message ?



I tried finding the build setting, that affects the unhandled Exeptions but failed.



The code that generates the exception is listed below.
Note, that I am not asking how to fix this code and avoid the exception (or how to handle it), but how to unignore this exception in Release builds, so the OS catches it and complains.



std::map<const string, const int> MyMap;

auto it = MyMap.find("Cant Find Me");
int res = it->second; //Dereferencing the end iterator causes the expected exception. This exception is not explicitly handled anywhere else.


In response to some comments about Debug Assertion vs. Exception I have tried it with the following exception provoking code:



PCHAR p;
p = NULL;
*p = 'X'; //Provoke an exception by following a null pointer and awaiting the chaos and madness at its end...


This code still does not provoke any error messages when executed OUTSIDE of the MSVC IDE. This happens for BOTH the Release and Debug builds, now.










share|improve this question
























  • Q: So you're saying the application is an .exe, and that it doesn't crash with an exception when you run it outside of MSVS (e.g., run it from a command prompt)?

    – paulsm4
    Mar 25 at 2:36











  • Exactly...but the same application built in Debug mode crashes nicely.

    – George Robinson
    Mar 25 at 2:37






  • 1





    Dereferencing an end() iterator is undefined behavior. Why do you think it's required to throw an exception?

    – Blastfurnace
    Mar 25 at 2:52







  • 2





    @GeorgeRobinson but the same application built in Debug mode crashes nicely -- That is because the VS debug runtime uses "checked iterators", meaning iterator values are checked (and that also means your program runs slower). There is no such iterator checks in release mode. Also, what you are seeing in the debug build is anassert() dialog, not an exception being thrown, not a crash.

    – PaulMcKenzie
    Mar 25 at 3:42












  • @ PaulMcKenzie: You are correct, the error is an Assertion - not an exception. I have to agree with you, that this message is caused by the debug runtime library used in Debug mode.

    – George Robinson
    Mar 25 at 10:37

















0















This question refers to native C++ programs built by VS2017 but executed OUTSIDE of the VS IDE:



Why unhandled exceptions are silently ignored in native C++ Release builds, while Debug builds catch the same exception and display the nice expected error message ?



I tried finding the build setting, that affects the unhandled Exeptions but failed.



The code that generates the exception is listed below.
Note, that I am not asking how to fix this code and avoid the exception (or how to handle it), but how to unignore this exception in Release builds, so the OS catches it and complains.



std::map<const string, const int> MyMap;

auto it = MyMap.find("Cant Find Me");
int res = it->second; //Dereferencing the end iterator causes the expected exception. This exception is not explicitly handled anywhere else.


In response to some comments about Debug Assertion vs. Exception I have tried it with the following exception provoking code:



PCHAR p;
p = NULL;
*p = 'X'; //Provoke an exception by following a null pointer and awaiting the chaos and madness at its end...


This code still does not provoke any error messages when executed OUTSIDE of the MSVC IDE. This happens for BOTH the Release and Debug builds, now.










share|improve this question
























  • Q: So you're saying the application is an .exe, and that it doesn't crash with an exception when you run it outside of MSVS (e.g., run it from a command prompt)?

    – paulsm4
    Mar 25 at 2:36











  • Exactly...but the same application built in Debug mode crashes nicely.

    – George Robinson
    Mar 25 at 2:37






  • 1





    Dereferencing an end() iterator is undefined behavior. Why do you think it's required to throw an exception?

    – Blastfurnace
    Mar 25 at 2:52







  • 2





    @GeorgeRobinson but the same application built in Debug mode crashes nicely -- That is because the VS debug runtime uses "checked iterators", meaning iterator values are checked (and that also means your program runs slower). There is no such iterator checks in release mode. Also, what you are seeing in the debug build is anassert() dialog, not an exception being thrown, not a crash.

    – PaulMcKenzie
    Mar 25 at 3:42












  • @ PaulMcKenzie: You are correct, the error is an Assertion - not an exception. I have to agree with you, that this message is caused by the debug runtime library used in Debug mode.

    – George Robinson
    Mar 25 at 10:37













0












0








0


0






This question refers to native C++ programs built by VS2017 but executed OUTSIDE of the VS IDE:



Why unhandled exceptions are silently ignored in native C++ Release builds, while Debug builds catch the same exception and display the nice expected error message ?



I tried finding the build setting, that affects the unhandled Exeptions but failed.



The code that generates the exception is listed below.
Note, that I am not asking how to fix this code and avoid the exception (or how to handle it), but how to unignore this exception in Release builds, so the OS catches it and complains.



std::map<const string, const int> MyMap;

auto it = MyMap.find("Cant Find Me");
int res = it->second; //Dereferencing the end iterator causes the expected exception. This exception is not explicitly handled anywhere else.


In response to some comments about Debug Assertion vs. Exception I have tried it with the following exception provoking code:



PCHAR p;
p = NULL;
*p = 'X'; //Provoke an exception by following a null pointer and awaiting the chaos and madness at its end...


This code still does not provoke any error messages when executed OUTSIDE of the MSVC IDE. This happens for BOTH the Release and Debug builds, now.










share|improve this question
















This question refers to native C++ programs built by VS2017 but executed OUTSIDE of the VS IDE:



Why unhandled exceptions are silently ignored in native C++ Release builds, while Debug builds catch the same exception and display the nice expected error message ?



I tried finding the build setting, that affects the unhandled Exeptions but failed.



The code that generates the exception is listed below.
Note, that I am not asking how to fix this code and avoid the exception (or how to handle it), but how to unignore this exception in Release builds, so the OS catches it and complains.



std::map<const string, const int> MyMap;

auto it = MyMap.find("Cant Find Me");
int res = it->second; //Dereferencing the end iterator causes the expected exception. This exception is not explicitly handled anywhere else.


In response to some comments about Debug Assertion vs. Exception I have tried it with the following exception provoking code:



PCHAR p;
p = NULL;
*p = 'X'; //Provoke an exception by following a null pointer and awaiting the chaos and madness at its end...


This code still does not provoke any error messages when executed OUTSIDE of the MSVC IDE. This happens for BOTH the Release and Debug builds, now.







c++ exception x86 visual-studio-2017






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 11:35







George Robinson

















asked Mar 25 at 2:32









George RobinsonGeorge Robinson

1758




1758












  • Q: So you're saying the application is an .exe, and that it doesn't crash with an exception when you run it outside of MSVS (e.g., run it from a command prompt)?

    – paulsm4
    Mar 25 at 2:36











  • Exactly...but the same application built in Debug mode crashes nicely.

    – George Robinson
    Mar 25 at 2:37






  • 1





    Dereferencing an end() iterator is undefined behavior. Why do you think it's required to throw an exception?

    – Blastfurnace
    Mar 25 at 2:52







  • 2





    @GeorgeRobinson but the same application built in Debug mode crashes nicely -- That is because the VS debug runtime uses "checked iterators", meaning iterator values are checked (and that also means your program runs slower). There is no such iterator checks in release mode. Also, what you are seeing in the debug build is anassert() dialog, not an exception being thrown, not a crash.

    – PaulMcKenzie
    Mar 25 at 3:42












  • @ PaulMcKenzie: You are correct, the error is an Assertion - not an exception. I have to agree with you, that this message is caused by the debug runtime library used in Debug mode.

    – George Robinson
    Mar 25 at 10:37

















  • Q: So you're saying the application is an .exe, and that it doesn't crash with an exception when you run it outside of MSVS (e.g., run it from a command prompt)?

    – paulsm4
    Mar 25 at 2:36











  • Exactly...but the same application built in Debug mode crashes nicely.

    – George Robinson
    Mar 25 at 2:37






  • 1





    Dereferencing an end() iterator is undefined behavior. Why do you think it's required to throw an exception?

    – Blastfurnace
    Mar 25 at 2:52







  • 2





    @GeorgeRobinson but the same application built in Debug mode crashes nicely -- That is because the VS debug runtime uses "checked iterators", meaning iterator values are checked (and that also means your program runs slower). There is no such iterator checks in release mode. Also, what you are seeing in the debug build is anassert() dialog, not an exception being thrown, not a crash.

    – PaulMcKenzie
    Mar 25 at 3:42












  • @ PaulMcKenzie: You are correct, the error is an Assertion - not an exception. I have to agree with you, that this message is caused by the debug runtime library used in Debug mode.

    – George Robinson
    Mar 25 at 10:37
















Q: So you're saying the application is an .exe, and that it doesn't crash with an exception when you run it outside of MSVS (e.g., run it from a command prompt)?

– paulsm4
Mar 25 at 2:36





Q: So you're saying the application is an .exe, and that it doesn't crash with an exception when you run it outside of MSVS (e.g., run it from a command prompt)?

– paulsm4
Mar 25 at 2:36













Exactly...but the same application built in Debug mode crashes nicely.

– George Robinson
Mar 25 at 2:37





Exactly...but the same application built in Debug mode crashes nicely.

– George Robinson
Mar 25 at 2:37




1




1





Dereferencing an end() iterator is undefined behavior. Why do you think it's required to throw an exception?

– Blastfurnace
Mar 25 at 2:52






Dereferencing an end() iterator is undefined behavior. Why do you think it's required to throw an exception?

– Blastfurnace
Mar 25 at 2:52





2




2





@GeorgeRobinson but the same application built in Debug mode crashes nicely -- That is because the VS debug runtime uses "checked iterators", meaning iterator values are checked (and that also means your program runs slower). There is no such iterator checks in release mode. Also, what you are seeing in the debug build is anassert() dialog, not an exception being thrown, not a crash.

– PaulMcKenzie
Mar 25 at 3:42






@GeorgeRobinson but the same application built in Debug mode crashes nicely -- That is because the VS debug runtime uses "checked iterators", meaning iterator values are checked (and that also means your program runs slower). There is no such iterator checks in release mode. Also, what you are seeing in the debug build is anassert() dialog, not an exception being thrown, not a crash.

– PaulMcKenzie
Mar 25 at 3:42














@ PaulMcKenzie: You are correct, the error is an Assertion - not an exception. I have to agree with you, that this message is caused by the debug runtime library used in Debug mode.

– George Robinson
Mar 25 at 10:37





@ PaulMcKenzie: You are correct, the error is an Assertion - not an exception. I have to agree with you, that this message is caused by the debug runtime library used in Debug mode.

– George Robinson
Mar 25 at 10:37












1 Answer
1






active

oldest

votes


















1














Dereferencing the end iterator is undefined behaviour. An implementation is permitted to do what it pleases.



In debug builds, your particular implementation translates this to a nice user friendly error with a human readable message. This is a debugging aid.



In release builds, it does not, because release builds are not meant for debugging. Leaving debugging code in would hurt overall performance.



Addendum. It looks like your analysis of the situation with the first code fragment is as follows.



  1. Dereferencing an end iterator normally causes a CPU exception.

  2. The release build actively silences said exception.

  3. The debug build leaves the exception handled as per the OS default, which causes termination with a nice error message.

This analysis is incorrect. What in happens is as follows:



  1. Dereferencing the end iterator is undefined behaviour. An implementation is permitted to do what it pleases.

  2. In the release build, dereferencing an end iterator does not cause a CPU exception or any other immediately catchable error, as is normal for many mainstream implementations of std::string on the x86 architecture

  3. In the debug build, the implementation actively causes the program to raise a user-friendly exception upon dereferencing an end iterator, for a price of reduced performance.

As for the second code fragment, it may or may not cause a CPU exception, and a CPU exception may or may not cause a user-friendly error message. The behaviour of it is undefined. It isn't quite clear why you decided that (1) an exception does happen, and (2) it is being silently ignored by an implementation. There is absolutely no evidence that would suggest that. If a CPU exception does happen, the application probably just abnormally terminates without any user-visible error message. Your IDE, having included a debugger, is able to catch the abnormal termination and translate it to a user-friendly error, even for a release build. Outside of the IDE you are on your own.






share|improve this answer

























  • ...but when I purposely dereference a null pointer, the program still does not provoke any error messages when executed OUTSIDE of the MSVC IDE.

    – George Robinson
    Mar 25 at 10:55











  • That's because undefined behaviour is not tied to the IDE, it's a C/C++ concept.

    – Philipp
    Mar 25 at 10:56











  • @Philipp: I doubt that dereferencing a null pointer is an "undefined behavior".

    – George Robinson
    Mar 25 at 10:58







  • 1





    @GeorgeRobinson An implementation is permitted to do what it pleases. Providing debugging aids (only) with a tool meant for debugging is certainly one of the infinite number of things it is permutted to do.

    – n.m.
    Mar 25 at 11:02











  • @GeorgeRobinson It very much is.

    – n.m.
    Mar 25 at 11:02











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55330564%2fapps-built-with-vs2017-in-c-in-release-mode-do-not-break-on-unhandled-exceptio%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Dereferencing the end iterator is undefined behaviour. An implementation is permitted to do what it pleases.



In debug builds, your particular implementation translates this to a nice user friendly error with a human readable message. This is a debugging aid.



In release builds, it does not, because release builds are not meant for debugging. Leaving debugging code in would hurt overall performance.



Addendum. It looks like your analysis of the situation with the first code fragment is as follows.



  1. Dereferencing an end iterator normally causes a CPU exception.

  2. The release build actively silences said exception.

  3. The debug build leaves the exception handled as per the OS default, which causes termination with a nice error message.

This analysis is incorrect. What in happens is as follows:



  1. Dereferencing the end iterator is undefined behaviour. An implementation is permitted to do what it pleases.

  2. In the release build, dereferencing an end iterator does not cause a CPU exception or any other immediately catchable error, as is normal for many mainstream implementations of std::string on the x86 architecture

  3. In the debug build, the implementation actively causes the program to raise a user-friendly exception upon dereferencing an end iterator, for a price of reduced performance.

As for the second code fragment, it may or may not cause a CPU exception, and a CPU exception may or may not cause a user-friendly error message. The behaviour of it is undefined. It isn't quite clear why you decided that (1) an exception does happen, and (2) it is being silently ignored by an implementation. There is absolutely no evidence that would suggest that. If a CPU exception does happen, the application probably just abnormally terminates without any user-visible error message. Your IDE, having included a debugger, is able to catch the abnormal termination and translate it to a user-friendly error, even for a release build. Outside of the IDE you are on your own.






share|improve this answer

























  • ...but when I purposely dereference a null pointer, the program still does not provoke any error messages when executed OUTSIDE of the MSVC IDE.

    – George Robinson
    Mar 25 at 10:55











  • That's because undefined behaviour is not tied to the IDE, it's a C/C++ concept.

    – Philipp
    Mar 25 at 10:56











  • @Philipp: I doubt that dereferencing a null pointer is an "undefined behavior".

    – George Robinson
    Mar 25 at 10:58







  • 1





    @GeorgeRobinson An implementation is permitted to do what it pleases. Providing debugging aids (only) with a tool meant for debugging is certainly one of the infinite number of things it is permutted to do.

    – n.m.
    Mar 25 at 11:02











  • @GeorgeRobinson It very much is.

    – n.m.
    Mar 25 at 11:02















1














Dereferencing the end iterator is undefined behaviour. An implementation is permitted to do what it pleases.



In debug builds, your particular implementation translates this to a nice user friendly error with a human readable message. This is a debugging aid.



In release builds, it does not, because release builds are not meant for debugging. Leaving debugging code in would hurt overall performance.



Addendum. It looks like your analysis of the situation with the first code fragment is as follows.



  1. Dereferencing an end iterator normally causes a CPU exception.

  2. The release build actively silences said exception.

  3. The debug build leaves the exception handled as per the OS default, which causes termination with a nice error message.

This analysis is incorrect. What in happens is as follows:



  1. Dereferencing the end iterator is undefined behaviour. An implementation is permitted to do what it pleases.

  2. In the release build, dereferencing an end iterator does not cause a CPU exception or any other immediately catchable error, as is normal for many mainstream implementations of std::string on the x86 architecture

  3. In the debug build, the implementation actively causes the program to raise a user-friendly exception upon dereferencing an end iterator, for a price of reduced performance.

As for the second code fragment, it may or may not cause a CPU exception, and a CPU exception may or may not cause a user-friendly error message. The behaviour of it is undefined. It isn't quite clear why you decided that (1) an exception does happen, and (2) it is being silently ignored by an implementation. There is absolutely no evidence that would suggest that. If a CPU exception does happen, the application probably just abnormally terminates without any user-visible error message. Your IDE, having included a debugger, is able to catch the abnormal termination and translate it to a user-friendly error, even for a release build. Outside of the IDE you are on your own.






share|improve this answer

























  • ...but when I purposely dereference a null pointer, the program still does not provoke any error messages when executed OUTSIDE of the MSVC IDE.

    – George Robinson
    Mar 25 at 10:55











  • That's because undefined behaviour is not tied to the IDE, it's a C/C++ concept.

    – Philipp
    Mar 25 at 10:56











  • @Philipp: I doubt that dereferencing a null pointer is an "undefined behavior".

    – George Robinson
    Mar 25 at 10:58







  • 1





    @GeorgeRobinson An implementation is permitted to do what it pleases. Providing debugging aids (only) with a tool meant for debugging is certainly one of the infinite number of things it is permutted to do.

    – n.m.
    Mar 25 at 11:02











  • @GeorgeRobinson It very much is.

    – n.m.
    Mar 25 at 11:02













1












1








1







Dereferencing the end iterator is undefined behaviour. An implementation is permitted to do what it pleases.



In debug builds, your particular implementation translates this to a nice user friendly error with a human readable message. This is a debugging aid.



In release builds, it does not, because release builds are not meant for debugging. Leaving debugging code in would hurt overall performance.



Addendum. It looks like your analysis of the situation with the first code fragment is as follows.



  1. Dereferencing an end iterator normally causes a CPU exception.

  2. The release build actively silences said exception.

  3. The debug build leaves the exception handled as per the OS default, which causes termination with a nice error message.

This analysis is incorrect. What in happens is as follows:



  1. Dereferencing the end iterator is undefined behaviour. An implementation is permitted to do what it pleases.

  2. In the release build, dereferencing an end iterator does not cause a CPU exception or any other immediately catchable error, as is normal for many mainstream implementations of std::string on the x86 architecture

  3. In the debug build, the implementation actively causes the program to raise a user-friendly exception upon dereferencing an end iterator, for a price of reduced performance.

As for the second code fragment, it may or may not cause a CPU exception, and a CPU exception may or may not cause a user-friendly error message. The behaviour of it is undefined. It isn't quite clear why you decided that (1) an exception does happen, and (2) it is being silently ignored by an implementation. There is absolutely no evidence that would suggest that. If a CPU exception does happen, the application probably just abnormally terminates without any user-visible error message. Your IDE, having included a debugger, is able to catch the abnormal termination and translate it to a user-friendly error, even for a release build. Outside of the IDE you are on your own.






share|improve this answer















Dereferencing the end iterator is undefined behaviour. An implementation is permitted to do what it pleases.



In debug builds, your particular implementation translates this to a nice user friendly error with a human readable message. This is a debugging aid.



In release builds, it does not, because release builds are not meant for debugging. Leaving debugging code in would hurt overall performance.



Addendum. It looks like your analysis of the situation with the first code fragment is as follows.



  1. Dereferencing an end iterator normally causes a CPU exception.

  2. The release build actively silences said exception.

  3. The debug build leaves the exception handled as per the OS default, which causes termination with a nice error message.

This analysis is incorrect. What in happens is as follows:



  1. Dereferencing the end iterator is undefined behaviour. An implementation is permitted to do what it pleases.

  2. In the release build, dereferencing an end iterator does not cause a CPU exception or any other immediately catchable error, as is normal for many mainstream implementations of std::string on the x86 architecture

  3. In the debug build, the implementation actively causes the program to raise a user-friendly exception upon dereferencing an end iterator, for a price of reduced performance.

As for the second code fragment, it may or may not cause a CPU exception, and a CPU exception may or may not cause a user-friendly error message. The behaviour of it is undefined. It isn't quite clear why you decided that (1) an exception does happen, and (2) it is being silently ignored by an implementation. There is absolutely no evidence that would suggest that. If a CPU exception does happen, the application probably just abnormally terminates without any user-visible error message. Your IDE, having included a debugger, is able to catch the abnormal termination and translate it to a user-friendly error, even for a release build. Outside of the IDE you are on your own.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 25 at 19:22

























answered Mar 25 at 10:45









n.m.n.m.

75.3k888174




75.3k888174












  • ...but when I purposely dereference a null pointer, the program still does not provoke any error messages when executed OUTSIDE of the MSVC IDE.

    – George Robinson
    Mar 25 at 10:55











  • That's because undefined behaviour is not tied to the IDE, it's a C/C++ concept.

    – Philipp
    Mar 25 at 10:56











  • @Philipp: I doubt that dereferencing a null pointer is an "undefined behavior".

    – George Robinson
    Mar 25 at 10:58







  • 1





    @GeorgeRobinson An implementation is permitted to do what it pleases. Providing debugging aids (only) with a tool meant for debugging is certainly one of the infinite number of things it is permutted to do.

    – n.m.
    Mar 25 at 11:02











  • @GeorgeRobinson It very much is.

    – n.m.
    Mar 25 at 11:02

















  • ...but when I purposely dereference a null pointer, the program still does not provoke any error messages when executed OUTSIDE of the MSVC IDE.

    – George Robinson
    Mar 25 at 10:55











  • That's because undefined behaviour is not tied to the IDE, it's a C/C++ concept.

    – Philipp
    Mar 25 at 10:56











  • @Philipp: I doubt that dereferencing a null pointer is an "undefined behavior".

    – George Robinson
    Mar 25 at 10:58







  • 1





    @GeorgeRobinson An implementation is permitted to do what it pleases. Providing debugging aids (only) with a tool meant for debugging is certainly one of the infinite number of things it is permutted to do.

    – n.m.
    Mar 25 at 11:02











  • @GeorgeRobinson It very much is.

    – n.m.
    Mar 25 at 11:02
















...but when I purposely dereference a null pointer, the program still does not provoke any error messages when executed OUTSIDE of the MSVC IDE.

– George Robinson
Mar 25 at 10:55





...but when I purposely dereference a null pointer, the program still does not provoke any error messages when executed OUTSIDE of the MSVC IDE.

– George Robinson
Mar 25 at 10:55













That's because undefined behaviour is not tied to the IDE, it's a C/C++ concept.

– Philipp
Mar 25 at 10:56





That's because undefined behaviour is not tied to the IDE, it's a C/C++ concept.

– Philipp
Mar 25 at 10:56













@Philipp: I doubt that dereferencing a null pointer is an "undefined behavior".

– George Robinson
Mar 25 at 10:58






@Philipp: I doubt that dereferencing a null pointer is an "undefined behavior".

– George Robinson
Mar 25 at 10:58





1




1





@GeorgeRobinson An implementation is permitted to do what it pleases. Providing debugging aids (only) with a tool meant for debugging is certainly one of the infinite number of things it is permutted to do.

– n.m.
Mar 25 at 11:02





@GeorgeRobinson An implementation is permitted to do what it pleases. Providing debugging aids (only) with a tool meant for debugging is certainly one of the infinite number of things it is permutted to do.

– n.m.
Mar 25 at 11:02













@GeorgeRobinson It very much is.

– n.m.
Mar 25 at 11:02





@GeorgeRobinson It very much is.

– n.m.
Mar 25 at 11:02



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55330564%2fapps-built-with-vs2017-in-c-in-release-mode-do-not-break-on-unhandled-exceptio%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해