Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Hands on AnyDAC 2.0.2
Hands on AnyDAC 2.0.2
Posted: 2007/09/18 13:27
 
Hi folks!

I use Turbo Delphi Explorer (FREEWARE) and I am already a regular user of AnyDAC 1.X (by adding it to the dclusr.dpk package).

I have just downloaded AnyDAC 2.0.2 sources (the only way to make any thirdy party components work in Turbo Delphi Explorer is via sources) and its installation process was as easy as deleting all older files from its directory, putting all new files there and rebuild dclusr.dpk! Great!

My first test was to open an "Oracle DB" project, rebuild and trying to run it. Everything was fine, until my program reached "adConnection.Connected := True;"

I got an exception, similiar as in this thread:
http://www.da-soft.com/component/option,com_joomlaboard/Itemid,66/func,view/id,11051/catid,4/

I checked the events output from debugger and noted that that wasn't related to wsock32.dll anymore. Now I am clueless. Here is the events dump:

Thread Start: Thread ID: 3088. Process ZJPIRR.exe (3176)
Process Start: C:BrunoDelphiZJP Invalid Rejects ReportZJPIRR.exe. Base Address: $00400000. Process ZJPIRR.exe (3176)
Module Load: ZJPIRR.exe. Has Debug Info. Base Address: $00400000. Process ZJPIRR.exe (3176)
Module Load: ntdll.dll. No Debug Info. Base Address: $7C900000. Process ZJPIRR.exe (3176)
Module Load: KERNEL32.dll. No Debug Info. Base Address: $7C800000. Process ZJPIRR.exe (3176)
Module Load: OLEAUT32.dll. No Debug Info. Base Address: $77120000. Process ZJPIRR.exe (3176)
Module Load: msvcrt.dll. No Debug Info. Base Address: $77C10000. Process ZJPIRR.exe (3176)
Module Load: USER32.dll. No Debug Info. Base Address: $7E410000. Process ZJPIRR.exe (3176)
Module Load: GDI32.dll. No Debug Info. Base Address: $77F10000. Process ZJPIRR.exe (3176)
Module Load: ADVAPI32.dll. No Debug Info. Base Address: $77DD0000. Process ZJPIRR.exe (3176)
Module Load: RPCRT4.dll. No Debug Info. Base Address: $77E70000. Process ZJPIRR.exe (3176)
Module Load: ole32.dll. No Debug Info. Base Address: $774E0000. Process ZJPIRR.exe (3176)
Module Load: VERSION.dll. No Debug Info. Base Address: $77C00000. Process ZJPIRR.exe (3176)
Module Load: COMCTL32.dll. No Debug Info. Base Address: $5D090000. Process ZJPIRR.exe (3176)
Module Load: SHELL32.dll. No Debug Info. Base Address: $7C9C0000. Process ZJPIRR.exe (3176)
Module Load: SHLWAPI.dll. No Debug Info. Base Address: $77F60000. Process ZJPIRR.exe (3176)
Module Load: WINSPOOL.DRV. No Debug Info. Base Address: $73000000. Process ZJPIRR.exe (3176)
Module Load: comdlg32.dll. No Debug Info. Base Address: $763B0000. Process ZJPIRR.exe (3176)
Module Load: WSOCK32.dll. No Debug Info. Base Address: $71AD0000. Process ZJPIRR.exe (3176)
Module Load: WS2_32.dll. No Debug Info. Base Address: $71AB0000. Process ZJPIRR.exe (3176)
Module Load: WS2HELP.dll. No Debug Info. Base Address: $71AA0000. Process ZJPIRR.exe (3176)
Module Load: IMM32.dll. No Debug Info. Base Address: $76390000. Process ZJPIRR.exe (3176)
Module Load: LPK.dll. No Debug Info. Base Address: $629C0000. Process ZJPIRR.exe (3176)
Module Load: USP10.dll. No Debug Info. Base Address: $74D90000. Process ZJPIRR.exe (3176)
Module Load: COMCTL32.dll. No Debug Info. Base Address: $773D0000. Process ZJPIRR.exe (3176)
Module Load: MSCTF.dll. No Debug Info. Base Address: $74720000. Process ZJPIRR.exe (3176)
Module Load: msctfime.ime. No Debug Info. Base Address: $755C0000. Process ZJPIRR.exe (3176)
Module Load: IIAAG1DA.dll. No Debug Info. Base Address: $6A900000. Process ZJPIRR.exe (3176)
Module Load: UNKNOWN_MODULE_2. No Debug Info. Base Address: $6B900000. Process ZJPIRR.exe (3176)
Module Load: UNKNOWN_MODULE_3. No Debug Info. Base Address: $6C900000. Process ZJPIRR.exe (3176)
Module Load: IIAAG1DD.dll. No Debug Info. Base Address: $00D70000. Process ZJPIRR.exe (3176)
Module Load: UxTheme.dll. No Debug Info. Base Address: $5AD70000. Process ZJPIRR.exe (3176)
Module Load: WSHIP6.dll. No Debug Info. Base Address: $58D40000. Process ZJPIRR.exe (3176)
Module Load: midas.dll. No Debug Info. Base Address: $4DAE0000. Process ZJPIRR.exe (3176)
Thread Start: Thread ID: 3212. Process ZJPIRR.exe (3176)
Module Load: OCI.dll. No Debug Info. Base Address: $10000000. Process ZJPIRR.exe (3176)
Module Load: MSVCR71.dll. No Debug Info. Base Address: $7C340000. Process ZJPIRR.exe (3176)
Module Load: PSAPI.DLL. No Debug Info. Base Address: $76BF0000. Process ZJPIRR.exe (3176)
Module Load: OraOCIICUS10.dll. No Debug Info. Base Address: $01A70000. Process ZJPIRR.exe (3176)
Module Load: WINMM.dll. No Debug Info. Base Address: $76B40000. Process ZJPIRR.exe (3176)
Module Load: CRYPT32.dll. No Debug Info. Base Address: $77A80000. Process ZJPIRR.exe (3176)
Module Load: MSASN1.dll. No Debug Info. Base Address: $77B20000. Process ZJPIRR.exe (3176)
Debug Output: HEAP[ZJPIRR.exe]: Process ZJPIRR.exe (3176)
Debug Output: Invalid Address specified to RtlFreeHeap( 00140000, 00175A58 ) Process ZJPIRR.exe (3176)


I am using Oracle Instant Client version 10.2.0.3.

Thanks for the great job, Diman! Keep it up!

Bruno
Re:Hands on AnyDAC 2.0.2
Posted: 2007/09/19 02:16
 
Hello

Could you do following things:
1) Try to connect using Oracle full scale client, not a instant client. Does that work ?
2) Activate AnyDAC monitoring, run application up to AV and post ziped monitor ouput here. Or run application with "Stop on exception"=On upto to AV, then post call stack here.

Regards,
Dmitry
Re:Hands on AnyDAC 2.0.2
Posted: 2007/09/19 10:42
 
Diman,

I couldn't test with a fullfledged oracle client, but I will soon. Anyway, here is the stack dump:


:7c901231 ntdll.DbgBreakPoint + 0x1
:7c96c943 ; ntdll.dll
:7c96cd80 ; ntdll.dll
:7c96df66 ; ntdll.dll
:7c94a5d0 ; ntdll.dll
:7c9268ad ; ntdll.dll
:7c80995a kernel32.LocalFree + 0x2b
:01bbfd0d ; C:oracleOraOCIICUS10.dll
:0257fd14 ; C:oracleOraOCIICUS10.dll
:01bb6ba3 ; C:oracleOraOCIICUS10.dll
:01bb64f0 ; C:oracleOraOCIICUS10.dll
:01bb622e ; C:oracleOraOCIICUS10.dll
:0257db05 ; C:oracleOraOCIICUS10.dll
:01bb5c8a OraOCIICUS10.lfvinit + 0x42
:01b7680a ; C:oracleOraOCIICUS10.dll
:01b750e9 ; C:oracleOraOCIICUS10.dll
:01f9664f OraOCIICUS10.OCIEnvCreate + 0x3d
:1000c4f8 oci.OCIEnvCreate + 0x3c
daADPhysOraclWrapper.TOCIEnv.Create($C6F5E0,3,TADMoniClientBase($C63480) as IADMoniClient,$B70030)
daADPhysOracl.TADPhysOraclConnection.InternalConnect
daADPhysManager.TADPhysConnection.DoConnect
daADPhysManager.TADPhysConnection.Open
daADCompClient.TADCustomConnection.DoInternalLogin
daADCompClient.TADCustomConnection.DoConnect
:004959d8 TCustomConnection.SetConnected + $3C
:00466e36 TControl.Click + $6A
:0046a786 TWinControl.WndProc + $49E
:0044aa55 TButtonControl.WndProc + $71
:0046a8bc DoControlMsg + $28
:0046a786 TWinControl.WndProc + $49E
:00469f0f TWinControl.MainWndProc + $2F
:004319ce StdWndProc + $16
:7e418734 USER32.GetDC + 0x6d
:7e418816 ; C:WINDOWSsystem32USER32.dll
:7e41b89b ; C:WINDOWSsystem32USER32.dll
:7e41b903 USER32.SendMessageW + 0x49
:7e44fd1d ; C:WINDOWSsystem32USER32.dll
:7e446561 ; C:WINDOWSsystem32USER32.dll
:7e426df4 ; C:WINDOWSsystem32USER32.dll
:7e43b04a ; C:WINDOWSsystem32USER32.dll
:7e418734 USER32.GetDC + 0x6d
:7e418816 ; C:WINDOWSsystem32USER32.dll
:7e41c63f USER32.IsWindowUnicode + 0xa1
:7e41f65d USER32.CallWindowProcA + 0x1b
:0046a868 TWinControl.DefaultHandler + $DC
:0046a786 TWinControl.WndProc + $49E
:0044aa55 TButtonControl.WndProc + $71
:004319ce StdWndProc + $16
:7e418734 USER32.GetDC + 0x6d
:7e418816 ; C:WINDOWSsystem32USER32.dll
:7e4189cd ; C:WINDOWSsystem32USER32.dll
:7e4196c7 USER32.DispatchMessageA + 0xf
:00482eb1 TApplication.ProcessMessage + $101


It's not actually an Action Violation. It's an exception that Delphi IDE is catching ("Invalid Address specified to RtlFreeHeap", as you can see in the events dump I've posted above). I don't get any problem when running the program outside Delphi IDE, though.

Thanks,

Bruno
Re:Hands on AnyDAC 2.0.2
Posted: 2007/09/19 11:23
 
1) Please, clarify. Do you really get an exception in IDE or you just see "Invalid Address" in Events View ?
2) In general it looks like some Oracle client issue. And the place, where it happens, is very trivial. It is first initializing OCI call. I will look for that in INet and Metalink.

Regards,
Dmitry
Re:Hands on AnyDAC 2.0.2
Posted: 2007/09/19 11:57
 
Diman wrote:
1) Please, clarify. Do you really get an exception in IDE or you just see "Invalid Address" in Events View ?

This is what I get on IDE. No additional dialogs or error messages:
http://i82.photobucket.com/albums/j267/bootsector/oic.jpg


2) In general it looks like some Oracle client issue. And the place, where it happens, is very trivial. It is first initializing OCI call. I will look for that in INet and Metalink.

Regards,
Dmitry


Sorry for my poor bug reporting.

Thanks,

Bruno
Re:Hands on AnyDAC 2.0.2
Posted: 2007/09/19 12:21
 
Hello

Ok, it looks like one old Oracle client issue. Somebody from OCI developers forgot dbugging code. So, you should just ignore that or try upgrade your Oracle client. IOW, dont warry - your application and AnyDAC working ok

Regards,
Dmitry
Re:Hands on AnyDAC 2.0.2
Posted: 2007/09/19 14:41
 
Thanks Diman!

Yes, my app is working flawlessly!

I am already using the latest version of Instant Client, so I would have to change for full oracle client (i don't want to! )

Anyway, I've found a fix for this:

http://www.howtodothings.com/computers/a1008-ntdlldbguserbreakpoint-another-fix.html

Maybe it would be useful and should be included in daADStanUtil.pas (replace WSStartup with PatchINT3 or leave both, I don't know, just a guess...)

Thanks,

Bruno
Re:Hands on AnyDAC 2.0.2
Posted: 2007/09/19 22:43
 
Hello Bruno

1) Am I right, remembering that I have included WSStartup into daADStanUtil due to issues described by you ?
2) PatchINT3 - I am not sure, what other code it can break ... So, I will suggest include PatchINT3 by you into your application code. But thank you for suggestion ! It may help also to somebody other.

Regards,
Dmitry
Re:Hands on AnyDAC 2.0.2
Posted: 2007/09/20 06:09
 
Diman wrote:
Hello Bruno

1) Am I right, remembering that I have included WSStartup into daADStanUtil due to issues described by you ?


Yes Diman! Now you found it's an Instant Client debug issue, I think you may want to remove the Startup and Cleanup from daADStanUtil, because PatchINT3 took care of that old issue as well!


2) PatchINT3 - I am not sure, what other code it can break ... So, I will suggest include PatchINT3 by you into your application code. But thank you for suggestion ! It may help also to somebody other.

Regards,
Dmitry


I completely agree with you!

Thanks,

Bruno