Help diagnosing multiple exceptions

Hi.

We are currently using PDFNet 6.4.1.29791. We use the WPF control for displaying documents, and I’ve been observing lots of exceptions, so I thought I’ll bundle them, and see if anyone can help pin point their root cause …

pdftron.Common.PDFNetException was unhandled by user code
HResult=-2146233088
Message=Exception:
Message: Not enough storage is available to process this command.
Conditional expression: ip::interprocess_exception
Filename : MappedFile.cpp
Function : trn::Filters::MappingManager::CreateMapping
Linenumber : 260

Source=PDFNet
StackTrace:
at pdftron.PDF.PDFDoc…ctor(String filepath)

pdftron.Common.PDFNetException was unhandled by user code
HResult=-2146233088
Message=Exception:
Message: Bad Allocation
Conditional expression: allocated_array == 0
Filename : AlignedBuffer.hpp
Function : Allocate(UInt32 num_bytes)
Linenumber : 164

Source=PDFNet
StackTrace:
at pdftron.PDF.PDFViewWPF.SetZoom(Double zoom)

System.Reflection.TargetInvocationException was unhandled
HResult=-2146232828
Message=Exception has been thrown by the target of an invocation.
Source=mscorlib
StackTrace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(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.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at Main()
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()
InnerException:
HResult=-2146233088
Message=Exception:
Message: Bad Allocation
Conditional expression: allocated_array == 0
Filename : AlignedBuffer.hpp
Function : Allocate(UInt32 num_bytes)
Linenumber : 164

Source=PDFNet
StackTrace:
at pdftron.PDF.PDFViewWPF.FinalRenderDelegateImpl()
InnerException:

Hi, the first thing to do would be to try the latest version of PDFNet.

Both the official and nightly release.
Latest official: https://www.pdftron.com/pdfnet/downloads.html
Release channel: http://www.pdftron.com/nightly/?p=stable/

Otherwise, we would need additional information on the steps to reproduce. In particular, if this occurs in the SDK samples, or only in your own project.

Finally, do these errors occur only with certain PDF files, or is it a general issue?