AccessViolationException within OciCall.dll

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
george_zhu
Posts: 11
Joined: Fri 10 Mar 2006 09:53

AccessViolationException within OciCall.dll

Post by george_zhu » Wed 08 Aug 2007 11:32

Hi,
I have encounter a problem with CoreLab.Oracle.dll (3.55.19.0) on Asp.net 2.0 App. The database is 10g R2.
This is not always reproducible on machines, we encounter this on some machines on which we have installed oracle 9 and 10.1 before.

please help to resolve it.

the exception stack trace is:

System.AccessViolationException was caught
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="OciCall.dll"
StackTrace:
Server stack trace:
at OciDynamicType.nativea(HandleRef , HandleRef , Int32 , UInt16 , UInt32 )
at OciDynamicType.a(HandleRef , HandleRef , Int32 , UInt16 , UInt32 )
at CoreLab.Oracle.at.c(Int32 A_0)
at CoreLab.Oracle.OracleDataReader.Read()
at Topobase.Data.Provider.Common.i.Read()
at Topobase.Data.Provider.DataReader.Read()
at Topobase.Data.Attributes.Load()
at Topobase.Data.Table.get_Attributes()
at Topobase.Data.Table.get_IsAttributeTable()
at Topobase.Data.Table.GetRows(String whereClause)
at Topobase.Data.DBTable.GetRows(String whereClause)
at Topobase.Data.Sys.Users.get_Item(String name)
at Topobase.Data.Sys.SysConnection.setSelectedUser(String name)
at Topobase.Forms.ApplicationImpl.Init(String Username, String Password, String webMapName, String webApplicationKey, String IpAddress, String ntUsername)
at Topobase.Forms.WebClient.WebApp.WebLogin(String sessionId, String username, String password, String Info, String IpAddress, String IdName, String browserType, String webmapName, String webApplicationKey, Boolean showSource, Boolean externalLogin)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Topobase.Forms.WebClient.IClient.WebLogin(String sessionId, String username, String password, String Info, String IpAddress, String IdName, String browserType, String mapName, String applicationKey, Boolean showSource, Boolean externalLogin)
at Topobase.Web.App.Client.Login(Page page) in E:\isd\Dev\TB\Topobase\Releases\2008-McKinley\Web\TBWebClient\WebApp\Client.cs:line 148

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 08 Aug 2007 14:18

Please use the latest version of OraDirect .NET (3.55.23). Also, if it is possible, try our beta version.
What is the version of Oracle client?

george_zhu
Posts: 11
Joined: Fri 10 Mar 2006 09:53

Post by george_zhu » Thu 09 Aug 2007 12:27

Alexey wrote:Please use the latest version of OraDirect .NET (3.55.23). Also, if it is possible, try our beta version.
What is the version of Oracle client?
The version of client is 10.2. Where can I get the OraDirect.NET(3.55.23), we need only the dll. if we install 3.55.23, will my program still work with your new dll? I mean whether the license check is ok or not for the new Corelab?


And we have two program that call the same sql execute, I checked that all values in runtime are the same, but one works ,the other fail....

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 09 Aug 2007 13:01

Where can I get the OraDirect.NET(3.55.23), we need only the dll. if we install 3.55.23, will my program still work with your new dll? I mean whether the license check is ok or not for the new Corelab?
You can download the latest version from the Registered Users Area. The link should have been provided to you in the registration letter.
Your application should work fine with new version without any licensing problem.
And we have two program that call the same sql execute, I checked that all values in runtime are the same, but one works ,the other fail....
We have been reported this problem before, but in no case we were able to indicate that it has something to do with our product. Last time upgrading Oracle client has fixed the problem. But in your case I don't know what to suggest. Is it possible for you to send me your program?

george_zhu
Posts: 11
Joined: Fri 10 Mar 2006 09:53

Post by george_zhu » Wed 15 Aug 2007 02:14

Alexey wrote:
Where can I get the OraDirect.NET(3.55.23), we need only the dll. if we install 3.55.23, will my program still work with your new dll? I mean whether the license check is ok or not for the new Corelab?
You can download the latest version from the Registered Users Area. The link should have been provided to you in the registration letter.
Your application should work fine with new version without any licensing problem.
And we have two program that call the same sql execute, I checked that all values in runtime are the same, but one works ,the other fail....
We have been reported this problem before, but in no case we were able to indicate that it has something to do with our product. Last time upgrading Oracle client has fixed the problem. But in your case I don't know what to suggest. Is it possible for you to send me your program?
Hi, I quote new discovery about this issue from my colleague, below comes from his email:

Replacing CoreLab.dll with a newer version (3.55.23) did not help, either. Looking at the problem with WinDbg and sos.dll, I get the following information:

The following unmanaged modules are loaded (so it seems the right oci dll's are found):

start end module name
0d250000 0d515000 xpsp2res (deferred)
0d9b0000 0d9d1000 Topobase_License_LicenseManager (deferred)
0eb40000 0eb49000 oraslax10 (deferred)
0ede0000 0ee37000 oci C (export symbols) C:\oracle\product\10.2.0\db_2\bin\oci.dll
0f040000 0f179000 adlmdll (deferred)
0f4e0000 0f640000 oraxml10 (deferred)
0f640000 0f6da000 orasql10 (deferred)
10000000 10025000 Topobase_CER (deferred)
11000000 11010000 image11000000 C (no symbols)
4b3c0000 4b410000 MSCTF (deferred)
4dd60000 4df07000 gdiplus (deferred)
5e410000 5e5ba000 Microsoft_VisualBasic_ni (deferred)
5f270000 5f2ca000 hnetcfg (deferred)
60020000 60030000 MSVCIRT (deferred)
60300000 60857000 orageneric10 (deferred)
60870000 60953000 oracore10 (deferred)
60960000 60a6d000 oran10 (export symbols) C:\oracle\product\10.2.0\db_2\bin\oran10.dll
60a80000 60b44000 oranls10 (deferred)
60b50000 60ea8000 orapls10 (deferred)
60eb0000 60eb7000 orauts (deferred)
60fa0000 61092000 oracommon10 (export symbols) C:\oracle\product\10.2.0\db_2\bin\oracommon10.dll
61c20000 61e72000 OraClient10 (export symbols) C:\oracle\product\10.2.0\db_2\bin\OraClient10.Dll
61ed0000 61f5b000 orahasgen10 (deferred)
62530000 62583000 oraldapclnt10 (deferred)
62660000 62666000 orancds10 (deferred)
62670000 6268b000 orancrypt10 (deferred)
626b0000 626b7000 oranhost10 (deferred)
62740000 6277d000 oranl10 (deferred)
62790000 627a7000 oranldap10 (deferred)
627f0000 628f9000 orannzsbb10 (deferred)
62920000 6296c000 oranro10 (deferred)
62980000 62990000 orantcp10 (deferred)
629c0000 629c8000 orantns10 (deferred)
62ab0000 62b1a000 oraocr10 (deferred)
62b20000 62b60000 oraocrb10 (deferred)
63080000 63284000 oraplp10 (deferred)
63430000 63457000 orasnls10 (deferred)
63690000 636a8000 oraunls10 (deferred)
636b0000 636b6000 oravsn10 (deferred)
637a0000 63d02000 System_Xml_ni (deferred)
64890000 6498a000 System_Configuration_ni (deferred)
64e70000 6513c000 System_Data (deferred)
65140000 657a6000 System_Data_ni (deferred)
65f20000 66ac6000 System_Web_ni (deferred)
67890000 678e8000 System_Runtime_Serialization_Formatters_Soap_ni (deferred)
68000000 68035000 rsaenh (deferred)
71ae0000 71ae8000 wshtcpip (deferred)
71b20000 71b61000 mswsock (deferred)
71b70000 71ba6000 uxtheme (deferred)
71bb0000 71bb9000 WSOCK32 (deferred)
71bc0000 71bc8000 rdpsnd (deferred)
71bf0000 71bf8000 WS2HELP (deferred)
71c00000 71c17000 ws2_32 (deferred)
71c40000 71c97000 NETAPI32 (deferred)
71f60000 71f64000 security (deferred)
76190000 761a2000 MSASN1 (deferred)
761b0000 76243000 CRYPT32 (deferred)
762b0000 762f9000 comdlg32 (deferred)
766d0000 766d9000 shfolder (deferred)
76a80000 76a98000 ATL (deferred)
76aa0000 76acd000 WINMM (deferred)
76b70000 76b7b000 PSAPI (deferred)
76b80000 76bae000 credui (deferred)
76c90000 76cb7000 msv1_0 (deferred)
76cf0000 76d0a000 iphlpapi (deferred)
76dc0000 76de8000 adsldpc (deferred)
76df0000 76e24000 activeds (deferred)
76ed0000 76efa000 DNSAPI (deferred)
76f10000 76f3e000 WLDAP32 (deferred)
76f50000 76f63000 Secur32 (deferred)
76f70000 76f77000 winrnr (deferred)
76f80000 76f85000 rasadhlp (deferred)
771f0000 77201000 WINSTA (deferred)
77380000 77411000 USER32 (deferred)
77420000 77523000 comctl32 (deferred)
77530000 775c7000 COMCTL32_77530000 (deferred)
77670000 777a9000 ole32 (deferred)
77b90000 77b98000 version (deferred)
77ba0000 77bfa000 msvcrt (deferred)
77c00000 77c48000 GDI32 (deferred)
77c50000 77cef000 RPCRT4 (deferred)
77d00000 77d8b000 OLEAUT32 (deferred)
77da0000 77df2000 SHLWAPI (deferred)
77e40000 77f42000 KERNEL32 (deferred)
77f50000 77feb000 ADVAPI32 (deferred)
78130000 781cb000 MSVCR80 (deferred)
79000000 79045000 mscoree (export symbols) C:\WINDOWS\system32\mscoree.dll
79060000 790b3000 mscorjit (deferred)
790c0000 79b90000 mscorlib_ni (deferred)
79e70000 7a3d6000 mscorwks (export symbols) C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
7a440000 7ac06000 System_ni (deferred)
7ade0000 7af6c000 System_Drawing_ni (deferred)
7afd0000 7bc54000 System_Windows_Forms_ni C (no symbols)
7c340000 7c396000 MSVCR71 (deferred)
7c420000 7c4a7000 MSVCP80 (deferred)
7c4c0000 7c53d000 msvcm80 (deferred)
7c540000 7c63a000 msvcm80_ni (deferred)
7c800000 7c8c0000 ntdll (export symbols) C:\WINDOWS\system32\ntdll.dll
7c8d0000 7d0ce000 shell32 (deferred)

Unloaded modules:
60340000 60348000 culture.dll

The unmanaged stack trace when the access violation happens is:

WARNING: Frame IP not in any known module. Following frames may be wrong.
001297f0 61de0f5f 0x5465838
0012983c 60fff1eb OraClient10!OCIPHeapFree+0x8c2f3
00129894 60fef25e oracommon10!skpinunregoobhdlr+0x1e87
00129984 60fec93e oracommon10!ttcfour+0x366
0012a234 60982241 oracommon10!ttcdrv+0x98e
0012a24c 61d1d256 oran10!nioqwa+0x39
0012c488 61d11ef8 OraClient10!upicui2+0x5aa
0012c4bc 61cf6b25 OraClient10!upirtrc+0x42
0012c4f4 61cd462b OraClient10!kpurcsc+0x69
0012e764 61cd5210 OraClient10!kpufGetRcvInfo+0xd1f
0012e7dc 61c2697d OraClient10!kpufGetRcvInfo+0x1904
0012e7fc 0ede75ef OraClient10!OCIStmtFetch+0x1b
0012e818 0e49552a oci!OCIStmtFetch+0x23
0012e844 0eb2889a 0xe49552a
0012e8d8 0eb27e2e 0xeb2889a
0012e90c 0fc38513 0xeb27e2e
0012e948 0fc3849e 0xfc38513
0012ecd0 0fc39063 0xfc3849e
0012ed0c 0fc38f2d 0xfc39063
0012ed44 0fc38e76 0xfc38f2d

The reason for the access violation is that the current address (0x5465838) is on a page which cannot be executed.
Sos.dll says that the managed heap is not corrupt.

Conclusion: I do not think that I will be able to find the reason for the defect. I think the problem lies in OCI, but I am not sure – I do not know enough about OCI and CoreLab to know for sure.

We are currently not able to reproduce the defect on our own machines.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 15 Aug 2007 08:21

We will also investigate this problem. If we find out anything, I'll post it here.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 27 Aug 2007 08:16

We have fixed minor bugs which could had something to do with the problem.
Look forward to the release of OraDirect .NET 4.20.

george_zhu
Posts: 11
Joined: Fri 10 Mar 2006 09:53

Post by george_zhu » Mon 27 Aug 2007 08:21

Alexey wrote:We have fixed minor bugs which could had something to do with the problem.
Look forward to the release of OraDirect .NET 4.20.
Thank you for your effort!
I quote some new discovery from my college, this comes from his mail on August 15, 2007.

I tested today both with CoreLab 4.00.15 trial, and with CoreLab 4.20.16 beta. It did not work. Looking at the 4.20.16 crash with WinDbg, I see exactly the same thing as I have seen yesterday with CoreLab 3.50.23 (see way above in this thread).

FYI

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 30 Aug 2007 13:31

Please try release version of OraDirect .NET 4.20!

george_zhu
Posts: 11
Joined: Fri 10 Mar 2006 09:53

Post by george_zhu » Wed 05 Sep 2007 09:53

We tried Corelab 4.20.20, but the result is the same. :(
here is some information from Windbg:
ModLoad: 76f80000 76f85000 C:\WINDOWS\system32\rasadhlp.dll
ModLoad: 010c0000 010e1000 C:\Program Files\Autodesk Topobase Administrator 2008\bin\Topobase.License.LicenseManager.dll
ModLoad: 7c420000 7c4a7000 C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0DE06ACD\MSVCP80.dll
ModLoad: 0ecc0000 0edf9000 C:\Program Files\Autodesk Topobase Administrator 2008\adlmdll.dll
ModLoad: 71c40000 71c97000 C:\WINDOWS\system32\NETAPI32.dll
ModLoad: 77530000 775c7000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_5.82.3790.3959_x-ww_78FCF8D0\COMCTL32.dll
ModLoad: 71bb0000 71bb9000 C:\WINDOWS\system32\WSOCK32.dll
ModLoad: 762b0000 762f9000 C:\WINDOWS\system32\comdlg32.dll
ModLoad: 65140000 657a6000 C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.Data\52fcde87c16e0d8298a4e30c56c847bc\System.Data.ni.dll
ModLoad: 64e70000 6513c000 System.Data.dll
ModLoad: 64e70000 6513c000 C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll
ModLoad: 761b0000 76243000 C:\WINDOWS\system32\CRYPT32.dll
ModLoad: 76190000 761a2000 C:\WINDOWS\system32\MSASN1.dll
ModLoad: 77b90000 77b98000 C:\WINDOWS\system32\version.dll
ModLoad: 0f2a0000 0f2f7000 C:\oracle\product\10.2.0\db_2\bin\oci.dll
ModLoad: 7c340000 7c396000 C:\oracle\product\10.2.0\db_2\bin\MSVCR71.dll
ModLoad: 61c20000 61e72000 C:\oracle\product\10.2.0\db_2\bin\OraClient10.Dll
ModLoad: 60870000 60953000 C:\oracle\product\10.2.0\db_2\bin\oracore10.dll
ModLoad: 60a80000 60b44000 C:\oracle\product\10.2.0\db_2\bin\oranls10.dll
ModLoad: 63690000 636a8000 C:\oracle\product\10.2.0\db_2\bin\oraunls10.dll
ModLoad: 60eb0000 60eb7000 C:\oracle\product\10.2.0\db_2\bin\orauts.dll
ModLoad: 76aa0000 76acd000 C:\WINDOWS\system32\WINMM.dll
ModLoad: 636b0000 636b6000 C:\oracle\product\10.2.0\db_2\bin\oravsn10.dll
ModLoad: 60fa0000 61092000 C:\oracle\product\10.2.0\db_2\bin\oracommon10.dll
ModLoad: 60300000 60857000 C:\oracle\product\10.2.0\db_2\bin\orageneric10.dll
ModLoad: 63430000 63457000 C:\oracle\product\10.2.0\db_2\bin\orasnls10.dll
ModLoad: 0f300000 0f460000 C:\oracle\product\10.2.0\db_2\bin\oraxml10.dll
ModLoad: 60020000 60030000 C:\WINDOWS\system32\MSVCIRT.dll
ModLoad: 60960000 60a6d000 C:\oracle\product\10.2.0\db_2\bin\oran10.dll
ModLoad: 62740000 6277d000 C:\oracle\product\10.2.0\db_2\bin\oranl10.dll
ModLoad: 62790000 627a7000 C:\oracle\product\10.2.0\db_2\bin\oranldap10.dll
ModLoad: 627f0000 628f9000 C:\oracle\product\10.2.0\db_2\bin\orannzsbb10.dll
ModLoad: 62530000 62583000 C:\oracle\product\10.2.0\db_2\bin\oraldapclnt10.dll
ModLoad: 62670000 6268b000 C:\oracle\product\10.2.0\db_2\bin\orancrypt10.dll
ModLoad: 62920000 6296c000 C:\oracle\product\10.2.0\db_2\bin\oranro10.dll
ModLoad: 626b0000 626b7000 C:\oracle\product\10.2.0\db_2\bin\oranhost10.dll
ModLoad: 62660000 62666000 C:\oracle\product\10.2.0\db_2\bin\orancds10.dll
ModLoad: 629c0000 629c8000 C:\oracle\product\10.2.0\db_2\bin\orantns10.dll
ModLoad: 60b50000 60ea8000 C:\oracle\product\10.2.0\db_2\bin\orapls10.dll
ModLoad: 0e250000 0e259000 C:\oracle\product\10.2.0\db_2\bin\oraslax10.dll
ModLoad: 63080000 63284000 C:\oracle\product\10.2.0\db_2\bin\oraplp10.dll
ModLoad: 61ed0000 61f5b000 C:\oracle\product\10.2.0\db_2\bin\orahasgen10.dll
ModLoad: 62ab0000 62b1a000 C:\oracle\product\10.2.0\db_2\bin\oraocr10.dll
ModLoad: 62b20000 62b60000 C:\oracle\product\10.2.0\db_2\bin\oraocrb10.dll
ModLoad: 62980000 62990000 C:\oracle\product\10.2.0\db_2\bin\orantcp10.dll
ModLoad: 0f460000 0f4fa000 C:\oracle\product\10.2.0\db_2\bin\orasql10.dll
ModLoad: 71bc0000 71bc8000 C:\WINDOWS\system32\rdpsnd.dll
ModLoad: 771f0000 77201000 C:\WINDOWS\system32\WINSTA.dll
ModLoad: 71f60000 71f64000 C:\WINDOWS\system32\security.dll
ModLoad: 76df0000 76e24000 C:\WINDOWS\system32\activeds.dll
ModLoad: 76dc0000 76de8000 C:\WINDOWS\system32\adsldpc.dll
ModLoad: 76b80000 76bae000 C:\WINDOWS\system32\credui.dll
ModLoad: 76a80000 76a98000 C:\WINDOWS\system32\ATL.DLL
ModLoad: 76c90000 76cb7000 C:\WINDOWS\system32\msv1_0.dll
ModLoad: 76cf0000 76d0a000 C:\WINDOWS\system32\iphlpapi.dll
(11d0.11f8): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 06 Sep 2007 14:27

We will investigate this.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 07 Sep 2007 07:22

We suppose that this problem has something to do with your SQL query and with your data in the database. Maybe some specific value in a table or specific type of the field raises this problem.
Could you try to execute your query in separate application?
Or try to limit record count or column count in your resultset.
Last edited by Alexey on Fri 07 Sep 2007 09:24, edited 1 time in total.

george_zhu
Posts: 11
Joined: Fri 10 Mar 2006 09:53

Post by george_zhu » Fri 07 Sep 2007 08:58

Alexey wrote:We suppose that this problem has something to do with your SQL query and with your data in the database. Maybe some specific value in a table or specific type of the field raises this problem.
Could you try to execute your query in separate application?
Or try to limit record count or column count in your resultset.
I take a close examination on sql query, we have two program run the same query, but one failed, one succeeed.

Code: Select all

program A Crash at Time:9/7/2007 4:38:40 AM
db connection:Topobase.Data.Sys.SysConnection
sql:select COLUMN_NAME, DATA_TYPE, DATA_PRECISION, DATA_LENGTH, DATA_SCALE, NULLABLE, DATA_DEFAULT, CHAR_LENGTH from ALL_TAB_COLUMNS where upper(OWNER) = 'TBSYS_JUDD' and upper(TABLE_NAME) = 'TB_USER' order by COLUMN_ID

program B executes at Time:9/7/2007 4:42:02 AM
db connection:Topobase.Data.Sys.SysConnection
sql:select COLUMN_NAME, DATA_TYPE, DATA_PRECISION, DATA_LENGTH, DATA_SCALE, NULLABLE, DATA_DEFAULT, CHAR_LENGTH from ALL_TAB_COLUMNS where upper(OWNER) = 'TBSYS_JUDD' and upper(TABLE_NAME) = 'TB_USER' order by COLUMN_ID
as you can see, the sql query are the same, and I can execute the same query without any problem...

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 07 Sep 2007 09:43

Is it possible to provide us with your project?

george_zhu
Posts: 11
Joined: Fri 10 Mar 2006 09:53

Post by george_zhu » Wed 23 Jan 2008 02:43

Sorry, I forget to add our final solution.

We finally solve the problem by update a third party module which is used to detect license stuff....

Post Reply