System.AccessViolationException



  • This problem is really bugging me, and I can't find information on it.

     Periodically my application will fail  with a  critical error, but only when connected to Oracle. My application is a .NET 2.0 Service (also fails when running as a console applicaion. If the application fails, it is usually shortly after startup. If it doesn't fail, then it can fun for weeks without failing. The Application never fails when connected to SQL Server 2005. The exception apparently cannot be handled and the application terminates immediately. It can fail in Debug and in Release.

    I'm using the ODP.NET 2.102.2.20 to connect to a 10g database. (It also fails with a 9i database.)

    The failure:

     Randomly fails in an unnamed thread with a call stack:
    <StackTrace>
       at Oracle.DataAccess.Client.OpsSql.Timeout(OpoSqlValTimeoutCtx&amp;amp; opoSqlValTimeoutCtx)
       at Oracle.DataAccess.Client.OracleCommand.Timeout(Object state)
       at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
    </StackTrace>

     Exception: System.AccessViolationException

    <Message>Attempted to read or write protected memory. This is often an indication that other memory is corrupt.</Message>

    Has anyone ever seen this?

     

     

     



  • I'll join the club...

    I'm getting that one quite frequently now, seems like I about to identify the pattern...



  • You're probably accessing a more recent database with a 9.2.0.1 client.

     Apparently the bug is not published, but I found a repost here:  System.AccessViolationException: Attempted to read or write protected memory - MSDN Forums

    In fact, tracking this one down this morning inspired me to join the club. 



  • I'll put my bet on: you are connecting to an unpatched 10g2 database. 10.2.0.0 or something like that. Reason for that exception: your thread on the database server has just crashed. This kind of shit happens, and it obviously causes a timeout on the client side. Hint: Patching the server side of the database system helps al lot.



  • Thanks for the suggestions, I double checked all of my versions, and as far as I can tell, everything is as up to data as it can be.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p> My server version is Oracle 10g r2 (10.2.0.1.0)<o:p></o:p> I installed ODAC 10.2.0.2.20 which as far as I can tell is the current version for 10g. I confirmed the version of Oracle.DataAccess.dll that was loaded is 2.102.2.20.<o:p></o:p>The server's OS is Win 2003 server with SP1. My Client machines are running Win XP Pro SP2 with all up-to-date patches from windows update.<o:p></o:p>I have tried to step the Database back to Oracle 9i which was working properly before the upgrade to 10g, and the 10g driver still fails (the 9i driver was working). This failure is very random for me, and seems to even occur with database reads. I am still having the driver failure about once a week with no solution. I can't find anything reproducible enough to sent to Oracle. As far as I can tell, I'm doing things properly. <o:p></o:p>I find it difficult to find anything on Oracle's website. Is there any direct link to go to for server patches?<o:p></o:p>Thanks,<o:p></o:p>Kelly.<o:p></o:p>

     



  • @Kelly said:

    Is there any direct link to go to for server patches?Thanks,Kelly. 

     

    To get access to patches, you need a metalink account. 10.2.0.1.0 is no good, should be patched to (at least) 10.2.0.3.0 



  • Thanks a lot! I'll look into getting an update in about 2 weeks. It's a bad time at the moment. It sure would be nice if Oracle let people know that a version is no good.

    Kelly.



  • @Kelly said:

    Thanks a lot
     

    No problem! Let us know how that works out in 5 months!


Log in to reply