Access Violation after closing program

delphi package - automated exception handling
Post Reply
plunje
Posts: 3
Joined: Mon Apr 20, 2009 3:43 pm

Access Violation after closing program

Post by plunje »

after closing my program i get an access violation. can anyone please give hint which will lead to a solution?

Code: Select all

crashed thread    : 1296
klantcode         : 
versie            : 3.601a 20.04.2009
logboek copy      : k1_
date/time         : 2009-04-20, 13:18:35, 796ms
computer name     : SERVER
user name         : MicroCash <admin>
registered owner  : MicroCash
operating system  : Windows XP Service Pack 3 build 2600
system language   : Dutch
system up time    : 3 days 2 hours
program up time   : 38 seconds
processor         : Intel(R) Pentium(R) 4 CPU 2.80GHz
physical memory   : 688/1279 MB (free/total)
free disk space   : (C:) 45,26 GB
display mode      : 800x600, 32 bit
process id        : $37c
allocated memory  : 10,70 MB
executable        : mc_kassa.exe
exec. date/time   : 2009-04-20 13:11
compiled with     : Delphi 2006/07
madExcept version : 3.0h
[]
callstack crc     : $4dda6542, $ea59495a, $412a61ff
count             : 2
exception number  : 1
exception class   : EAccessViolation
exception message : Access violation at address 4DDA6542. Read of address 4DDA6542.

Main ($1bc):
4dda6542 +0000 ???
7c90e470 +0010 ntdll.dll                       KiUserCallbackDispatcher
004048d4 +0008 mc_kassa.exe System    136   +0 TObject.Free
004c719b +0007 mc_kassa.exe Controls           DoneControls
004c77f3 +0023 mc_kassa.exe Controls           Finalization
004054c9 +0039 mc_kassa.exe System    136   +0 FinalizeUnits
00450440 +0054 mc_kassa.exe madExcept          InterceptFinalizeUnits
0040577a +0056 mc_kassa.exe System    136   +0 @Halt0
00a44507 +12b7 mc_kassa.exe kas_proj  836 +469 initialization

thread $1e4 (TOmzetTimerThread): <priority:-1>
7c90d218 +0a ntdll.dll                     NtDelayExecution
7c7d23eb +4b kernel32.dll                  SleepEx
7c7d2450 +0a kernel32.dll                  Sleep
004e0fbd +01 mc_kassa.exe IdGlobal         Sleep
008094ed +31 mc_kassa.exe beginsch  559 +9 TOmzetTimerThread.Execute
00450f33 +2b mc_kassa.exe madExcept        HookedTThreadExecute
004780a0 +34 mc_kassa.exe Classes          ThreadProc
00405860 +28 mc_kassa.exe System    136 +0 ThreadWrapper
00450e15 +0d mc_kassa.exe madExcept        CallThreadProcSafe
00450e7f +37 mc_kassa.exe madExcept        ThreadExceptFrame
>> created by Main ($1bc) at:
0080948b +23 mc_kassa.exe beginsch  545 +1 TOmzetTimerThread.Create

thread $944:
7c90daa8 +0a ntdll.dll              NtReplyWaitReceivePortEx
00450e15 +0d mc_kassa.exe madExcept CallThreadProcSafe
00450e7f +37 mc_kassa.exe madExcept ThreadExceptFrame
>> created by Main ($1bc) at:
77dadf36 +00 RPCRT4.dll

thread $f00:
7c90d218 +0a ntdll.dll              NtDelayExecution
7c7d23eb +4b kernel32.dll           SleepEx
7c7d2450 +0a kernel32.dll           Sleep
00450e15 +0d mc_kassa.exe madExcept CallThreadProcSafe
00450e7f +37 mc_kassa.exe madExcept ThreadExceptFrame
>> created by Main ($1bc) at:
774efd64 +00 ole32.dll

thread $a40: <priority:15>
7c90df48 +0a ntdll.dll              NtWaitForMultipleObjects
00450e15 +0d mc_kassa.exe madExcept CallThreadProcSafe
00450e7f +37 mc_kassa.exe madExcept ThreadExceptFrame
>> created by Main ($1bc) at:
76b0af6e +00 winmm.dll

thread $9cc:
7c90daa8 +0a ntdll.dll              NtReplyWaitReceivePortEx
00450e15 +0d mc_kassa.exe madExcept CallThreadProcSafe
00450e7f +37 mc_kassa.exe madExcept ThreadExceptFrame
>> created by thread $944 at:
77dadf36 +00 RPCRT4.dll

modules:
00400000 mc_kassa.exe                  c:
0ab50000 vnchooks.dll 1.1.0.0          C:\mcvnc
0aec0000 BRLHL04B.DLL 0.3.0.0          C:\WINDOWS\System32\spool\DRIVERS\W32X86\3
0c340000 xpsp2res.dll 5.1.2600.5512    C:\WINDOWS\system32
10000000 Niphk.dll    7.10.0.1         C:\Norman\nvc\bin
5d4e0000 comctl32.dll 5.82.2900.5512   C:\WINDOWS\system32
60660000 nrplib.dll   7.10.16.1        C:\Norman\npm\bin
6a900000 BRUHL04B.DLL 0.3.0.0          C:\WINDOWS\System32\spool\DRIVERS\W32X86\3
719d0000 mswsock.dll  5.1.2600.5625    C:\WINDOWS\System32
71a20000 WS2HELP.dll  5.1.2600.5512    C:\WINDOWS\system32
71a30000 WS2_32.dll   5.1.2600.5512    C:\WINDOWS\system32
71a50000 wsock32.dll  5.1.2600.5512    C:\WINDOWS\system32
71b80000 SAMLIB.dll   5.1.2600.5512    C:\WINDOWS\system32
72f70000 winspool.drv 5.1.2600.5512    C:\WINDOWS\system32
746a0000 MSCTF.dll    5.1.2600.5512    C:\WINDOWS\system32
75250000 msctfime.ime 5.1.2600.5512    C:\WINDOWS\system32
76330000 IMM32.DLL    5.1.2600.5512    C:\WINDOWS\system32
76350000 comdlg32.dll 6.0.2900.5512    C:\WINDOWS\system32
76af0000 winmm.dll    5.1.2600.5512    C:\WINDOWS\system32
76bb0000 PSAPI.dll    5.1.2600.5512    C:\WINDOWS\system32
76ee0000 DNSAPI.dll   5.1.2600.5625    C:\WINDOWS\system32
76f20000 WLDAP32.dll  5.1.2600.5512    C:\WINDOWS\system32
76f80000 rasadhlp.dll 5.1.2600.5512    C:\WINDOWS\system32
76f90000 CLBCATQ.DLL  2001.12.4414.700 C:\WINDOWS\system32
77010000 COMRes.dll   2001.12.4414.700 C:\WINDOWS\system32
770e0000 oleaut32.dll 5.1.2600.5512    C:\WINDOWS\system32
77390000 comctl32.dll 6.0.2900.5512    C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83
774a0000 ole32.dll    5.1.2600.5512    C:\WINDOWS\system32
77650000 NTMARTA.DLL  5.1.2600.5512    C:\WINDOWS\system32
778e0000 SETUPAPI.dll 5.1.2600.5512    C:\WINDOWS\system32
77bd0000 version.dll  5.1.2600.5512    C:\WINDOWS\system32
77be0000 msvcrt.dll   7.0.2600.5512    C:\WINDOWS\system32
77da0000 RPCRT4.dll   5.1.2600.5512    C:\WINDOWS\system32
77e40000 GDI32.dll    5.1.2600.5698    C:\WINDOWS\system32
77e90000 SHLWAPI.dll  6.0.2900.5512    C:\WINDOWS\system32
77f10000 Secur32.dll  5.1.2600.5753    C:\WINDOWS\system32
77f40000 ADVAPI32.dll 5.1.2600.5755    C:\WINDOWS\system32
7c7d0000 kernel32.dll 5.1.2600.5781    C:\WINDOWS\system32
7c900000 ntdll.dll    5.1.2600.5755    C:\WINDOWS\system32
7c9c0000 shell32.dll  6.0.2900.5622    C:\WINDOWS\system32
7e390000 USER32.dll   5.1.2600.5512    C:\WINDOWS\system32
7e520000 UNIDRVUI.DLL 0.3.6000.20691   C:\WINDOWS\System32\spool\DRIVERS\W32X86\3

processes:
000 Idle
004 System             normal
544 smss.exe           normal C:\WINDOWS\system32
584 csrss.exe          normal C:\WINDOWS\system32
59c winlogon.exe       high   C:\WINDOWS\system32
5c8 services.exe       normal C:\WINDOWS\system32
5d4 lsass.exe          normal C:\WINDOWS\system32
68c ELOGSVC.EXE        normal C:\Norman\Npm\bin
6a4 svchost.exe        normal C:\WINDOWS\system32
6d0 svchost.exe        normal C:\WINDOWS\system32
7b8 svchost.exe        normal C:\WINDOWS\System32
094 Zanda.exe          normal C:\Norman\Npm\Bin
0fc nvoy.exe           normal C:\Norman\npm\bin
1c0 svchost.exe        normal C:\WINDOWS\System32
234 svchost.exe        normal C:\WINDOWS\System32
2c4 Explorer.EXE       normal C:\WINDOWS
314 spoolsv.exe        normal C:\WINDOWS\system32
69c TCAUDIAG.exe       normal C:\WINDOWS\system32
1f8 ZLH.EXE            normal C:\Norman\Npm\Bin
20c LogMeInSystray.exe normal C:\Program Files\LogMeIn\x86
260 msmsgs.exe         normal C:\Program Files\Messenger
2b8 ctfmon.exe         normal C:\WINDOWS\system32
414 LMIGuardian.exe    normal C:\Program Files\LogMeIn\x86
41c mcvnc_run.exe      normal C:\mcvnc
428 svchost.exe        normal C:\WINDOWS\System32
488 awhost32.exe       normal C:\Program Files\Symantec\pcAnywhere
4bc RaMaint.exe        normal C:\Program Files\LogMeIn\x86
6fc LogMeIn.exe        normal C:\Program Files\LogMeIn\x86
288 LMIGuardian.exe    normal C:\Program Files\LogMeIn\x86
0e8 nvsvc32.exe        normal C:\WINDOWS\System32
404 HPZipm12.exe       normal C:\WINDOWS\system32
4c4 SMAgent.exe        normal C:\Program Files\Analog Devices\SoundMAX
750 svchost.exe        normal C:\WINDOWS\System32
76c WinVNC.exe         normal C:\Program Files\TightVNC
29c Nvcsched.exe       normal C:\Norman\Npm\Bin
3c0 Njeeves.exe        normal C:\Norman\Npm\Bin
a88 alg.exe            normal C:\WINDOWS\System32
eb8 NSESVC.EXE         normal C:\Norman\nse\bin
364 Nip.exe            normal C:\Norman\Nvc\Bin
f7c nvcoas.exe         normal C:\Norman\Nvc\bin
ee8 cclaw.exe          normal C:\Norman\Nvc\Bin
828 mctrans.exe        normal c:\mctrans
610 winvncvista012.exe normal C:\mcvnc
37c mc_kassa.exe       normal c:

hardware:
+ Beeldschermadapters
  - LogMeIn Mirror Driver (driver 7.1.542.0)
  - NVIDIA GeForce4 MX 4000 (driver 5.2.1.6)
+ Besturing voor geluid, video en spelletjes
  - Audiocodecs
  - Legacy-audiostuurprogramma's
  - Legacy-videovastlegapparaten
  - Mediabeheerapparaten
  - SoundMAX Integrated Digital Audio (driver 5.12.1.3583)
  - Videocodecs
+ Computer
  - ACPI Uniprocessor-pc
+ Diskettestationcontrollers
  - Standaarddiskettestationcontroller
+ Diskettestations
  - Diskettestation
+ Dvd-/cd-rom-stations
  - LITEON CD-ROM LTN526D
+ IDE ATA/ATAPI-controllers
  - Intel(R) 82801EB Ultra ATA Storage Controllers (driver 5.0.1007.0)
  - Primair IDE-kanaal
  - Secundair IDE-kanaal
+ IEEE 1394 Bus Host Controllers
  - OHCI Compliant IEEE 1394 Host Controller
+ Monitors
  - COMPAQ V70-kleurenmonitor
+ Muizen en andere aanwijsapparaten
  - Microsoft PS/2-muis
+ Netwerkadapters
  - 1394-netwerkkaart
  - 3Com Gigabit LOM (3C940) (driver 1.0.0.42)
  - Realtek RTL8139/810x Family Fast Ethernet NIC #2 (driver 5.602.619.2003)
+ Poorten (COM & LPT)
  - Communicatiepoort (COM1)
  - Communicatiepoort (COM2)
  - ECP-printerpoort (LPT1)
+ Printers
  - Brother HL-2030 series (driver 3.19.0.0)
  - OKIPAGE 14ex (driver 5.1.2600.2180)
  - OKIPAGE 14ex (driver 5.1.2600.1106)
+ Processors
  - Intel(R) Pentium(R) 4 CPU 2.80GHz
+ Schijfstations
  - Maxtor 6Y080P0
+ Systeemapparaten
  - ACPI-aan/uit-knop
  - ACPI-vaste-functieknop
  - BIOS-stuurprogramma voor Microsoft Systeembeheer
  - Controller voor directe geheugentoegang
  - Intel(R) 82801EB LPC Interface Controller - 24D0 (driver 5.0.1006.0)
  - Intel(R) 82801EB PCI Bridge - 244E (driver 5.0.1006.0)
  - Intel(R) 82801EB SMBus Controller - 24D3 (driver 5.0.1006.0)
  - Intel(R) 82865G\PE\P Processor to AGP Controller - 2571 (driver 5.0.1006.0)
  - Intel(R) 82865G\PE\P Processor to I/O Controller - 2570 (driver 5.0.1006.0)
  - ISAPNP Read Data-poort
  - Microcode Update-apparaat
  - Moederbordbronnen
  - Moederbordbronnen
  - Moederbordbronnen
  - Numerieke-gegevensprocessor
  - PCI-bus
  - Printer Poort logische interface
  - Programmeerbare interruptcontroller
  - Stuurprogramma voor muis van Terminal Server
  - Systeem dat voldoet aan Microsoft ACPI
  - Systeem-CMOS/Real-timeklok
  - Systeemkaart
  - Systeemluidspreker
  - Systeemtimer
  - Teller voor Plug en Play-apparatuur
  - Toestenbordstuurprogramma voor Terminal Server
  - Volumebeheer
+ Toetsenborden
  - Standaardtoetsenbord (101/102 toetsen) of Microsoft Natural PS/2-toetsenbord
+ USB-controllers
  - Intel(R) 82801EB USB Universal Host Controller - 24D2 (driver 5.0.1006.0)
  - Intel(R) 82801EB USB Universal Host Controller - 24D4 (driver 5.0.1006.0)
  - Intel(R) 82801EB USB Universal Host Controller - 24D7 (driver 5.0.1006.0)
  - Intel(R) 82801EB USB Universal Host Controller - 24DE (driver 5.0.1006.0)
  - Ondersteuning voor USB-afdrukken
  - Ondersteuning voor USB-afdrukken
  - Standard Enhanced PCI naar USB-hostcontroller
  - USB-hoofdhub
  - USB-hoofdhub
  - USB-hoofdhub
  - USB-hoofdhub
  - USB-hoofdhub

cpu registers:
eax = 7ffdf000
ebx = 00000000
ecx = 40000000
edx = 00000002
esi = 4dda6542
edi = 0012fdf8
eip = 4dda6542
esp = 0012fd94
ebp = 0012fdbc

stack dump:
0012fd94  34 87 39 7e 4c 03 0c 00 - 1c 00 00 00 00 00 00 00  4.9~L...........
0012fda4  c8 02 00 00 42 65 da 4d - cd ab ba dc 00 00 00 00  ....Be.M........
0012fdb4  f8 fd 12 00 42 65 da 4d - 24 fe 12 00 16 88 39 7e  ....Be.M$.....9~
0012fdc4  42 65 da 4d 4c 03 0c 00 - 1c 00 00 00 00 00 00 00  Be.ML...........
0012fdd4  c8 02 00 00 00 00 00 00 - 4c 03 0c 00 01 d8 91 0c  ........L.......
0012fde4  14 00 00 00 01 00 00 00 - 00 00 00 00 00 00 00 00  ................
0012fdf4  10 00 00 00 00 00 00 00 - 68 fe 12 00 00 00 00 00  ........h.......
0012fe04  00 00 00 00 00 00 00 00 - d8 fd 12 00 b8 f9 12 00  ................
0012fe14  68 fe 12 00 8f 04 3c 7e - 30 88 39 7e ff ff ff ff  h.....<~0.9~....
0012fe24  78 fe 12 00 a0 8e 3a 7e - 00 00 00 00 42 65 da 4d  x.....:~....Be.M
0012fe34  4c 03 0c 00 1c 00 00 00 - 00 00 00 00 c8 02 00 00  L...............
0012fe44  64 53 40 0a 01 00 00 00 - e0 eb a3 00 40 41 9a 0a  dS@.........@A..
0012fe54  01 d8 91 0c 00 00 04 00 - 00 00 00 00 4c fe 12 00  ............L...
0012fe64  b8 f9 12 00 f8 fe 12 00 - 8f 04 3c 7e b0 8e 3a 7e  ..........<~..:~
0012fe74  ff ff ff ff a0 fe 12 00 - ec 8e 3a 7e 50 53 40 0a  ..........:~PS@.
0012fe84  1c 00 00 00 00 00 00 00 - c8 02 00 00 42 65 da 4d  ............Be.M
0012fe94  00 00 00 00 00 00 00 00 - 00 00 00 00 04 ff 12 00  ................
0012fea4  73 e4 90 7c b0 fe 12 00 - 18 00 00 00 50 53 40 0a  s..|........PS@.
0012feb4  1c 00 00 00 00 00 00 00 - c8 02 00 00 42 65 da 4d  ............Be.M
0012fec4  53 8e 3a 7e a8 b1 3a 7e - 4f 95 4d 00 b4 00 16 00  S.:~..:~O.M.....

disassembling:
004048cc     public System.TObject.Free:      ; function entry point
004048cc 136   test    eax, eax
004048ce       jz      loc_4048d7
004048d0       mov     dl, 1
004048d2       mov     ecx, [eax]
004048d4     > call    dword ptr [ecx-4]
004048d7       ret

Nico Bendlin
Posts: 46
Joined: Fri Apr 28, 2006 1:17 pm

Post by Nico Bendlin »

An invalid object is freed in Controls.DoneControls on unit finalization (candidates: FlagControl, Application, Screen, Mouse, CanvasList).
plunje
Posts: 3
Joined: Mon Apr 20, 2009 3:43 pm

Post by plunje »

any idea how to track which object it is? it's difficult to find since which version of our software has the bug, the bug sometimes show up, and now he seem to be disapaered :S
uko
Posts: 25
Joined: Thu May 29, 2008 2:14 pm

Post by uko »

I would also have a look for this thread: TOmzetTimerThread
maybe this is intercepting.

Also you can include FastMM with full debug mode. This should give you a report when accessing alread freed objects.

Uli
plunje
Posts: 3
Joined: Mon Apr 20, 2009 3:43 pm

Post by plunje »

thanx for the reply. i solved it, it was a nasty bug which causes freeing non-existing objects.
Post Reply