[vtk-developers] Use of assert

Berk Geveci berk.geveci at gmail.com
Thu Jul 21 13:56:17 EDT 2005


>    Since I am responsible for most of the undocumented assert in the XML-IO stuff, here are my thoughts. According to Berk application like ParaView can be build in Debug mode (meaning with assert enable). He believes that ParaView should not ever abort on purpose.

I believe there was a communication problem.That is not what I said. 
ParaView or any other application should not abort because the user
made a mistake in the input file. It should report this to the user
and refuse to load the file. All assert() does is to either crash the
application and report nothing to the user (debug mode) or do
absolutely nothing (release mode). If I remember correctly, there were
a decent number of asserts that could be triggered by a bad file.
Also, I, the user, lost my work due to a crash in a state from which
recovery was possible (i.e. do not load the file).  I agreed then that
when the impossible happens (which does not include the user making a
mistake, users make mistakes all the time), assert() makes it easier
to debug the problem. That is assuming that you can reproduce the
problem (I do no let my OS save core dumps). However, if you can
reproduce the problem, a breakpoint on an error line is also possible.
 
>    BTW what kind of user on purpose build ParaView in Debug mode ? 

Try running CMake on ParaView (or VTK) on Windows (Visual Studio),
loading the project and building without changing the default build
configuration. And remember to get an MPI enable ParaView, the user
has to do this. So although the user might not have wanted it, this is
what she gets by default.

-Berk



More information about the vtk-developers mailing list