title: .NET application exits without exception 0x4000001f
body: <p>The application exits with:</p>
  
  <blockquote>
    <p>The program '[12868] AppName.vshost.exe' has exited with code 1073741855 (0x4000001f).</p>
  </blockquote>
  
  <p>Below Code:</p>
  
  <p>Call <code>Export()</code> twice after each other: crash with above logging
  Call the contents of <code>Export()</code> inside <code>Export()</code> twice (the inner scope), and it doesn't crash.</p>
  
  <p>This is reproducible, I have no idea where to start.</p>
  
  <pre><code>private void btnExport_Click(object sender, RoutedEventArgs e)
  {
      Enable(false);
  
      statusbar.Message = "Exporting...";
  
      Task t = new Task(Export);
      t.ContinueWith(ExportEnd);
      t.Start();
  }
  
  private void Export()
  {
      {
          PBNSectionDictionary source = ctrlSectionSelection.SectionSelection.SelectSections;
          PBNSectionDictionary dict = new PBNSectionDictionary();
          foreach (string sectionType in source.Keys)
          {
              if (source[sectionType] != null)
              {
                  dict[sectionType] = collector.ReadFullSection(source[sectionType]);
              }
          }
          PBNFMV.Export.PBNExport export = new PBNFMV.Export.PBNExport(new Lms.Custom.Files.AdvancedFileLocator(Constants.NAME), dict, manager);
          export.Export();
          dict.Dispose();
      }
  }
  
  private void ExportEnd(Task t)
  {
      Enable(true);
  
      statusbar.Message = "Export done";
  }
  </code></pre>
  
  <p>Event log:</p>
  
  <blockquote>
    <p>Faulting application name: PBNFMV.exe, version: 16.2.0.0, time stamp: 0x58aeadf2
    Faulting module name: ntdll.dll, version: 6.1.7601.23569, time stamp: 0x57f7bb79
    Exception code: 0xc0000374
    Fault offset: 0x000ce8fb
    Faulting process id: 0xbd4
    Faulting application start time: 0x01d28db92a6d6c1e
    Faulting application path: C:\APPPATH\source\PBNFMV\bin\Debug\PBNFMV.exe
    Faulting module path: C:\windows\SysWOW64\ntdll.dll
    Report Id: 72f988f9-f9ac-11e6-8d91-000acd1f71fd</p>
  </blockquote>
  
  <p>Exception settings completely enabled:</p>
  
  <p>C++ exceptions
  common language runtime exceptions
  gpu memory access exceptions
  managed debugging assitants
  win32 exceptions</p>