[Issue 11865] New: Unhandled exception does not show crash dialog
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jan 4 18:16:18 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=11865
Summary: Unhandled exception does not show crash dialog
Product: D
Version: D2
Platform: All
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: druntime
AssignedTo: nobody at puremagic.com
ReportedBy: jminer7 at gmail.com
--- Comment #0 from Jordan Miner <jminer7 at gmail.com> 2014-01-04 18:16:11 PST ---
I just spent a couple hours trying to figure out why a Windows program would
run from Command Prompt but not when double clicked from Explorer. Evidently,
trying to write to stdout results in Tango throwing an exception if the program
is started by double clicking, but not when run from the console.
It took me a while to figure out because by default a non-console program
silently swallows an unhandled exception, and the process just disappears.
Programs on Windows normally show a "ProgramName has stopped working" dialog
when they crash. This happens by default for any program (even console
programs) written in C, C++, or .NET without the programmer doing anything. I
believe Windows Error Reporting shows the dialog:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb513641%28v=vs.85%29.aspx
The crash dialog usually supports uploading stack traces to MS servers, but at
a minimum, the native crash dialog should show. (I would want to upload stack
traces to my own server instead of Microsoft's because you have to buy a
VeriSign certificate to access the traces on Microsoft's site. That would
probably take a separate project, like Google Breakpad.)
To reproduce, compile this program:
extern(Windows)
int MessageBoxW(void* hWnd, const(wchar)* lpText, const(wchar)* lpCaption, uint
uType);
void main() {
throw new Exception("You can't see this.");
MessageBoxW(null, "The program opened.", "Opened", 0);
}
using this command:
rdmd -ofmain.exe -L/EXETYPE:NT -L/SUBSYSTEM:WINDOWS:4.0 main.d
Try double clicking it in Explorer, and you don't see the message box or a
crash dialog.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list