3
votes

I have an XE2 DataSnap server (Windows service) which uses a 3rd party out-of-process COM component within it's methods. Being COM, I understand it requires the CoInitializeEx and CoUninitialize commands around the statements. My DataSnap server is working great, other than the fact that when I stop the service, I always get an 'Application Error' message in the Event Log, along with an 'APPCRASH' information message. I'm sure this is related to the CoInit.. commands. I have none-DataSnap Windows service apps that use the COM component and stop fine with no errors.

I've tried placing the CoInit/CoUninit commands in various places such as ServiceStart/ServiceStop, DSServerClass.OnCreate/DSServerClass.OnDestroy, and at the top/bottom of each server method function, but the crash still occurs when the service is stopped. If I don't call any methods on the server then the service can be stopped with no errors.

Can anybody show me where CoInit/CoUninit should be placed for multi-threaded DataSnap services? Also, should I be using CoInitialize or CoInitializeEx, and which parameter is appropriate - COINIT_MULTITHREADED, COINIT_APARTMENTTHREADED etc?

Event Log Error :

Faulting application name: X365EXHS.exe, version: 1.0.0.0, time stamp: 0x51ba3d97
Faulting module name: X365EXHS.exe, version: 1.0.0.0, time stamp: 0x51ba3d97
Exception code: 0xc0000005
Fault offset: 0x00006138
Faulting process id: 0xed4
Faulting application start time: 0x01ce687fcfde7812
Faulting application path: C:\DEVELOP\X365EXHS.exe
Faulting module path: C:\DEVELOP\X365EXHS.exe
Report Id: 1f933086-d473-11e2-8cab-005056c00008


Fault bucket , type 0
Event Name: APPCRASH
Response: Not available
Cab Id: 0

Problem signature:
P1: X365EXHS.exe
P2: 1.0.0.0
P3: 51ba3d97
P4: X365EXHS.exe
P5: 1.0.0.0
P6: 51ba3d97
P7: c0000005
P8: 00006138
P9: 
P10: 

Attached files:
C:\Users\JonathanW\AppData\Local\Temp\WERF44F.tmp.appcompat.txt

Update :

With more testing I've found that the Access Violation on shutdown only occurs when my DataSnap server is started with the HTTPS protocol, bound to an SSL certificate. It uses the OpenSSL DLLs libeay32.dll and ssleay32.dll so could these be the issue? If I run the server with HTTP (no SSL) then it never AVs when shutdown.

MadExcept Stack Trace

date/time         : 2013-06-15, 09:16:56, 113ms
computer name     : JW-XT2
user name         : JonathanW <admin>
registered owner  : JonathanW
operating system  : Windows 7 Tablet PC x64 Service Pack 1 build 7601
system language   : English
system up time    : 1 day 12 hours
program up time   : 44 seconds
processors        : 2x Intel(R) Core(TM)2 Duo CPU U9400 @ 1.40GHz
physical memory   : 2749/5008 MB (free/total)
free disk space   : (C:) 5.22 GB
display mode      : 1024x768, 32 bit
process id        : $1134
allocated memory  : 19.61 MB
executable        : X365EXHS.exe
exec. date/time   : 2013-06-15 09:14
version           : 1.0.0.0
compiled with     : Delphi XE2
madExcept version : 4.0.7
callstack crc     : $00000000, $00000000, $00000000
exception number  : 1
exception class   : EAccessViolation
exception message : Access violation at address 004061A4 in module 'X365EXHS.exe'. Read of address FFFFFFD0.

thread $5e4:
>> stack not accessible, exception location:
004061a4 +8 X365EXHS.exe System 20958 +0 TObject.InheritsFrom

thread $6f0:
775d1f1f +0b ntdll.dll     NtWaitForWorkViaWorkerFactory
765633a8 +10 kernel32.dll  BaseThreadInitThunk

thread $1cf0:
775d1f1f +0b ntdll.dll     NtWaitForWorkViaWorkerFactory
765633a8 +10 kernel32.dll  BaseThreadInitThunk

thread $1d6c:
775cfd6a +0e ntdll.dll                NtDelayExecution
75153bc2 +5f KERNELBASE.dll           SleepEx
75154493 +0a KERNELBASE.dll           Sleep
004ca205 +0d X365EXHS.exe   madExcept CallThreadProcSafe
004ca26f +37 X365EXHS.exe   madExcept ThreadExceptFrame
765633a8 +10 kernel32.dll             BaseThreadInitThunk
>> created by thread $b70 at:
768eda8e +00 ole32.dll

thread $2a8:
775d0136 +0e ntdll.dll                NtWaitForMultipleObjects
751515e3 +fa KERNELBASE.dll           WaitForMultipleObjectsEx
76561a27 +89 kernel32.dll             WaitForMultipleObjectsEx
7656421b +13 kernel32.dll             WaitForMultipleObjects
004ca205 +0d X365EXHS.exe   madExcept CallThreadProcSafe
004ca26f +37 X365EXHS.exe   madExcept ThreadExceptFrame
765633a8 +10 kernel32.dll             BaseThreadInitThunk
>> created by thread $b70 at:
74751a28 +00 msiltcfg.dll

D ($150):
775cf8aa +0e ntdll.dll                               NtWaitForSingleObject
75151497 +92 KERNELBASE.dll                          WaitForSingleObjectEx
7656118f +3e kernel32.dll                            WaitForSingleObjectEx
76561143 +0d kernel32.dll                            WaitForSingleObject
00455e2a +02 X365EXHS.exe   System.SysUtils          WaitForSyncWaitObj
00455fd7 +1f X365EXHS.exe   System.SysUtils          WaitOrSignalObj
00406cc1 +65 X365EXHS.exe   System          20958 +0 TMonitor.Wait
00406d27 +17 X365EXHS.exe   System          20958 +0 TMonitor.Wait
0072cac0 +b8 X365EXHS.exe   Data.DBXCommon           TDBXScheduler.TDBXSchedulerThread.Execute
004ca323 +2b X365EXHS.exe   madExcept                HookedTThreadExecute
00487e0e +42 X365EXHS.exe   System.Classes           ThreadProc
00407a70 +28 X365EXHS.exe   System          20958 +0 ThreadWrapper
004ca205 +0d X365EXHS.exe   madExcept                CallThreadProcSafe
004ca26f +37 X365EXHS.exe   madExcept                ThreadExceptFrame
765633a8 +10 kernel32.dll                            BaseThreadInitThunk
>> created by thread $1a68 at:
0072c9e7 +1b X365EXHS.exe   Data.DBXCommon           TDBXScheduler.TDBXSchedulerThread.Create

thread $1b68:
775d1f1f +0b ntdll.dll     NtWaitForWorkViaWorkerFactory
765633a8 +10 kernel32.dll  BaseThreadInitThunk

thread $10f8:
775d1f1f +0b ntdll.dll     NtWaitForWorkViaWorkerFactory
765633a8 +10 kernel32.dll  BaseThreadInitThunk

modules:
00400000 X365EXHS.exe    1.0.0.0            C:\DEVELOP\DELPHI\eXchequer365\X365EXHS\Win32\Release
11000000 libeay32.dll    1.0.1.5            C:\ENTPV702
12000000 ssleay32.dll    1.0.1.5            C:\ENTPV702
704f0000 FaultRep.dll    6.1.7601.17514     C:\Windows\system32
70dd0000 msi.dll         5.0.7601.17807     C:\Windows\system32
71010000 comctl32.dll    6.10.7601.17514    C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2
71f70000 SXS.DLL         6.1.7601.17514     C:\Windows\system32
72050000 Fwpuclnt.dll    6.1.7601.17514     C:\Windows\system32
72130000 propsys.dll     7.0.7601.17514     C:\Windows\system32
727e0000 wsock32.dll     6.1.7600.16385     C:\Windows\system32
727f0000 uxtheme.dll     6.1.7600.16385     C:\Windows\system32
72870000 WINSTA.dll      6.1.7601.17514     C:\Windows\system32
72bf0000 SECUR32.DLL     6.1.7601.17940     C:\Windows\system32
72c40000 wshtcpip.dll    6.1.7600.16385     C:\Windows\System32
72c50000 wship6.dll      6.1.7600.16385     C:\Windows\System32
72c60000 mswsock.dll     6.1.7601.17514     C:\Windows\system32
72dc0000 wtsapi32.dll    6.1.7601.17514     C:\Windows\system32
72e00000 mpr.dll         6.1.7600.16385     C:\Windows\system32
734f0000 RpcRtRemote.dll 6.1.7601.17514     C:\Windows\system32
73500000 rsaenh.dll      6.1.7600.16385     C:\Windows\system32
73540000 CRYPTSP.dll     6.1.7600.16385     C:\Windows\system32
735f0000 winspool.drv    6.1.7601.17514     C:\Windows\system32
73650000 version.dll     6.1.7600.16385     C:\Windows\system32
73730000 ntmarta.dll     6.1.7600.16385     C:\Windows\system32
74750000 msiltcfg.dll    5.0.7600.16385     C:\Windows\system32
74820000 msimg32.dll     6.1.7600.16385     C:\Windows\system32
74970000 security.dll    6.1.7600.16385     C:\Windows\system32
74c80000 CRYPTBASE.dll   6.1.7600.16385     C:\Windows\syswow64
74c90000 SspiCli.dll     6.1.7601.17940     C:\Windows\syswow64
74cf0000 WS2_32.dll      6.1.7601.17514     C:\Windows\syswow64
74e50000 WLDAP32.dll     6.1.7601.17514     C:\Windows\syswow64
74ea0000 IMM32.DLL       6.1.7601.17514     C:\Windows\system32
74f40000 oleaut32.dll    6.1.7601.17676     C:\Windows\syswow64
74fe0000 USER32.dll      6.1.7601.17514     C:\Windows\syswow64
75140000 KERNELBASE.dll  6.1.7601.18015     C:\Windows\syswow64
75190000 CFGMGR32.dll    6.1.7601.17621     C:\Windows\syswow64
751c0000 LPK.dll         6.1.7600.16385     C:\Windows\syswow64
751d0000 sechost.dll     6.1.7600.16385     C:\Windows\SysWOW64
751f0000 shell32.dll     6.1.7601.18103     C:\Windows\syswow64
75e40000 msvcrt.dll      7.0.7601.17744     C:\Windows\syswow64
76010000 MSCTF.dll       6.1.7600.16385     C:\Windows\syswow64
760e0000 SETUPAPI.dll    6.1.7601.17514     C:\Windows\syswow64
76280000 DEVOBJ.dll      6.1.7601.17621     C:\Windows\syswow64
762a0000 RPCRT4.dll      6.1.7601.17514     C:\Windows\syswow64
764c0000 CLBCatQ.DLL     2001.12.8530.16385 C:\Windows\syswow64
76550000 kernel32.dll    6.1.7601.18015     C:\Windows\syswow64
76660000 GDI32.dll       6.1.7601.17514     C:\Windows\syswow64
766f0000 ADVAPI32.dll    6.1.7601.17514     C:\Windows\syswow64
76790000 USP10.dll       1.626.7601.18009   C:\Windows\syswow64
768c0000 ole32.dll       6.1.7601.17514     C:\Windows\syswow64
76a20000 comdlg32.dll    6.1.7601.17514     C:\Windows\syswow64
76c60000 SHLWAPI.dll     6.1.7601.17514     C:\Windows\syswow64
77580000 NSI.dll         6.1.7600.16385     C:\Windows\syswow64
775b0000 ntdll.dll       6.1.7601.17725     C:\Windows\SysWOW64

processes:
0000 Idle                       0 0  0
0004 System                     0 0  0
0138 smss.exe                   0 0  0
0194 csrss.exe                  0 0  0
01c8 wininit.exe                0 0  0
01dc csrss.exe                  1 0  0
020c services.exe               0 0  0
0224 winlogon.exe               1 0  0
0230 lsass.exe                  0 0  0
0238 lsm.exe                    0 0  0
02b0 svchost.exe                0 0  0
0300 svchost.exe                0 0  0
0348 MsMpEng.exe                0 0  0
03a4 svchost.exe                0 0  0
03c4 svchost.exe                0 0  0
03dc svchost.exe                0 0  0
006c svchost.exe                0 0  0
02f0 svchost.exe                0 0  0
04b0 wisptis.exe                1 0  0
04d8 svchost.exe                0 0  0
05bc spoolsv.exe                0 0  0
0604 svchost.exe                0 0  0
0674 armsvc.exe                 0 0  0
06a4 svchost.exe                0 0  0
06e8 atashost.exe               0 0  0
0714 svchost.exe                0 0  0
0734 inetinfo.exe               0 0  0
0754 MsDtsSrvr.exe              0 0  0
07c0 sqlservr.exe               0 0  0
05fc w3dbsmgr.exe               0 0  0
0810 sqlbrowser.exe             0 0  0
0834 sqlwriter.exe              0 0  0
084c svchost.exe                0 0  0
08a4 TeamViewer_Service.exe     0 0  0
0950 vmnat.exe                  0 0  0
0970 WLIDSVC.EXE                0 0  0
09f4 vmware-authd.exe           0 0  0
0a40 taskhost.exe               1 0  0 normal
0a58 WLIDSVCM.EXE               0 0  0
0af0 dwm.exe                    1 0  0 high
0b00 wisptis.exe                1 0  0 high
0b14 TabTip.exe                 1 0  0 high
0b44 explorer.exe               1 0  0 normal
0b8c vmnetdhcp.exe              0 0  0
0ba0 TabTip32.exe               1 0  0 normal       C:\Program Files (x86)\Common Files\Microsoft Shared\Ink
0bc8 vmware-usbarbitrator64.exe 0 0  0
0c98 svchost.exe                0 0  0
0cb4 NisSrv.exe                 0 0  0
0e04 svchost.exe                0 0  0
0e7c Apoint.exe                 1 0  0 normal
0e84 igfxtray.exe               1 0  0 normal
0e90 hkcmd.exe                  1 0  0 normal
0e98 igfxpers.exe               1 0  0 normal
0eb4 NtrigApplet.exe            1 0  0 normal
0ebc msseces.exe                1 0  0 normal
0f28 ApMsgFwd.exe               1 0  0 normal
0f40 SkyDrive.exe               1 0  0 normal       C:\Users\JonathanW\AppData\Local\Microsoft\SkyDrive
0f58 Skype.exe                  1 0  0 normal       C:\Program Files (x86)\Skype\Phone
0fc8 hpqtra08.exe               1 0  0 normal       C:\Program Files (x86)\HP\Digital Imaging\bin
0ff4 WUDFHost.exe               0 0  0
09c4 Dropbox.exe                1 0  0 normal       C:\Users\JonathanW\AppData\Roaming\Dropbox\bin
1034 ApntEx.exe                 1 0  0 normal
1044 hidfind.exe                1 0  0 normal
104c EvernoteClipper.exe        1 0  0 normal       C:\Program Files (x86)\Evernote\Evernote
1068 conhost.exe                1 0  0 normal
10c8 hpwuschd2.exe              1 0  0 normal       C:\Program Files (x86)\HP\HP Software Update
1160 DivXUpdate.exe             1 0  0 normal       C:\Program Files (x86)\DivX\DivX Update
1178 jusched.exe                1 0  0 normal       C:\Program Files (x86)\Common Files\Java\Java Update
127c SearchIndexer.exe          0 0  0
13c0 wmpnetwk.exe               0 0  0
0be8 svchost.exe                0 0  0
1028 svchost.exe                0 0  0
164c dllhost.exe                0 0  0
1704 chrome.exe                 1 0  0 normal       C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
1780 chrome.exe                 1 0  0 normal       C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
17f0 LMS.exe                    0 0  0
1614 UNS.exe                    0 0  0
0b60 InputPersonalization.exe   1 0  0 below normal
08f0 adb.exe                    1 0  0 normal       C:\Program Files (x86)\Android\android-sdk\platform-tools
1124 chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
157c chrome.exe                 1 0  0 normal       C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
1200 chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
080c chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
0524 Evernote.exe               1 0  0 normal       C:\Program Files (x86)\Evernote\Evernote
14f4 EvernoteTray.exe           1 0  0 normal       C:\Program Files (x86)\Evernote\Evernote
0f50 chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
0bd0 chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
1c70 OSPPSVC.EXE                0 0  0
0f1c chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
0b78 JsonView.exe               1 0  0 normal
0934 mmc.exe                    1 0  0 normal
0648 bds.exe                    1 0  0 normal       C:\Program Files (x86)\Embarcadero\RAD Studio\9.0\bin
11e4 chrome.exe                 1 0  0 normal       C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
0b54 chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
0484 chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
0ad0 chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
0e1c chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
1078 chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
0630 chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
0d00 chrome.exe                 1 0  0 below normal C:\Users\JonathanW\AppData\Local\Google\Chrome\Application
1bc8 taskeng.exe                0 0  0
1a48 WmiPrvSE.exe               0 0  0
1e94 audiodg.exe                0 0  0
1134 X365EXHS.exe               0 14 6 normal       C:\DEVELOP\DELPHI\eXchequer365\X365EXHS\Win32\Release
1ac4 mmc.exe                    1 0  0 normal

hardware:
+ Batteries
  - Microsoft AC Adapter
  - Microsoft ACPI-Compliant Control Method Battery
  - Microsoft ACPI-Compliant Control Method Battery
  - Microsoft Composite Battery
+ Computer
  - ACPI x64-based PC
+ Disk drives
  - SAMSUNG SSD PM800 TM 128
+ Display adapters
  - Mobile Intel(R) 4 Series Express Chipset Family (driver 8.15.10.2302)
  - Mobile Intel(R) 4 Series Express Chipset Family (driver 8.15.10.2302)
+ Human Interface Devices
  - DELL Tablet PC Key Buttons (driver 1.1.4.0)
  - HID-compliant consumer control device
  - HID-compliant device
+ IDE ATA/ATAPI controllers
  - ATA Channel 0
  - ATA Channel 1
  - Standard Dual Channel PCI IDE Controller
+ IEEE 1394 Bus host controllers
  - Texas Instruments 1394 OHCI Compliant Host Controller
+ Imaging devices
  - Photosmart C4500 series (driver 8.0.0.0)
+ Keyboards
  - HID Keyboard Device
  - HID Keyboard Device
+ Mice and other pointing devices
  - Dell Touchpad (driver 7.1207.101.108)
+ Monitors
  - Generic PnP Monitor
+ Multifunction adapters
  - Photosmart C4500 series
+ N-trig DuoSense(R) Digitizers
  - N-trig DuoSense Composite Root interface (driver 3.1.2000.6)
  - N-trig DuoSense Control HID device (driver 3.1.2000.6)
  - N-trig DuoSense Control HID Interface (driver 3.1.2000.6)
  - N-trig DuoSense MultiTouch HID device (driver 3.1.2000.6)
  - N-trig DuoSense Pen HID device (driver 3.1.2000.6)
  - N-trig DuoSense Secondary Interface (driver 3.1.2000.6)
  - N-trig DuoSense Touch HID device (driver 3.1.2000.6)
  - N-trig DuoSense Touch HID Interface (driver 3.1.2000.6)
+ Network adapters
  - Intel(R) 82567LM Gigabit Network Connection (driver 10.0.6.0)
  - Intel(R) WiFi Link 5100 AGN
  - Microsoft 6to4 Adapter
  - Microsoft ISATAP Adapter
  - Microsoft ISATAP Adapter #2
  - Microsoft ISATAP Adapter #3
  - Microsoft ISATAP Adapter #4
  - Teredo Tunneling Pseudo-Interface
  - VMware Virtual Ethernet Adapter for VMnet1 (driver 4.1.4.0)
  - VMware Virtual Ethernet Adapter for VMnet8 (driver 4.1.4.0)
  - WAN Miniport (IKEv2)
  - WAN Miniport (IP)
  - WAN Miniport (IPv6)
  - WAN Miniport (L2TP)
  - WAN Miniport (Network Monitor)
  - WAN Miniport (PPPOE)
  - WAN Miniport (PPTP)
  - WAN Miniport (SSTP)
+ PCMCIA adapters
  - Texas Instruments PCI-8x12/7x12/6x12 CardBus Controller
+ Ports (COM & LPT)
  - Intel(R) Active Management Technology - SOL (COM8) (driver 5.4.1.1016)
+ Processors
  - Intel(R) Core(TM)2 Duo CPU     U9400  @ 1.40GHz
  - Intel(R) Core(TM)2 Duo CPU     U9400  @ 1.40GHz
+ SD host adapters
  - SDA Standard Compliant SD Host Controller
+ Sound, video and game controllers
  - High Definition Audio Device
+ Storage controllers
  - Intel(R) ICH8M-E/ICH9M-E SATA RAID Controller (driver 8.6.2.1315)
+ Storage volume shadow copies
  - Generic volume shadow copy
+ System devices
  - ACPI Lid
  - ACPI Power Button
  - ACPI Sleep Button
  - ACPI Thermal Zone
  - Composite Bus Enumerator
  - Direct memory access controller
  - File as Volume Driver
  - High Definition Audio Controller
  - High precision event timer
  - Intel(R) 82801 PCI Bridge - 2448
  - Intel(R) ICH9 Family PCI Express Root Port 1 - 2940
  - Intel(R) ICH9 Family PCI Express Root Port 2 - 2942
  - Intel(R) ICH9 Family PCI Express Root Port 4 - 2946
  - Intel(R) ICH9 Family SMBus Controller - 2930
  - Intel(R) ICH9M-E LPC Interface Controller - 2917
  - Microsoft ACPI-Compliant Embedded Controller
  - Microsoft ACPI-Compliant System
  - Microsoft System Management BIOS Driver
  - Microsoft Virtual Drive Enumerator Driver
  - Microsoft Windows Management Interface for ACPI
  - Mobile Intel(R) 4 Series Chipset Processor to DRAM Controller - 2A40
  - Numeric data processor
  - PCI bus
  - Plug and Play Software Device Enumerator
  - Programmable interrupt controller
  - Remote Desktop Device Redirector Bus
  - System board
  - System board
  - System board
  - System board
  - System board
  - System CMOS/real time clock
  - System speaker
  - System timer
  - Terminal Server Keyboard Driver
  - Terminal Server Mouse Driver
  - UMBus Enumerator
  - UMBus Root Bus Enumerator
  - VMware VMCI Host Device (driver 9.3.51.0)
  - Volume Manager
+ Universal Serial Bus controllers
  - Intel(R) ICH9 Family USB Universal Host Controller - 2934
  - Intel(R) ICH9 Family USB Universal Host Controller - 2935
  - Intel(R) ICH9 Family USB Universal Host Controller - 2936
  - Intel(R) ICH9 Family USB Universal Host Controller - 2937
  - Intel(R) ICH9 Family USB Universal Host Controller - 2938
  - Intel(R) ICH9 Family USB Universal Host Controller - 2939
  - Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293A
  - Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293C
  - USB Root Hub
  - USB Root Hub
  - USB Root Hub
  - USB Root Hub
  - USB Root Hub
  - USB Root Hub
  - USB Root Hub
  - USB Root Hub

cpu registers:
eax = 00000000
ebx = 0106fd60
ecx = 0067f558
edx = 0067f140
esi = 0067f140
edi = 00000001
eip = 004061a4
esp = 0018fd68
ebp = 0018fd8c

stack dump:
0018fd68  51 00 00 00 7b 00 53 00 - 79 00 73 00 74 00 65 00  Q...{.S.y.s.t.e.
0018fd78  6d 00 2e 00 47 00 65 00 - 6e 00 65 00 72 00 69 00  m...G.e.n.e.r.i.
0018fd88  63 00 73 00 2e 00 43 00 - 6f 00 6c 00 6c 00 65 00  c.s...C.o.l.l.e.
0018fd98  63 00 74 00 69 00 6f 00 - 6e 00 73 00 7d 00 54 00  c.t.i.o.n.s.}.T.
0018fda8  4c 00 69 00 73 00 74 00 - 3c 00 44 00 61 00 74 00  L.i.s.t.<.D.a.t.
0018fdb8  61 00 2e 00 44 00 42 00 - 58 00 43 00 6f 00 6d 00  a...D.B.X.C.o.m.
0018fdc8  6d 00 6f 00 6e 00 2e 00 - 54 00 44 00 42 00 58 00  m.o.n...T.D.B.X.
0018fdd8  57 00 72 00 69 00 74 00 - 61 00 62 00 6c 00 65 00  W.r.i.t.a.b.l.e.
0018fde8  56 00 61 00 6c 00 75 00 - 65 00 41 00 72 00 72 00  V.a.l.u.e.A.r.r.
0018fdf8  61 00 79 00 3e 00 2e 00 - 52 00 65 00 76 00 65 00  a.y.>...R.e.v.e.
0018fe08  72 00 73 00 65 00 00 00 - 00 00 00 00 00 00 00 00  r.s.e...........
0018fe18  00 00 00 00 c0 8c 18 00 - b0 04 02 00 01 00 00 00  ................
0018fe28  56 00 00 00 7b 00 53 00 - 79 00 73 00 74 00 65 00  V...{.S.y.s.t.e.
0018fe38  6d 00 2e 00 47 00 65 00 - 6e 00 65 00 72 00 69 00  m...G.e.n.e.r.i.
0018fe48  63 00 73 00 2e 00 43 00 - 6f 00 6c 00 6c 00 65 00  c.s...C.o.l.l.e.
0018fe58  63 00 74 00 69 00 6f 00 - 6e 00 73 00 7d 00 54 00  c.t.i.o.n.s.}.T.
0018fe68  4c 00 69 00 73 00 74 00 - 3c 00 44 00 61 00 74 00  L.i.s.t.<.D.a.t.
0018fe78  61 00 2e 00 44 00 42 00 - 58 00 43 00 6f 00 6d 00  a...D.B.X.C.o.m.
0018fe88  6d 00 6f 00 6e 00 2e 00 - 54 00 44 00 42 00 58 00  m.o.n...T.D.B.X.
0018fe98  57 00 72 00 69 00 74 00 - 61 00 62 00 6c 00 65 00  W.r.i.t.a.b.l.e.
1
Could you perhaps provide the details of the APPCRASH/Application Error messages from the event log? Do you compile with MadExcept?J...
0xc0000005 is an access violation. You're probably calling CoUninitialize too early (before all destructors are done using COM, etc). For MadExcept, have a look : madshi.net/madExceptDescription.htm (there's a free version available - it's really of infinite help when tracking down things like this)J...
For instance, make sure you nil any COM interfaces you retrieve after calling CoInitialize/Ex() before you call CoUninitialize(), or else they will be released after CoUninitialize(), which usually results in a crash.Remy Lebeau
@JonathanWareham - MadExcept doesn't swallow exceptions... perhaps something else has changed? It's easy enough to force a crash by deliberately causing an AV - that should test that MadExcept is working correctly.J...
No I didn't add anything to the example program, just left it with the default EchoString and ReverseString methods. Yes I'm using XE2 Update 4. This wouldn't be the first HTTPS bug I've found in DataSnap - I reported QC#111130 which relates to REST connections connecting with HTTP when HTTPS is selected & this is on the fix list in XE4.Jonathan Wareham

1 Answers

0
votes

Did you try the fix for the IDispatch release as described in this link: Is COM broken in XE2, and how might I work around it?

Seems like XE2 has some COM interfacing changes - I guess to remove assembler to support 64bit. It could be that the presence of an SSL cert causes an extra release which exhibits the error.

Just a thought anyway