Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


I fully agree. We need to make it clear what assertions really mean, and how they should be used. 
Currently it is somewhat of a disaster area. There are places in the code that cause "assertion 
failures" every time the code is run if built with debug=t. So does that then mean that the code is 
actually horribly broken and works by accident? Probably not in all cases.

In my opinion, an assertion failure should mean that the program finds itself in a situation where 
it doesn't know what has happened or how to proceed; where it knows that its data structures are in 
an inconsistent state, and it will probably crash soon.

The current situation seems to be that assertions are used to indicate that something might be 
slightly suboptimal, but then the code is fully prepared to handle that anyway. More like it would 
be nagging "hey, somebody thought in 2005 that this should be fixed some day later".

Another related thing that is broken is how the code often loses useful information associated with 
exceptions.

To take an example, the root cause to much breakage on Windows in the 3.4 beta1 caused an exception 
with the nice message "package2.dll: cannot get symbol: component_getImplementationEnvironment" 
attached. That message says very clearly what the problem is. And the message indicates indeed a 
very serious problem with the UNO component shared library in question. But did this message show 
up anywhere (except that I by luck happened to see it in the debugger, as there was something to 
see, as the catch clause in this case actually caught the exception object)? Not anywhere where the 
user would have been able to report it at least.

--tml



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.