[Ferm] Patch, implementing an debugmode for ferm
Max Kellermann
max at duempel.org
Thu Sep 26 16:27:04 CEST 2013
On 2013/09/18 11:54, Jan Walzer <jan.walzer at 1und1.de> wrote:
> Hi,
>
> while working on a really huge Ruleset here with >10000 @defs and
> >1000 function calls, where multiple users are working on different
> parts in an ferm-SVN-Repo, we had the need for a decent tracking of
> the mistakes that are made. Often they are typos, sometimes they are
> harder to find.
>
> Nevertheless, I had my try on implementing an debugmode and have
> created a patch for that.
It's hard to read your patch because it contains a few whitespace
changes.
The patch contains several distinct changes, and I don't agree to all
of them; for example:
- die unless @stack == $old_stack_depth;
+ die ("possible Stack corruption - not good, what did you do?") unless @stack == $old_stack_depth;
This error occurs only after a ferm bug. Therefore, this error is
only interesting for developers and for users reporting the message
as-is. There does not need to be a message; developers will find out
from the source code, and users are not interested.
In any case, your error message is not meaningful, it does not add any
value. Quite contrary, it appears to blame the user for a ferm bug,
which is exactly the wrong thing to do.
And, finally, the message is wrong - this is not about a stack
corruption, because nobody corrupted the stack. The stack is
well-formed, but the stack pointer is at the wrong position.
There's the "--debug" feature which adds some tracing to ferm. And
there's "--stacktrace" which adds a ferm stacktrace to warning/error
messages. Neither option is documented. The "--debug" option adds
overhead even when it's not used.
More information about the Ferm
mailing list