Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.IndexOutOfRangeException [DNET755] #697

Closed
firebird-automations opened this issue Apr 20, 2017 · 6 comments
Closed

System.IndexOutOfRangeException [DNET755] #697

firebird-automations opened this issue Apr 20, 2017 · 6 comments

Comments

@firebird-automations
Copy link

Submitted by: Marcos R. Weimer (marcosweimer)

    public void DisparaEvento\(string evento\)
    \{
        using \(FbCommand q = conexao\.CreateCommand\(\)\)
        \{
            q\.CommandType = CommandType\.Text;
            q\.CommandText = "execute block as begin POST\_EVENT '" \+ evento \+ "'; end";
            q\.ExecuteNonQuery\(\); <\-\-\-\-\-\-\-\-\-\-\-\- Exception here
        \}
    \}

Multiple calls in a row...

DisparaEvento("EnviarNF");
DisparaEvento("ReciboNF");
DisparaEvento("CancelarNF");
DisparaEvento("DownloadNF");
DisparaEvento("ConsDestNF");
DisparaEvento("NFSe");

eventually:

An unhandled exception of type 'System.IndexOutOfRangeException' occurred in FirebirdSql.Data.FirebirdClient.dll

Stack:
em FirebirdSql.Data.Common.StatementBase.ProcessStatementTypeInfoBuffer(Byte[] buffer)
em FirebirdSql.Data.Client.Managed.Version11.GdsStatement.Prepare(String commandText)
em FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet)
em FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet)
em FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery()
em UltraNFe.EventosFB.DisparaEvento(String evento) na C:\ultra\UltraNFe2\EventosFB.cs:linha 100
em UltraNFe.EventosFB.DispararEventos() na C:\ultra\UltraNFe2\EventosFB.cs:linha 110
em UltraNFe.FPrincipal.btnAutomatico_Click(Object sender, EventArgs e) na C:\ultra\UltraNFe2\Form1.cs:linha 506
em UltraNFe.FPrincipal.Form1_Shown(Object sender, EventArgs e) na C:\ultra\UltraNFe2\Form1.cs:linha 195
em System.Windows.Forms.Form.OnShown(EventArgs e)
em System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
em System.Windows.Forms.Control.InvokeMarshaledCallbacks()
em System.Windows.Forms.Control.WndProc(Message& m)
em System.Windows.Forms.Form.WndProc(Message& m)
em System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
em System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
em System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
em System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
em System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
em UltraNFe.Program.Main() na C:\ultra\UltraNFe2\Program.cs:linha 64
em System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
em System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
em Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Threading.ThreadHelper.ThreadStart()

Not ocurred in Firebird 2.5.7.27050 with FirebirdSQL.Data.FirebirdClient 2.7.7.0

@firebird-automations
Copy link
Author

Modified by: Marcos R. Weimer (marcosweimer)

description:
public void DisparaEvento(string evento)
{
using (FbCommand q = conexao.CreateCommand())
{
q.CommandType = CommandType.Text;
q.CommandText = "execute block as begin POST_EVENT '" + evento + "'; end";
q.ExecuteNonQuery();
}
}

Multiple calls in a row...

DisparaEvento("EnviarNF");
DisparaEvento("ReciboNF");
DisparaEvento("CancelarNF");
DisparaEvento("DownloadNF");
DisparaEvento("ConsDestNF");
DisparaEvento("NFSe");

eventually:

An unhandled exception of type 'System.IndexOutOfRangeException' occurred in FirebirdSql.Data.FirebirdClient.dll

Stack:
em FirebirdSql.Data.Common.StatementBase.ProcessStatementTypeInfoBuffer(Byte[] buffer)
em FirebirdSql.Data.Client.Managed.Version11.GdsStatement.Prepare(String commandText)
em FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet)
em FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet)
em FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery()
em UltraNFe.EventosFB.DisparaEvento(String evento) na C:\ultra\UltraNFe2\EventosFB.cs:linha 100
em UltraNFe.EventosFB.DispararEventos() na C:\ultra\UltraNFe2\EventosFB.cs:linha 110
em UltraNFe.FPrincipal.btnAutomatico_Click(Object sender, EventArgs e) na C:\ultra\UltraNFe2\Form1.cs:linha 506
em UltraNFe.FPrincipal.Form1_Shown(Object sender, EventArgs e) na C:\ultra\UltraNFe2\Form1.cs:linha 195
em System.Windows.Forms.Form.OnShown(EventArgs e)
em System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
em System.Windows.Forms.Control.InvokeMarshaledCallbacks()
em System.Windows.Forms.Control.WndProc(Message& m)
em System.Windows.Forms.Form.WndProc(Message& m)
em System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
em System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
em System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
em System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
em System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
em UltraNFe.Program.Main() na C:\ultra\UltraNFe2\Program.cs:linha 64
em System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
em System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
em Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Threading.ThreadHelper.ThreadStart()

Not ocurred in Firebird 2.5.7.27050 with FirebirdSQL.Data.FirebirdClient 2.7.7.0

=>

    public void DisparaEvento\(string evento\)
    \{
        using \(FbCommand q = conexao\.CreateCommand\(\)\)
        \{
            q\.CommandType = CommandType\.Text;
            q\.CommandText = "execute block as begin POST\_EVENT '" \+ evento \+ "'; end";
            q\.ExecuteNonQuery\(\); <\-\-\-\-\-\-\-\-\-\-\-\- Exception here
        \}
    \}

Multiple calls in a row...

DisparaEvento("EnviarNF");
DisparaEvento("ReciboNF");
DisparaEvento("CancelarNF");
DisparaEvento("DownloadNF");
DisparaEvento("ConsDestNF");
DisparaEvento("NFSe");

eventually:

An unhandled exception of type 'System.IndexOutOfRangeException' occurred in FirebirdSql.Data.FirebirdClient.dll

Stack:
em FirebirdSql.Data.Common.StatementBase.ProcessStatementTypeInfoBuffer(Byte[] buffer)
em FirebirdSql.Data.Client.Managed.Version11.GdsStatement.Prepare(String commandText)
em FirebirdSql.Data.FirebirdClient.FbCommand.Prepare(Boolean returnsSet)
em FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteCommand(CommandBehavior behavior, Boolean returnsSet)
em FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery()
em UltraNFe.EventosFB.DisparaEvento(String evento) na C:\ultra\UltraNFe2\EventosFB.cs:linha 100
em UltraNFe.EventosFB.DispararEventos() na C:\ultra\UltraNFe2\EventosFB.cs:linha 110
em UltraNFe.FPrincipal.btnAutomatico_Click(Object sender, EventArgs e) na C:\ultra\UltraNFe2\Form1.cs:linha 506
em UltraNFe.FPrincipal.Form1_Shown(Object sender, EventArgs e) na C:\ultra\UltraNFe2\Form1.cs:linha 195
em System.Windows.Forms.Form.OnShown(EventArgs e)
em System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
em System.Windows.Forms.Control.InvokeMarshaledCallbacks()
em System.Windows.Forms.Control.WndProc(Message& m)
em System.Windows.Forms.Form.WndProc(Message& m)
em System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
em System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
em System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
em System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
em System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
em UltraNFe.Program.Main() na C:\ultra\UltraNFe2\Program.cs:linha 64
em System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
em System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
em Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Threading.ThreadHelper.ThreadStart()

Not ocurred in Firebird 2.5.7.27050 with FirebirdSQL.Data.FirebirdClient 2.7.7.0

@firebird-automations
Copy link
Author

Commented by: Marcos R. Weimer (marcosweimer)

Eventual InvalidCastException during receive events...

<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Exceção não tratada</Description><AppDomain>UltraNFe.vshost.exe</AppDomain><Exception><ExceptionType>System.InvalidCastException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Não é possível converter um objeto do tipo 'FirebirdSql.Data.Client.Managed.SqlResponse' no tipo 'FirebirdSql.Data.Client.Managed.GenericResponse'.</Message><StackTrace> em FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.QueueEvents(RemoteEvent events)
em FirebirdSql.Data.Common.RemoteEvent.EventCounts(Byte[] buffer)
em FirebirdSql.Data.Client.Managed.Version10.GdsEventManager.ThreadHandler(Object _)
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Threading.ThreadHelper.ThreadStart(Object obj)</StackTrace><ExceptionString>System.InvalidCastException: Não é possível converter um objeto do tipo 'FirebirdSql.Data.Client.Managed.SqlResponse' no tipo 'FirebirdSql.Data.Client.Managed.GenericResponse'.
em FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.QueueEvents(RemoteEvent events)
em FirebirdSql.Data.Common.RemoteEvent.EventCounts(Byte[] buffer)
em FirebirdSql.Data.Client.Managed.Version10.GdsEventManager.ThreadHandler(Object _)
em System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
em System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
em System.Threading.ThreadHelper.ThreadStart(Object obj)</ExceptionString></Exception></TraceRecord> 7.01s

@firebird-automations
Copy link
Author

Commented by: @cincuranet

I can't test it, because you haven't provided any code. But I think it's fixed in above mentioned version.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: vNext - Events [ 10808 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Fix Version: vNext [ 10812 ]

Fix Version: vNext - Events [ 10808 ] =>

@firebird-automations
Copy link
Author

Commented by: Marcos R. Weimer (marcosweimer)

code in first description...
[quoted]
public void DisparaEvento(string evento)
{
using (FbCommand q = conexao.CreateCommand())
{
q.CommandType = CommandType.Text;
q.CommandText = "execute block as begin POST_EVENT '" + evento + "'; end";
q.ExecuteNonQuery();
}
}

Multiple calls in a row...

DisparaEvento("EnviarNF");
DisparaEvento("ReciboNF");
DisparaEvento("CancelarNF");
DisparaEvento("DownloadNF");
DisparaEvento("ConsDestNF");
DisparaEvento("NFSe");
[quoted]

- I'm testing at 3 o'clock.
- seems to have solved the problem using framework 4.5.2 and Dll in version 5.9.0.0
- once you have a warning advice.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants