[vtkusers] App crashes unless compiled with debug config (Windows)

David E DeMarle dave.demarle at kitware.com
Thu Sep 1 23:45:24 EDT 2016


Whatever your sourceFiles->GetFileNames object has uninitialized pointers.

Debug mode initializes all values to 0, release does not (in order to save
run time), but this leaves you with some pointer pointing to nonsense.



David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Thu, Sep 1, 2016 at 11:32 PM, Oliver Cairncross <op.cairncross at gmail.com>
wrote:

> Hi,
>
> vtk 7, msvc 14, windows 10
>
> I've had this problem before and thought it was something bad in my tool
> chain. But I've rebuild everything from scratch and it's still a problem.
>
> If I do something simple like
>
> string s1 = sourceFiles->GetFileNames()->GetValue(i);
>
> it runs fine in debug mode. When I compile in RelwithDebInfo it crashes
> with a bad allocation.
> When I have a look at the object the there is garbage where the string is
> supposed to be. As if it hasn't been initialised. I am calling an
>  sourceFiles->Update() beforehand.
>
> Interestingly if I do
>
> cout << sourceFiles->GetFileNames()->GetValue(i);
> string s1 = sourceFiles->GetFileNames()->GetValue(i);
>
> it will print to console and then crash on the next line.
>
> Is anyone else having this problem?
>
> Cheers
> ollie
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160901/f023860e/attachment.html>


More information about the vtkusers mailing list