none
weird error

    Question

  • After I display my graph, I get this error :

    Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'C:\Users\bboone\source\repos\Zaber Multiplexer\Zaber Multiplexer\bin\Debug\Zaber Multiplexer.vshost.exe'.

    Additional information: The runtime has encountered a fatal error. The address of the error was at 0x71556e6e, on thread 0x1b50. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

    it will display the graph and then a few min later I get that error...

    staticvoid Main()
    
    {
    
    Application.EnableVisualStyles();
    
    Application.SetCompatibleTextRenderingDefault(false);
    
    try
    
    {
    
    Application.Run(newForm1());
    
    }catch(Exception err)
    
    {
    
    MessageBox.Show(err.Message.ToString());
    
    }
    
    }
    

    and the Exception is not being catch ...

    Thursday, March 8, 2018 10:25 PM

All replies

  • Well, do a Clean and Rebuild the solution in Visual Studio.

    Thursday, March 8, 2018 10:36 PM
  • just did and it did not help

    Thursday, March 8, 2018 10:50 PM
    • Edited by Btb4198 Thursday, March 8, 2018 10:59 PM
    Thursday, March 8, 2018 10:51 PM
  • Start Visual Studio up using "Run as Administrator" and run the solution.
    Thursday, March 8, 2018 11:58 PM
  • If there is code in either form load or form shown then temporarily comment the code out, place a button on the form, place the code that was taken from load or shown and place it in the button click event.

    On the first line of this code, set a break-point, run the app, press the button and step through the code until the exception is thrown and report back.

    Alternately, if there is no code in form load or form shown and you are getting this error it must be coming from a control or component you have placed on the form which is causing this to happen. If so let us know what has been placed on the form and if the item is for the current version of Visual Studio and or the .NET Framework you are targeting.

     

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, March 9, 2018 10:31 AM
    Moderator
  • tried it,

    it did not work

    Friday, March 9, 2018 12:41 PM
  • Remove this catcher from your application run part of your program and see where the error really is. 

    }catch(Exception err)
    
    {
    
    MessageBox.Show(err.Message.ToString());
    
    }
    Your problem itself shows why that kind of error handling is only usefull as long as there are no errors. 


    Success
    Cor


    Friday, March 9, 2018 1:28 PM
  • The real error is :

    Exception of type 'System.OutOfMemoryException' was thrown.
    {"Exception of type 'System.OutOfMemoryException' was thrown."}
    at System.String.Concat(String str0, String str1, String str2)
       at System.ArgumentException.get_Message()
       at Zaber_Multiplexer.Program.Main() in C:\Users\bboone\source\repos\Zaber Multiplexer\Zaber Multiplexer\Program.cs:line 25
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

    Friday, March 9, 2018 2:14 PM
  • You're trying to allocate a string that is too large. See that Concat call in the stack? That is what is triggering the OOM so you are handling a message (an event handler probably) and trying to allocate a string that is simply too big. 

    Run your code in the debugger (F5) and the debugger will break on this exception. You can then try to identify what is going wrong.


    Michael Taylor http://www.michaeltaylorp3.net

    Friday, March 9, 2018 2:47 PM
    Moderator
  • The real error is :

    Exception of type 'System.OutOfMemoryException' was thrown.
    {"Exception of type 'System.OutOfMemoryException' was thrown."}
    at System.String.Concat(String str0, String str1, String str2)
       at System.ArgumentException.get_Message()
       at Zaber_Multiplexer.Program.Main() in C:\Users\bboone\source\repos\Zaber Multiplexer\Zaber Multiplexer\Program.cs:line 25
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

    Hi,

    I dont know if this might be of interest for you but...

    ... I received that fatal error in case of not cleanly copying objects before passing them to different threads. So one possible error was an "object in use" error or a concurrent write access on the same variable that bubbled up to that "fatal error", I dont know exactly, I just solved both in one pass by being more careful with those things... when accessing object properties (of bitmaps) simultaneously. Copying the propertiy values to thread local variables before spanning the threads helped...

    Regards,

      Thorsten


    Friday, March 9, 2018 11:11 PM