Red Gate forums :: View topic - System.AccessViolationException when profiling on x64
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Performance Profiler 5
ANTS Performance Profiler 5 forum

System.AccessViolationException when profiling on x64

Search in ANTS Performance Profiler 5 forum
Post new topic   Reply to topic
Jump to:  
Author Message
arunsingh



Joined: 28 Jan 2010
Posts: 1

PostPosted: Thu Jan 28, 2010 6:59 pm    Post subject: System.AccessViolationException when profiling on x64 Reply with quote

Here is the stack trace of the exception that is thrown when I try to profile my application.

It is easily reproducible. The problem occurs when I build my project for x32 and try to profile on a x64 bit platform with ANTS Profiler.

It does not have any problem running this application normally outside the profiler.

Here are the details of various version numbers:
ANTS Performance Profiler 5.2.0.26
MS Visual Studio 2008 Version 9.0.21022.8 RTM
MS .NET Framework Version 3.5 SP1
OS Name Microsoft(R) Windows(R) Server 2003 Standard x64 Edition
OS Version 5.2.3790 Service Pack 2 Build 3790

[code]Exception caught: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at SNIOpenEx(SNI_CONSUMER_INFO* , UInt16* , SNI_Conn** , Int32 , UInt32 , Byte* , Byte* , Int32 , Int32 )
at SNINativeMethodWrapper.SNIOpenEx(ConsumerInfo consumerInfo, String constring, IntPtr& pConn, Boolean fInitSec, Byte[] sspiBuffer, Byte[] instanceName, Boo
lean fOverrideCache, Boolean fSync)
at System.Data.SqlClient.SNIHandle..ctor(ConsumerInfo myInfo, String serverName, Boolean integratedSecurity, Byte[] serverUserName, Boolean ignoreSniOpenTime
out, Int32 timeout, Byte[]& instanceName, Boolean flushCache, Boolean fSync)
at System.Data.SqlClient.TdsParserStateObject.CreatePhysicalSNIHandle(String serverName, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Byte[]& instanceNam
e, Boolean integratedSecurity, Byte[] serverUserName, Boolean flushCache, Boolean async)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Bool
ean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnectionowningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire,
SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject
, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Bool
ean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String
newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Toy1.Program.Main(String[] args) in E:\Arun\Toy1\Toy1\Toy1\Program.cs:line 21
at SNIOpenEx(SNI_CONSUMER_INFO* , UInt16* , SNI_Conn** , Int32 , UInt32 , Byte* , Byte* , Int32 , Int32 )
at SNINativeMethodWrapper.SNIOpenEx(ConsumerInfo consumerInfo, String constring, IntPtr& pConn, Boolean fInitSec, Byte[] sspiBuffer, Byte[] instanceName, Boo
lean fOverrideCache, Boolean fSync)
at System.Data.SqlClient.SNIHandle..ctor(ConsumerInfo myInfo, String serverName, Boolean integratedSecurity, Byte[] serverUserName, Boolean ignoreSniOpenTime
out, Int32 timeout, Byte[]& instanceName, Boolean flushCache, Boolean fSync)
at System.Data.SqlClient.TdsParserStateObject.CreatePhysicalSNIHandle(String serverName, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Byte[]& instanceNam
e, Boolean integratedSecurity, Byte[] serverUserName, Boolean flushCache, Boolean async)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Bool
ean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire,
SqlConnection owningObject)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject
, SqlConnectionString connectionOptions, Int64 timerStart)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Bool
ean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String
newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Toy1.Program.Main(String[] args) in E:\Arun\Toy1\Toy1\Toy1\Program.cs:line 21[/code]

[code]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Toy1
{
class Program
{
static void Main(string[] args)
{
try
{
string conn_str = "data source=MyOwnDS;initial catalog=TestDB;persist security info=False;user id=sa;password=secret007;packet size=4096;connect timeout=202";
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(conn_str);
System.Data.SqlClient.SqlDataAdapter adapter = new System.Data.SqlClient.SqlDataAdapter(
@"SELECT * FROM tblTestTable1
WHERE iSomeIntID in (560,504);",
conn);
System.Data.DataTable table = new System.Data.DataTable();
conn.Open();
adapter.Fill(table);
conn.Close();
int N = table.Rows.Count;
System.Console.WriteLine("Got " + N + " rows");

foreach (System.Data.DataRow r in table.Rows)
{
System.Console.WriteLine(r["strIP"]);
}
}
catch (System.Exception e)
{
System.Console.WriteLine("Exception caught: " + e.ToString());
System.Console.WriteLine(e.StackTrace);
}
System.Console.WriteLine("Press a key");
string s = System.Console.ReadLine();

}
}
}
[/code]

Running this program normally gives:
[code]
Got 2 rows
10.6.152.175
10.6.155.172
Press a key
[/code]
Back to top
View user's profile Send private message
nick.maidment



Joined: 29 Jan 2010
Posts: 74

PostPosted: Tue Feb 02, 2010 5:02 pm    Post subject: System.AccessViolationException when profiling on x64 Reply with quote

This seems to be a result of a problem with opening sockets under ANTS- at the moment all that can be done is to use version 4.0- avaialble on our Previous Versions page:

http://www.red-gate.com/supportcenter/GeneralContent.aspx?c=all_products\articles\old_versions.htm
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group