<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.js-issue-title
        {mso-style-name:js-issue-title;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:windowtext'>For  anyone who didn’t see in in my other message.. the only reason I didn’t see the debug info before was because I was redirecting stderr to a file then echoing the file to the screen.. but with a full disk, no more could be written into my log file, therefore the file ended just before the error.   <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>It’s the one case the logging stderr to a file the echoing the file to console could not work.  Widnows doesn’t have a really good way to send output to the console and a file at the same time.<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>In combination with this the errorcode being displayed as a negative number put it into the category of “things zero or less” which made my batch file treat it as a normal exit.   <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>It was my batch file that was failing to function correctly.   <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><div><p class=MsoNormal><span style='color:windowtext'>James<o:p></o:p></span></p></div><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='color:windowtext'>From:</span></b><span style='color:windowtext'> fpc-pascal <fpc-pascal-bounces@lists.freepascal.org> <b>On Behalf Of </b>James Richters<br><b>Sent:</b> Thursday, May 16, 2019 7:31 AM<br><b>To:</b> 'FPC-Pascal users discussions' <fpc-pascal@lists.freepascal.org><br><b>Subject:</b> Re: [fpc-pascal] unexpected termination with no errors<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:windowtext'>Once I fixed my batch file I am getting exactly this:<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>An unhandled exception occurred at $004E4B4C:<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>EInOutError: Disk Full<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>  $004E4B4C  GETDATA,  line 19078 of pastep.pas<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>  $004E9695  GETAFILE,  line 19997 of pastep.pas<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>  $004EB74E  GETALIPSE,  line 20159 of pastep.pas<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>  $004E6884  LOADIT,  line 19159 of pastep.pas<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'>  $0041B86A  main,  line 4155 of i:/programming/gcode/mill/promill.pas<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>Error Code: -1073741819<o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>And yes my  drive really is full.    <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:windowtext'>I am able to do a jump in my batch file based on the negative error code and send it to where all the other error conditions go.   <o:p></o:p></span></p><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><div><p class=MsoNormal><span style='color:windowtext'>James<o:p></o:p></span></p></div><p class=MsoNormal><span style='color:windowtext'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='color:windowtext'>From:</span></b><span style='color:windowtext'> fpc-pascal <<a href="mailto:fpc-pascal-bounces@lists.freepascal.org">fpc-pascal-bounces@lists.freepascal.org</a>> <b>On Behalf Of </b>Gary Doades<br><b>Sent:</b> Wednesday, May 15, 2019 12:11 PM<br><b>To:</b> <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br><b>Subject:</b> Re: [fpc-pascal] unexpected termination with no errors<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><pre>Windows represents exception codes as an unsigned int. The error -1073741819 is actually <span class=js-issue-title>0xC0000005.</span><o:p></o:p></pre><pre><span class=js-issue-title>This represents some form of access violation, usually associated with trying to write to freed memory, double freeing memory etc.<o:p></o:p></span></pre><pre><span class=js-issue-title><o:p> </o:p></span></pre><pre><span class=js-issue-title>If the stack is involved/corrupted then a trackback and useful information would be difficult.</span><o:p></o:p></pre><pre><span class=js-issue-title>Whereabouts down the line a disk full translates into an access violation is difficult to say, but it results in a mess to say the least.<o:p></o:p></span></pre><pre><span class=js-issue-title>Regards,</span><o:p></o:p></pre><pre><span class=js-issue-title>Gary.<o:p></o:p></span></pre><div><p class=MsoNormal>On 15/05/2019 16:43, James Richters wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>It's a simple single thread console app.   I found my problem...  years ago I implemented a batch file to run my program in the test environment to help be with debugging... and what it does is redirect the errors to a file so that if flashed by real quick, I would be able to just look at the file.   Then I just echo the file to the screen, and if I detect an error, I also pause so I can see it.    This a common solution to the windows limitation of not be capable directing STDERR to console AND to a file.   <o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Well the file wasn't reporting the error and it wasn't on the screen... it looked like a normal exit, BUT it was actually giving me the proper report... unfortunately the error was the one thing that my batch file could not possibly display....  EInOutError: Disk Full   DOH!!!  With the disk full my log file could only show up to but not including the error... because it could not write anymore on a full disk... I still don't have a great solution for this... I see methods of implementing something like a Tee function on windows, but the problem is I don't want ALL the output to go to the log, I only want STDERR to go to the log file.... and the screen...  not my output I am sending with the CRT unit that sends colored text for various purposes.  This is such a pain with windows to accomplish this seemingly simple task.    Anyway I know what the problem is and can put in something to detect it.  Maybe I will just check if the errorlevel is negative and if so write a suggestion to the screen that disk full may have caused this and then pause.... since I can't necessarily write anything to the file.<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Does anyone know what the errorlevel for EInOutError: Disk Full is  -1073741819,   (I'm not sure it's always that number... ) is this on purpose?, or a bug?, or a side effect of the disk being full so it can't generate the correct error code?   if it was a normal errorcode I would have got that on my screen but since it's less than zero it got treated like a normal exit.... I did fix my batch file to treat anything less than zero as an error..... so it doesn't really matter, I just didn't know they could be negative, but I'm curious why this strange errorlevel.<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Jim<o:p></o:p></pre><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>-----Original Message-----<o:p></o:p></pre><pre>From: fpc-pascal <a href="mailto:fpc-pascal-bounces@lists.freepascal.org"><fpc-pascal-bounces@lists.freepascal.org></a> On Behalf Of Karoly Balogh (Charlie/SGR)<o:p></o:p></pre><pre>Sent: Wednesday, May 15, 2019 9:17 AM<o:p></o:p></pre><pre>To: FPC-Pascal users discussions <a href="mailto:fpc-pascal@lists.freepascal.org"><fpc-pascal@lists.freepascal.org></a><o:p></o:p></pre><pre>Subject: Re: [fpc-pascal] unexpected termination with no errors<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Hi,<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>On Wed, 15 May 2019, James Richters wrote:<o:p></o:p></pre><pre><o:p> </o:p></pre><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>Has anyone encountered anything like this before or know how I can <o:p></o:p></pre><pre>make sure I always get the maximum amount of debugging info when my <o:p></o:p></pre><pre>program crashes?<o:p></o:p></pre></blockquote><pre><o:p> </o:p></pre><pre>Is it a subthreaded app?<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>The only case when I noticed something similar (under Linux though), when a certain subthread throws an exception, it just silently disappears without any further handling. It doesn't throw any exception, unless you wrap the entire Execute method in a try-except.<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>(Sidenote: I've been pondering for a while if I should report this as a bug. I think the RTL should put a try-except around there, to show a stacktrace on unhandled exceptions, just like the main thread dying does, but who knows which Delphi de-facto standard behavior would that violate, so meh...)<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>In Linux/Darwin (on x64/ARM at least), only the thread causing the problem dies, no clue what happens under Windows. Maybe this helps.<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Charlie<o:p></o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a> <a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><o:p></o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><o:p></o:p></pre><pre><a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><o:p></o:p></pre></blockquote></div></body></html>