0

On/in one specific Win10 VMWare image running Windows Server 2019 Standard, my service gives an

Exception EAccessViolation in module TTSvcScheduler at 00005DAF
Access violation at address 00405DAF in module TTSvcScheduler.exe. 
Read of address 00000068

approximately 0.5 to 1 sec after clicking away the 'Service succesfully installed' popup.
I'm having difficulties finding where the error occurs.

The event log shows:

Faulting application name: TTSvcScheduler.exe, version: 9.4.1.0, time stamp: 0x61d432f4
Faulting module name: TTSvcScheduler.exe, version: 9.4.1.0, time stamp: 0x61d432f4
Exception code: 0xc0000005
Fault offset: 0x00005daf
Faulting process id: 0x5b0
Faulting application start time: 0x01d8016087c01d5a
Faulting application path: C:\Folder\TTSvcScheduler.exe
Faulting module path: C:\Folder\TTSvcScheduler.exe
Report Id: 66b232a0-48d5-43db-8d20-f58aa8d15319
Faulting package full name: 
Faulting package-relative application ID: 

- System 
  - Provider 
   [ Name]  Application Error 
  - EventID 1000 
   [ Qualifiers]  0 
   Level 2 
   Task 100 
   Keywords 0x80000000000000 
  - TimeCreated 
   [ SystemTime]  2022-01-04T11:45:13.510151600Z 
   EventRecordID 27000 
   Channel Application 
   Computer ttxv70 
   Security 
- EventData 
   TTSvcScheduler.exe 
   9.4.1.0 
   61d432f4 
   TTSvcScheduler.exe 
   9.4.1.0 
   61d432f4 
   c0000005 
   00005daf 
   5b0 
   01d8016087c01d5a 
   C:\Folder\TTSvcScheduler.exe 
   C:\Folder\TTSvcScheduler.exe 
   66b232a0-48d5-43db-8d20-f58aa8d15319 
  • It's a Win32 service, built in Delphi Sydney 10.4.2
  • StartType is either stAuto or stManual
  • I have reduced the ServiceCreate, ServiceStart and ServiceAfterInstall to empty handlers
  • 'Normally' the ServiceAfterInstall registers the executable with event log messages, if I then only post an event log message from the ServiceCreate and ServiceStart, the one from ServiceCreate shows, the one from ServiceStart does not (of course, the service is not running yet).
  • The exact same error occurs after the /uninstall popup
  • I ran DISM.exe /Online /Cleanup-image /Restorehealth and sfc /scannow on the machine
  • When built with Debug dcus and a detailed map file I still don't see where the error is (($00405DAF - $401000 = $4DAF Resolve address of AccessViolation in the map file). The map file is here. Sorry, no HTTPS
  • I set the folder with the executable to not read-only

What can be going on/how can I find the error location?
(I can't install my IDE in that VM)

Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
  • 1
    *Read of address 00000068* makes me think that you access a class or record using a nil pointer. 0x68 is the offset of the member you address. Searching in the program what could be in offset 0x68 could help find what is wrong. – fpiette Jan 04 '22 at 13:31
  • You could add a lot of messages in the event log in the hope to catch where the error is. There are also component (I think in JCL or JVCL) to catch a stack trace at time of exception. – fpiette Jan 04 '22 at 13:33
  • @fpiette But after the ServiceCreate the service does not start, intentionally (stManual). The last event log entry is from the Create. There are plenty of other log calls in the code, but these are irrelevant in this stage. – Jan Doggen Jan 04 '22 at 13:40
  • Delphi has a remote debugger so you don't have to install the whole IDE on a machine to debug an executable there. – Brian Jan 04 '22 at 14:39
  • @Brian Thanks, totally forgot that. Let's see if this gets me further. – Jan Doggen Jan 04 '22 at 15:01

0 Answers0