Delphi Runtime Error 216 Debug
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers
Delphi Runtime Error 216 Windows 7
or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question delphi runtime error 217 x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them;
Delphi Runtime Error 105
it only takes a minute: Sign up How to debug a crash that only occurs on application shutdown? (Delphi) up vote 13 down vote favorite 3 So, after some recent changes we discovered that one of our oldest applications is runtime error 216 skype sometimes crashing on shutdown. This manifests itself either in the form of "Runtime error 216" messages or in a message from Windows Error Reporting that the application has stopped working. The application is already emitting OutputDebugString-messages at every turn and AFAICT all of our own code gets executed correctly to completion. All destructors are called as are all finalization sections and class destructors, none of which are raising any exceptions. Also, neither madExcept nor FastMM4's Full Debug Mode seem to runtime error 216 pascal have anything to complain about (though that might be a false conclusion because the crash might happen even before those components' own finalization code runs). So, what would you do? Where would you start? This question is supposed to be more about the general approach to this class of problems than about the specific instance I'm currently facing so I'm deliberately leaving out details. Feel free to ask if you think they might be relevant to the choice of debugging approach and I will add them later. delphi debugging crash application-shutdown share|improve this question edited Mar 3 '11 at 13:30 asked Mar 3 '11 at 13:11 Oliver Giesen 6,42233370 3 There is a VCL bug that manifests as AVs on shutdown. It's related to Owner destruction of forms. I work around it by explicitly closing forms in the .dpr file after Application.Run. If you let Application do the closing for you there can be problems with stale references. –David Heffernan Mar 3 '11 at 13:54 @David: That sounds interesting. Do you have a QC number for that? However, except for the main form I'm creating all forms in code with the respective parent form as the Owner. Would the issue you're talking about apply in that case as well? –Oliver Giesen Mar 3 '11 at 13:59 if you are relying the destruction of Application to bring everything else down, then the
errors take the form: Copy Code Runtime error nnn at xxxxxxxx where http://stackoverflow.com/questions/5181124/how-to-debug-a-crash-that-only-occurs-on-application-shutdown-delphi nnn is the runtime error number, and xxxxxxxx is the runtime error address. Applications that use the SysUtils class map most runtime errors to http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/delphiruntimeerrors_xml.html Exceptions, which allow your application to resolve the error without terminating. Types of Runtime Errors Delphi runtime errors are divided into the following categories: I/O errors, numbered 100 through 149 Fatal errors, numbered 200 through 255 Operating system errors See Also Exception handling Resolving internal errors Fatal errors I/O errors Operating system errors Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved. What do you think about this topic? Send feedback!
"Error boxes": - Runtime Error 217 at xxxxxxx - Runtime Error 216 at xxxxxxx The thing that is different in this application (to my others) is that I am experimenting with run-time packages and runtime class and form creation. http://www.delphigroups.info/2/a9/513996.html Does somebody have a clue where this errors might arise? When tracing them they appear https://www.experts-exchange.com/questions/20444643/Runtime-error-216-on-closing-application-again.html nowhere in the code (not even the CPU window pops up!) Mainly the 217 (float error) puzzles me.... Wolfgang Bures Bures EDV http://www.bures.at jasper.fries Delphi Developer Sat, 05 Jun 2004 20:37:43 GMT Re:Runtime Error 217 and 216 on Application Close Hallo Wolfgang, I have had the same effect two weeks ago. You get an exception before the order Application.Run. 1. Look runtime error into your projectfile Name.dpr: Did you wrote sourcecode there? Please check it. 2. Look into the Initialize- section from your units which you are using in your project. Is there anything wrong? Hope that helps you to solve your problem. Regard Jasper Friese Jens Geye Delphi Developer Sat, 05 Jun 2004 20:38:13 GMT Re:Runtime Error 217 and 216 on Application Close The errors occur AFTER the VCL exception handler has been removed. The source of these runtime error 216 ususally hard-to-track errors is caused by any of your unit FINALIZATION codes. Such problems often occur also when dangling pointers are contained in your application main form, they are causing GPFs when the unit Forms destroys the application main window during it's own finalization code. Probably you might have an problem caused by the order, in which units are initialized and finalized. The only thing to track down these errors is - turn "use VCL debug libs" on - recompile the whole project - use the de{*word*81} and step through the finalization code on application exit I know that this is a little painful, maybe someone knows a better way to find the error. JensG Herman Hofma Delphi Developer Sun, 06 Jun 2004 00:04:44 GMT Re:Runtime Error 217 and 216 on Application Close Wolfgang & Jens, That way, you can step useing the System.pas routines InitUnits (initialization) and FInitUnits (Finalization). Use those functions to step/trace (using breakpoints?) You can also create your own InitDoneProc and load those before Application.Run (after all Delphi/3rd party components) an unload after Application.Run (before all Delphi/3rd party components). This works for me: procedure InitAllUnits; begin for i := 0 to List.Count-1 do try OutputDebugString(....) List[i].init; OutputDebugString(....) except OutputDebugString(....) [Error handling here...] end; end; Herman. "Jens Geyer"
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Runtime error 216 on closing application (again) Want to Advertise Here? Solved Runtime error 216 on closing application (again) Posted on 2003-01-05 Delphi 1 Verified Solution 27 Comments 6,250 Views Last Modified: 2012-05-04 Dear Experts, [cross-posted to www.nldelphi.com] I'm troubled by an annoying but otherwise harmless run-time error 216 that my application generates on closing. The source code is too long to post, and I am unable to locate the code that causes the error, so I will try to just give a short description of the program: - DB application, uses MS Access and Delphi built-in data aware components and own db-aware components. One of these (the only 'non-cosmetic' descendant) is a data-aware twebbrowser descendant. - Uses subforms by docking other forms into the mainform - Uses gsapi (ghostscript dll) and wingraphvi (com component). - Uses interfaces for most interobject communication The vague thing is that the error seems to disappear and reappear as I continue to work on the application, even if I add or remove things that seem completely unrelated. However, if the error occurs restarting the application never changes that. The only thing that seems to have effect is not connecting to the access database, which (usually) causes the error not to appear. I am using a win2k machine with D6 and D7 installed, both versions generate the error. The nasty thing is that if I trace my closing code (even with the VCL components in the search path) the error seems to occur *after* the last line of code, which is de finalization of ADODB. It traces through the whole Form.DoneApplication down to the last 'end;', then into ADODB. After hitting f7 on the last 'end;' there, it gives an Access Violation followed by a Runtime Error if I hit f7 again. Most forums on the Net seem to hint that I might be trying to free an object that the VCL will want to free later, or free an object multiple times. However, commenting out all lines that free objects (except for the obvious StringLists, Inifiles etc.) does not solve the problem. Freeing or not freeing my datamodule also does not seem to do