MantisBT - VTK
View Issue Details
0013018VTK(No Category)public2012-03-21 09:192013-06-25 09:35
Pavel Pokutnev 
Dave DeMarle 
highminorhave not tried
closedfixed 
5.8.0 
5.10.0 
TBD
crash
0013018: BUG: vtkFixedPointVolumeRayCastMapper in MFC Application, non standard std::bad_alloc behavior
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 [^]
No tags attached.
Issue History
2012-03-21 09:19Pavel PokutnevNew Issue
2012-03-21 09:24Pavel PokutnevNote Added: 0028379
2013-06-25 09:32Dave DeMarleNote Added: 0031037
2013-06-25 09:32Dave DeMarleProjectVTK => ParaView
2013-06-25 09:33Dave DeMarleProjectParaView => VTK
2013-06-25 09:34Dave DeMarleStatusbacklog => todo
2013-06-25 09:34Dave DeMarleResolutionopen => fixed
2013-06-25 09:34Dave DeMarleFixed in Version => 5.10.0
2013-06-25 09:35Dave DeMarleAssigned To => Dave DeMarle
2013-06-25 09:35Dave DeMarleStatustodo => active development
2013-06-25 09:35Dave DeMarleStatusactive development => gatekeeper review
2013-06-25 09:35Dave DeMarleStatusgatekeeper review => customer review
2013-06-25 09:35Dave DeMarleStatuscustomer review => closed

Notes
(0028379)
Pavel Pokutnev   
2012-03-21 09:24   
vtkFixedPointVolumeRayCastMapper is also the only place where std::bad_alloc is used!
(0031037)
Dave DeMarle   
2013-06-25 09:32   
Fixed in 5.10:
commit 7e16b6a01a3948f596c066ea2b9082dd90b66d67
Author: Pavel Pokutnev <pavel.pokutnev@googlemail.com>
Date: Tue Mar 27 14:01:28 2012 -0400

Thanks!