[Insight-users] Visual Studio 2012 ITK-4.4.0 assert failed on TransformType::New();

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Jun 20 18:36:00 EDT 2013


This has been fix in ITK master and is scheduled to be in the 4.4.1 patch release.

I believe that this was mentioned in the ITK 4.4 release announcement.

On Jun 20, 2013, at 4:47 PM, John Drescher <drescherjm at gmail.com> wrote:

> I have hit an assert failed apparently due to the usage if 0 as an
> iterator and the VS builtin checked iterators. The following simple
> program will assert when run in Visual Studio 2012 in debug mode ( I
> did not try other modes).
> 
> // main.cxx
> 
> #include <itkIdentityTransform.h>
> 
> int main(int, char*[])
> {
> 	typedef itk::IdentityTransform< double, 3 >				TransformType;
> 	
> 	// The following line will assert in Visual Studio 2012 with checked iterators
> 	TransformType::Pointer transform = TransformType::New();
> 	
> }
> 
> // CMakeLists.txt
> cmake_minimum_required(VERSION 2.8)
> project ( TestItkIdentityTransform )
> 
> find_package(ITK REQUIRED)
> include(${ITK_USE_FILE})
> 
> add_executable( ${PROJECT_NAME} main.cxx )
> 
> target_link_libraries( ${PROJECT_NAME} ${ITK_LIBRARIES} )
> 
> 
> The problem is with
> 
> template <class T>
> vnl_matrix<T>& vnl_matrix<T>::fill (T const& value)
> 
> 
> template <class T>
> vnl_matrix<T>& vnl_matrix<T>::fill (T const& value)
> {
>  // not safe if data == NULL, due to data[0] call
>  if (data)
>    vcl_fill_n( this->data[0], this->num_rows * this->num_cols, value );
>  return *this;
> }
> 
> in when it executes  this->data[0] == 0 and this causes VS to assert
> with "invalid null pointer"  even though this->num_rows *
> this->num_cols is also 0.
> 
> John
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list