[Bf-committers] Using assert()?

Nicholas Bishop nicholasbishop at gmail.com
Thu Aug 12 20:30:43 CEST 2010


In the specific case you mention (improper use of an array), valgrind
will usually catch the error.

-Nicholas

On Thu, Aug 12, 2010 at 2:24 PM, Torsten Rupp <torsten.rupp at gmx.net> wrote:
> Dear developers,
>
> sometimes I see a SigSegV when using blender. When I'm able to
> reproduce the problem I try to trace it back. Sometimes it is a
> problem either with an array (to small or not initialized) or with
> some pointer. With other software projects I made good
> experiences to place assert() in the code to detect such problems
> early and and trace it back more easily instead of running into a
> SigSegV.
>
> For example, it may be helpful to add an assert-check before accessing
> an array (check if array is not NULL and check the size) or
> deferencing a pointer. Also pre- and post-conditions may help to find
> bugs more easily.
>
> I know there are already assert()-checks in the blender code. Were
> adding more assert()-code ever a discussion here?
>
> Best regards,
>
> Torsten
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list