<div dir="ltr">Hi Kevin,<div><br></div><div>I'm cc'ing the list with my reply in case anyone else is having this issue.<br><br>It looks like the object factory is not being set up properly, since vtkRenderingOpenGL2 is linked (otherwise you wouldn't enter vtkOpenGLTextActor in the stack), but vtkTexture::New() is returning NULL instead of a new vtkOpenGLTexture pointer (which is triggering the crash inside vtkOpenGLTextActor::New().<br><br>Is this project using CMake? If so, the object factory stuff should be take care of by default.<br><br>If not using CMake, you'll need to add a bit of code to your application to set things up. See the bottom of <a href="https://www.vtk.org/Wiki/VTK/Build_System_Migration">https://www.vtk.org/Wiki/VTK/Build_System_Migration</a>, I suspect that adding:</div><div><br></div><div><div> #include <vtkAutoInit.h></div><div> VTK_MODULE_INIT(vtkRenderingOpenGL2);</div><div> VTK_MODULE_INIT(vtkRenderingFreeType);</div></div><div><br></div><div>somewhere in your application will fix it. You'll need to add one of these VTK_MODULE_INIT calls for every linked VTK library.<br><br>HTH,<br>Allie</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 18, 2017 at 11:22 AM, Kevin Lee <span dir="ltr"><<a href="mailto:kevin.lee@emiservices.com" target="_blank">kevin.lee@emiservices.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_-2174337118625082814WordSection1"><p class="MsoNormal">I am linking vktRenderingFreeType-8.0.dll<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">The exception dialog window that VS2015 display when the exception occurs state: Exception thrown: read access violation.  This was nullptr.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">The call stack shows the following trace:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">vtkCommonExecutionModel-8.0.<wbr>dll!vtkAlgorithm::<wbr>SetInputDataInternal(int port, vtkDataObject * input) Line 949<u></u><u></u></p><p class="MsoNormal">vtkCommonExecutionModel-8.0.<wbr>dll!vtkImageAlgorithm::<wbr>SetInputData(int index, vtkDataObject * input) Line 406<u></u><u></u></p><p class="MsoNormal">vtkCommonExecutionModel-8.0.<wbr>dll!vtkImageAlgorithm::<wbr>SetInputData(vtkDataObject * input) Line 400<u></u><u></u></p><p class="MsoNormal">vtkRenderingCore-8.0.dll!<wbr>vtkTextActor::vtkTextActor() Line 75<u></u><u></u></p><p class="MsoNormal">vtkRenderingOpenGL2-8.0.dll!<wbr>vtkOpenGLTextActor::<wbr>vtkOpenGLTextActor() Line 56<u></u><u></u></p><p class="MsoNormal">vtkRenderingOpenGL2-8.0.dll!<wbr>vtkOpenGLTextActor::New() Line 56<u></u><u></u></p><p class="MsoNormal">MultiPlotDisplay.exe!<wbr>vtkSmartPointer<<wbr>vtkOpenGLTextActor>::New() Line 137<u></u><u></u></p><p class="MsoNormal">MultiPlotDisplay.exe!<wbr>CTextActor::CTextActor() Line 17<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">This is line 17 of my code that is failing.  It’s the first line in my class constructor:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black">m_pTextActor </span><span style="font-size:9.5pt;font-family:Consolas;color:teal">=</span><span style="font-size:9.5pt;font-family:Consolas;color:black"> </span><span style="font-size:9.5pt;font-family:Consolas;color:#2b91af">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:Consolas;color:black"><</span><span style="font-size:9.5pt;font-family:Consolas;color:#2b91af">vtkOpenGLTextA<wbr>ctor</span><span style="font-size:9.5pt;font-family:Consolas;color:black">>::New();<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black">This is how I declare the smart pointer in my class definition:<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u> <u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:#2b91af">vtkSmartPointer</span><span style="font-size:9.5pt;font-family:Consolas;color:black"><</span><span style="font-size:9.5pt;font-family:Consolas;color:#2b91af">vtkOpenGLTextA<wbr>ctor</span><span style="font-size:9.5pt;font-family:Consolas;color:black">> m_pTextActor;<u></u><u></u></span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;color:black"><u></u> <u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I appreciate the help.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><b>From:</b> Allie Vacanti [mailto:<a href="mailto:allison.vacanti@kitware.com" target="_blank">allison.vacanti@<wbr>kitware.com</a>] <br><b>Sent:</b> Monday, December 18, 2017 7:36 AM<br><b>To:</b> Kevin Lee <<a href="mailto:kevin.lee@emiservices.com" target="_blank">kevin.lee@emiservices.com</a>><br><b>Cc:</b> VTK Developers <<a href="mailto:vtk-developers@vtk.org" target="_blank">vtk-developers@vtk.org</a>><br><b>Subject:</b> Re: [vtk-developers] vtkOpenGLTextActor/<wbr>vtkTextActor exception error<u></u><u></u></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">The only bit of extra setup that vtkTextActor requires is that the vtkRenderingFreeType module needs to be linked, but it should print out something like "Failed getting the TextRenderer instance!" if that's not done, and vtkAlgorithm::<wbr>SetInputDataInternal shouldn't be a part of the stack.<br><br>What does the exception say? Can you provide a more detailed backtrace?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Fri, Dec 15, 2017 at 5:10 PM, Kevin Lee <<a href="mailto:kevin.lee@emiservices.com" target="_blank">kevin.lee@emiservices.com</a>> wrote:<u></u><u></u></p><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="m_-2174337118625082814m-1861866869117368958msoplaintext">I am using VTK 8.0.  When I call the New member function of either vtkOpenGLTextActor or vtkTextActor, my program throws an exception.  The exception occurs in:<u></u><u></u></p><p class="m_-2174337118625082814m-1861866869117368958msoplaintext">vtkCommonExecutionModel-8.0.<wbr>dll!vtkAlgorithm::<wbr>SetInputDataInternal(int port, vtkDataObject *input) Line 949<u></u><u></u></p><p class="m_-2174337118625082814m-1861866869117368958msoplaintext"> <u></u><u></u></p><p class="m_-2174337118625082814m-1861866869117368958msoplaintext">I have no problems instantiating a vtkOpenGLActor object.  Are there special setup requirements that must be in place before creating a text actor?<u></u><u></u></p><p class="MsoNormal"> <u></u><u></u></p></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>______________________________<wbr>_________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br><br>Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="https://vtk.org/mailman/listinfo/vtk-developers" target="_blank">https://vtk.org/mailman/<wbr>listinfo/vtk-developers</a><br><br><u></u><u></u></p></blockquote></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></blockquote></div><br></div>