[vtk-developers] Runtime crash using VTK statically linked

Jorge Vigil jorge.vigil at civilnova.com
Thu Jan 26 09:57:29 EST 2017


Hi,

We're facing some runtime crashes using Vtk static library.

Our configuration is:

vtk version: 7.1.0
OS: Windows 10 64 bit
Compiler: msvc 2015 update 2
CMAKE flags:  CMAKE_CXX_FLAGS_DEBUG = "/D_DEBUG /MDd /Zi /Od"
BUILD_SHARED_LIBS = "Off"

The callstack always is:

ntdll!RtlpBreakPointHeap+0x16
ntdll!RtlpValidateHeapEntry+0x50752
ntdll!RtlValidateHeap+0x9f
KERNELBASE!HeapValidate+0xa
ucrtbased!CrtIsValidHeapPointer+0x31
ucrtbased!calloc_base+0xa19
ucrtbased!free_dbg+0x55
CN_Graphicsd!odrxFree+0x2e
CN_Graphicsd!operator delete[]+0x32
CN_Graphicsd!vtkFieldData::BasicIterator::~BasicIterator+0x30
CN_Graphicsd!vtkDataSetAttributes::ComputeRequiredArrays+0x4ef
CN_Graphicsd!vtkDataSetAttributes::PassData+0x59
CN_Graphicsd!vtkTriangleFilter::RequestData+0xc8f
CN_Graphicsd!vtkPolyDataAlgorithm::ProcessRequest+0x50
CN_Graphicsd!vtkExecutive::CallAlgorithm+0xa7
CN_Graphicsd!vtkDemandDrivenPipeline::ExecuteData+0x67
CN_Graphicsd!vtkCompositeDataPipeline::ExecuteData+0x414
CN_Graphicsd!vtkDemandDrivenPipeline::ProcessRequest+0x38f
CN_Graphicsd!vtkStreamingDemandDrivenPipeline::ProcessRequest+0x8e1
CN_Graphicsd!vtkDemandDrivenPipeline::UpdateData+0x2d9

where CN_Graphics is the name of our internal library.

Error output is:

HEAP[ProgramName.exe]: Invalid address specified to RtlValidateHeap( 
000001A836E40000, 00007FFB9395AE88 )
(4b50.47b8): Break instruction exception - code 80000003 (first chance)


We tested the following solution changing the source file vtkFieldData.cxx:

**Common/DataModel/vtkFieldData.cxx** : *Line 159*

vtkFieldData::BasicIterator::~BasicIterator()
{
   if (this->List && this->ListSize > 0) // <- delete list if and only 
if it's initialized
   {
     delete[] this->List;
   }

   this->List = 0;
}


Curiously, this odd behaviour only occurs when vtk is linked statically. 
It seem that our proposed solution works fine, but we're not completely 
sure.

Thanks in advance.

-- 
firma_civilnova
------------------------------------------------------------------------

/*Jorge Vigil Iglesias*/
*Ingeniero de Minas*
*T:*    +34 661973672
*F:*    +34 984086393
*E:* jorge.vigil at civilnova.com 
<mailto:jorge.vigil at civilnova.com?Subject=Respuesta>
*W: * www.civilnova.com

Logo CivilNova

<https://www.facebook.com/civilnova.software?ref=hl> 
<https://twitter.com/CivilNova_tweet> 
<https://www.youtube.com/channel/UCfH8XW77IhdTOoYIlGtqZ3A> 
<https://www.linkedin.com/profile/view?id=99512847&trk=nav_responsive_tab_profile> 
Logo CivilNova

*Aviso legal:*Este mensaje y los documentos que, en su caso, lleve 
anexos, contienen información privada y confidencial y está dirigida 
únicamente a su destinatario, según lo dispuesto en la Ley Orgánica 
15/99 de Protección de Datos. Si usted no es el destinatario original de 
este mensaje y por este medio pudo acceder a dicha información por favor 
elimine el mensaje y comuníquenoslo por la misma vía. La distribución o 
copia de este mensaje está estrictamente prohibida. La transmisión de 
e-mails no garantiza que el correo electrónico sea seguro o libre de 
error. Por consiguiente, no manifestamos que esta información sea 
completa o precisa.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170126/b6478808/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: firma.png
Type: image/png
Size: 58582 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170126/b6478808/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_facebook.png
Type: image/png
Size: 1877 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170126/b6478808/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_twitter.png
Type: image/png
Size: 2176 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170126/b6478808/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_youtube.png
Type: image/png
Size: 2423 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170126/b6478808/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_linkedin.png
Type: image/png
Size: 2034 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170126/b6478808/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CivilBlastN_black_100.png
Type: image/png
Size: 49185 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20170126/b6478808/attachment-0011.png>


More information about the vtk-developers mailing list