[vtk-developers] [VTK 0013018]: BUG: vtkFixedPointVolumeRayCastMapper in MFC Application, non standard std::bad_alloc behavior

Mantis Bug Tracker mantis at public.kitware.com
Wed Mar 21 09:19:50 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://vtk.org/Bug/view.php?id=13018 
====================================================================== 
Reported By:                Pavel Pokutnev
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   13018
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   high
Status:                     backlog
Project:                    TBD 
Type:                       crash 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2012-03-21 09:19 EDT
Last Modified:              2012-03-21 09:19 EDT
====================================================================== 
Summary:                    BUG: vtkFixedPointVolumeRayCastMapper in MFC
Application, non standard std::bad_alloc behavior
Description: 
vtkFixedPointVolumeRayCastMapper causes MFC application to crash on 32-bit
systems, during rendering of big volumes. The problem is the non standard
hahavior of the new operator. MFC provides its own operator new, which throws,
instead of std::bad_alloc, a CMemoryException* on allocation failure. This is
also the case in vtkFixedPointVolumeRayCastMapper during allocation of
ContiguousGradientNormal and ContiguousGradientMagnitude in the
ComputeGradients() function.  

To work around this issue we can either use "catch(...)" instead of
"catch(std::bad_alloc &)" or use the "new (std::nothrow)"!

This behavior was verified under VS9 and VS10!

Please see this article for more details on std::bad_alloc handling under VC++:
http://msdn.microsoft.com/en-us/magazine/cc164087.aspx

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-03-21 09:19 Pavel Pokutnev New Issue                                    
======================================================================




More information about the vtk-developers mailing list