T O P I C R E V I E W |
spurgeon |
Posted - Nov 24 2014 : 09:30:29 I get an intermittent access violation (happens occasionally) when freeing a TImageEnView: "Access violation at address 0092876F in module 'WFV.exe'. Read of address 0A8D076A." An example stack trace is here:
main thread ($3c0): 0092876f +00f WFV.exe imageenview 17632 +2 TImageEnView.CNKEYDOWN 005bcd69 +2bd WFV.exe Vcl.Controls TControl.WndProc 005c17fd +5c5 WFV.exe Vcl.Controls TWinControl.WndProc 005c0e40 +02c WFV.exe Vcl.Controls TWinControl.MainWndProc 00545e84 +014 WFV.exe System.Classes StdWndProc 773b642b +02b ntdll.dll KiUserCallbackDispatcher 75ce7690 +044 USER32.dll SendMessageW 006b3a18 +084 WFV.exe Vcl.Forms TApplication.IsKeyMsg 006b3cbf +0cf WFV.exe Vcl.Forms TApplication.ProcessMessage 006b3d26 +00a WFV.exe Vcl.Forms TApplication.HandleMessage 006b4061 +0c9 WFV.exe Vcl.Forms TApplication.Run 0111f90f +27b WFV.exe WFV 212 +92 initialization 76c01172 +010 kernel32.dll BaseThreadInitThunk
These errors always seem to originate in imageenview.pas, either line 17632 or 17633 (more frequently line 17633), which are these:
if assigned(fOnVirtualKey) then fOnVirtualKey(self, Message.wParam, Message.lParam, true);
Occasionally, the stack trace will have one more line at the top (above imageenview 17632 or 17633), which is the point of the access violation:
00933785 +059 WFV.exe hyieutils 1019 +0 .TIEICC
Line 1019 of hyieutils is:
procedure CopyPaletteTo(Dest: TIEBaseBitmap); virtual; abstract;
Does anyone have ideas why I get these errors and how I can fix the issue?
Here are some more details: - Delphi XE3 - ImageEn 5.2.0 (although this issue happens in previous versions as well) - I load a TImageEnVect into a TFrame on my form when opening an image file, and the TImageEnVect gets freed when destroying the frame - I recompile ImageEn from source myself with very minor edits (e.g., enable ielib32.dll for faster loading and move it to 'lib\ielib32.dll')
I'd be happy to supply other details if it would help. Not blaming ImageEn at all here, but without more knowledge of the inner workings of it, it's tough to debug. Thanks. |
4 L A T E S T R E P L I E S (Newest First) |
spurgeon |
Posted - Nov 24 2014 : 14:44:33 Thanks for the help. Yes, I used madExcept to give the prior stack trace.
After commenting out events from TImageEnView and testing, I'm still seeing the issue. I think your comments about some kind of application event causing this are probably correct, and I'll have to keep chopping sections of code or create a mini project as you stated until I figure out the root cause.
It was the stack trace with TImageEnView.CNKEYDOWN that triggered me to post to this forum, but I think it is unrelated to ImageEn in the end. I appreciate the help and will keep debugging--hoping for that "aha" moment to come sooner rather than later. |
w2m |
Posted - Nov 24 2014 : 12:38:50 Try commenting the code in all your events to see if the problem persists. Without seeing you actual code it is impossible to help more. Generally some of the most difficult things to debug is event code. Sometime you may think the error is in the ImageEn component when the source of the problem is your own code.
The other thing to try is to create a mini demo project that duplicates much of your app with out any code. Run the demo and see if the problem persists then add more code one event at a time and repeat the process until you find the source of the problem.
Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development |
spurgeon |
Posted - Nov 24 2014 : 12:33:55 That's just the thing. I have not assigned the OnKeyDown event. I have defined OnMouseDown, OnMouseEnter, and OnMouseLeave. Could these be related? Should I try deactivating the mouse events when the frame is being destroyed? Confused. |
w2m |
Posted - Nov 24 2014 : 12:04:05 Show the actual code in the TImsgeenView.OnKeyDown event.
I doubt imageen code is causing the problem... unless your modifications are causing the problem. I suspect the problem is caused by your code at the application level and not in the component itself. All we have to do is see the what is triggering the exception. Have you tried using MadExcept or EurekaLog to try to find the point where the code is failing? Does the exception occur only when closing the form?
Bill Miller Adirondack Software & Graphics Email: w2m@hughes.net EBook: http://www.imageen.com/ebook/ Custom Commercial ImageEn Development |