Exception stacktrace does not contain full call stack

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Exception stacktrace does not contain full call stack

Giuliano Barberi
Can anyone explain to me why when I do exception.StackTrace it does not give
me the full call stack but when I call Environment.StackTrace it does?

For example, here's the callstack when I catch an exception and call
exception.StackTrace
================
2014-08-18 14:10:28,243 [Threadpool worker] ERROR Persistance.IDbManager -
Stack from exception:   at MySql.Data.MySqlClient.MySqlStream.ReadPacket ()
[0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32&
affectedRow, System.Int64& insertedId) [0x00000] in <filename unknown>:0  
================

And here is an exception when I call Environment.StackTrace from the place
where the exception is caught:

================
2014-08-18 14:10:28,244 [Threadpool worker] ERROR Persistance.IDbManager -
Stack from environment:    at System.Environment.get_StackTrace() in
/build/buildd/mono-3-opt-3.2.8/mcs/class/corlib/System/Environment.cs:line
261
   at
Persistance.Managers.MySqlDbManager.HandleGeneralException(System.Exception
e, System.Data.Common.DbCommand command) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Persistance/Managers/MySqlDbManager.cs:line
926
   at
Persistance.Managers.MySqlDbManager.ExecuteNonQuery(MySql.Data.MySqlClient.MySqlCommand
command) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Persistance/Managers/MySqlDbManager.cs:line
904
   at Persistance.Managers.MySqlDbManager.Query(System.String query,
Persistance.DbColumn[] parms) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Persistance/Managers/MySqlDbManager.cs:line
383
   at Game.Comm.SystemCommandLineModule.ThrowSqlError(Game.Comm.Session
session, System.String[] parms) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/CmdLine
Commands/SystemCommandLineModule.cs:line 35
   at Game.Comm.CommandLineProcessor.Execute(Game.Comm.Session session,
System.String cmd, System.String parms) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/CommandLineProcessor.cs:line
67
   at
Game.Comm.ProcessorCommands.CommandLineCommandsModule.CommandLine(Game.Comm.Session
session, Game.Comm.Packet packet) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/ProcessorCommands/CommandLineCommandsModule.cs:line
55
   at Game.Comm.Processor.Execute(Game.Comm.Session session,
Game.Comm.Packet packet) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/Processor.cs:line
49
   at Game.Comm.Session.Process(Game.Comm.Packet packet) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/Session.cs:line
92
   at Game.Comm.AsyncTcpServer+<ReadLoop>c__async1.MoveNext() in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/AsyncTcpServer.cs:line
301
   at Dawn.Net.Sockets.SocketAwaiter.<.ctor>b__0(System.Object param0,
System.Net.Sockets.SocketAsyncEventArgs param1)
   at
System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(System.Net.Sockets.SocketAsyncEventArgs
e) in
/build/buildd/mono-3-opt-3.2.8/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs:line
177
   at System.Net.Sockets.SocketAsyncEventArgs.ReceiveCallback(IAsyncResult
ares) in
/build/buildd/mono-3-opt-3.2.8/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs:line
253
   at System.Net.Sockets.SocketAsyncEventArgs.DispatcherCB(IAsyncResult
ares) in
/build/buildd/mono-3-opt-3.2.8/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs:line
222  
================

I have the mdb files and running with --debug if that makes a difference.

Thanks



--
View this message in context: http://mono.1490590.n4.nabble.com/Exception-stacktrace-does-not-contain-full-call-stack-tp4663558.html
Sent from the Mono - General mailing list archive at Nabble.com.
_______________________________________________
Mono-list maillist  -  [hidden email]
http://lists.ximian.com/mailman/listinfo/mono-list
Reply | Threaded
Open this post in threaded view
|

Re: Exception stacktrace does not contain full call stack

Giuliano Barberi
Also to add something else. I'm using async sockets if that makes a
difference. I did this to get the aggregate exception as well:
==============
task.ContinueWith(continuation =>
            {
                Logger.Error(continuation.Exception);
            }, TaskContinuationOptions.ExecuteSynchronously |
TaskContinuationOptions.OnlyOnFaulted);
==============

With Mono this is the exception that gets logged:
==============
2014-08-18 14:10:28,249 [Threadpool worker] ERROR Game.Engine - Unhandled
exception System.AggregateException:  --->
MySql.Data.MySqlClient.MySqlException: xxxxxxxxxxxxx
  at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in <filename
unknown>:0
  at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32&
affectedRow, System.Int64& insertedId) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
 --> (Inner exception 0) MySql.Data.MySqlClient.MySqlException: PROCEDURE
BOOM does not exist
  at MySql.Data.MySqlClient.MySqlStream.ReadPacket () [0x00000] in <filename
unknown>:0
  at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32&
affectedRow, System.Int64& insertedId) [0x00000] in <filename unknown>:0

 =================

whereas when I run it in the .NET framework I get this:
=================
2014-08-18 15:13:34,884 [39] ERROR Game.Engine - Unhandled exception
System.AggregateException: One or more errors occurred. --->
MySql.Data.MySqlClient.MySqlException: xxxxxxxxxxxxxxxxxx
   at Persistance.Managers.MySqlDbManager.HandleGeneralException(Exception
e, DbCommand command) in server\Persistance\Managers\MySqlDbManager.cs:line
935
   at Persistance.Managers.MySqlDbManager.ExecuteNonQuery(MySqlCommand
command) in server\Persistance\Managers\MySqlDbManager.cs:line 904
   at Persistance.Managers.MySqlDbManager.Query(String query, DbColumn[]
parms) in server\Persistance\Managers\MySqlDbManager.cs:line 383
   at Game.Comm.SystemCommandLineModule.ThrowSqlError(Session session,
String[] parms) in server\Game\Comm\CmdLine
Commands\SystemCommandLineModule.cs:line 35
   at Game.Comm.CommandLineProcessor.Execute(Session session, String cmd,
String parms) in server\Game\Comm\CommandLineProcessor.cs:line 67
   at
Game.Comm.ProcessorCommands.CommandLineCommandsModule.CommandLine(Session
session, Packet packet) in
server\Game\Comm\ProcessorCommands\CommandLineCommandsModule.cs:line 55
   at Game.Comm.Processor.Execute(Session session, Packet packet) in
server\Game\Comm\Processor.cs:line 49
   at Game.Comm.Session.Process(Packet packet) in
server\Game\Comm\Session.cs:line 92
   at Game.Comm.AsyncTcpServer.<ReadLoop>d__8.MoveNext() in
server\Game\Comm\AsyncTcpServer.cs:line 340
   --- End of inner exception stack trace ---
---> (Inner Exception #0) MySql.Data.MySqlClient.MySqlException
(0x80004005): Cannot load from mysql.proc. The table is probably corrupted
   at Persistance.Managers.MySqlDbManager.HandleGeneralException(Exception
e, DbCommand command) in server\Persistance\Managers\MySqlDbManager.cs:line
935
   at Persistance.Managers.MySqlDbManager.ExecuteNonQuery(MySqlCommand
command) in server\Persistance\Managers\MySqlDbManager.cs:line 904
   at Persistance.Managers.MySqlDbManager.Query(String query, DbColumn[]
parms) in server\Persistance\Managers\MySqlDbManager.cs:line 383
   at Game.Comm.SystemCommandLineModule.ThrowSqlError(Session session,
String[] parms) in server\Game\Comm\CmdLine
Commands\SystemCommandLineModule.cs:line 35
   at Game.Comm.CommandLineProcessor.Execute(Session session, String cmd,
String parms) in server\Game\Comm\CommandLineProcessor.cs:line 67
   at
Game.Comm.ProcessorCommands.CommandLineCommandsModule.CommandLine(Session
session, Packet packet) in
server\Game\Comm\ProcessorCommands\CommandLineCommandsModule.cs:line 55
   at Game.Comm.Processor.Execute(Session session, Packet packet) in
server\Game\Comm\Processor.cs:line 49
   at Game.Comm.Session.Process(Packet packet) in
server\Game\Comm\Session.cs:line 92
   at Game.Comm.AsyncTcpServer.<ReadLoop>d__8.MoveNext() in
server\Game\Comm\AsyncTcpServer.cs:line 340<---
=================



--
View this message in context: http://mono.1490590.n4.nabble.com/Exception-stacktrace-does-not-contain-full-call-stack-tp4663558p4663560.html
Sent from the Mono - General mailing list archive at Nabble.com.
_______________________________________________
Mono-list maillist  -  [hidden email]
http://lists.ximian.com/mailman/listinfo/mono-list
Reply | Threaded
Open this post in threaded view
|

Re: Exception stacktrace does not contain full call stack

Giuliano Barberi
In reply to this post by Giuliano Barberi
Can anyone help me out with this. I'm really baffled as to why this is happening. I wonder if it's something to do with async and the way mono builds up the aggregate exception but the behavior is certainly different than the .NET Framework and I am wondering if there is something I can do to get the correct stack trace.

Thanks!


On Mon, Aug 18, 2014 at 2:16 PM, giulianob <[hidden email]> wrote:
Can anyone explain to me why when I do exception.StackTrace it does not give
me the full call stack but when I call Environment.StackTrace it does?

For example, here's the callstack when I catch an exception and call
exception.StackTrace
================
2014-08-18 14:10:28,243 [Threadpool worker] ERROR Persistance.IDbManager -
Stack from exception:   at MySql.Data.MySqlClient.MySqlStream.ReadPacket ()
[0x00000] in <filename unknown>:0
  at MySql.Data.MySqlClient.NativeDriver.GetResult (System.Int32&
affectedRow, System.Int64& insertedId) [0x00000] in <filename unknown>:0
================

And here is an exception when I call Environment.StackTrace from the place
where the exception is caught:

================
2014-08-18 14:10:28,244 [Threadpool worker] ERROR Persistance.IDbManager -
Stack from environment:    at System.Environment.get_StackTrace() in
/build/buildd/mono-3-opt-3.2.8/mcs/class/corlib/System/Environment.cs:line
261
   at
Persistance.Managers.MySqlDbManager.HandleGeneralException(System.Exception
e, System.Data.Common.DbCommand command) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Persistance/Managers/MySqlDbManager.cs:line
926
   at
Persistance.Managers.MySqlDbManager.ExecuteNonQuery(MySql.Data.MySqlClient.MySqlCommand
command) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Persistance/Managers/MySqlDbManager.cs:line
904
   at Persistance.Managers.MySqlDbManager.Query(System.String query,
Persistance.DbColumn[] parms) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Persistance/Managers/MySqlDbManager.cs:line
383
   at Game.Comm.SystemCommandLineModule.ThrowSqlError(Game.Comm.Session
session, System.String[] parms) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/CmdLine
Commands/SystemCommandLineModule.cs:line 35
   at Game.Comm.CommandLineProcessor.Execute(Game.Comm.Session session,
System.String cmd, System.String parms) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/CommandLineProcessor.cs:line
67
   at
Game.Comm.ProcessorCommands.CommandLineCommandsModule.CommandLine(Game.Comm.Session
session, Game.Comm.Packet packet) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/ProcessorCommands/CommandLineCommandsModule.cs:line
55
   at Game.Comm.Processor.Execute(Game.Comm.Session session,
Game.Comm.Packet packet) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/Processor.cs:line
49
   at Game.Comm.Session.Process(Game.Comm.Packet packet) in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/Session.cs:line
92
   at Game.Comm.AsyncTcpServer+<ReadLoop>c__async1.MoveNext() in
/var/lib/jenkins/jobs/Server_Build/workspace/server/Game/Comm/AsyncTcpServer.cs:line
301
   at Dawn.Net.Sockets.SocketAwaiter.<.ctor>b__0(System.Object param0,
System.Net.Sockets.SocketAsyncEventArgs param1)
   at
System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(System.Net.Sockets.SocketAsyncEventArgs
e) in
/build/buildd/mono-3-opt-3.2.8/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs:line
177
   at System.Net.Sockets.SocketAsyncEventArgs.ReceiveCallback(IAsyncResult
ares) in
/build/buildd/mono-3-opt-3.2.8/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs:line
253
   at System.Net.Sockets.SocketAsyncEventArgs.DispatcherCB(IAsyncResult
ares) in
/build/buildd/mono-3-opt-3.2.8/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs:line
222
================

I have the mdb files and running with --debug if that makes a difference.

Thanks



--
View this message in context: http://mono.1490590.n4.nabble.com/Exception-stacktrace-does-not-contain-full-call-stack-tp4663558.html
Sent from the Mono - General mailing list archive at Nabble.com.
_______________________________________________
Mono-list maillist  -  [hidden email]
http://lists.ximian.com/mailman/listinfo/mono-list



--
Giuliano Barberi

_______________________________________________
Mono-list maillist  -  [hidden email]
http://lists.ximian.com/mailman/listinfo/mono-list