The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Error report:: a little guide line
01-10-2014, 10:46 PM (This post was last modified: 01-13-2014 04:06 PM by patrice.)
Post: #1
Error report:: a little guide line
This little guide have Prime in mind, but the advices can be applied to other systems.

When you report an error, the first thing to do is to make sure the error is not on your side.
Make sure that the parameters that are fed to the buggy function are really what you think they are. Make them appear clearly in your code. the process to set the parameters doesn't matter.

Albert Einstein advice: “Everything should be made as simple as possible, but no simpler.”
Aka when you provide code, don't make it 20 lines when 4 lines is enough to exhibit the problem.
Bigger examples can be Ok for problems like memory leaks

- Give a context: Calc or Emulator, Revision
- Settings if needed
- a description of the error or bug, keep in mind that the readers don't know what you speak about. Be as clear as possible.
- a procedure to reproduce the problem (as short as possible)

Example 1
This piece of code is claiming a compiler error in EXPR function
Code:
EXPORT SYMBOL1,WHATTYPE;
EXPORT Indirect_Addressing()
BEGIN
LOCAL var1="why",varptr;
INPUT(varptr,"Variable Name","Varnam=","In quotes, enter the var name","A");// Key in "SYMBOL1".
TYPE(var1)▶WHATTYPE;// Even though TYPE == 2 (string)
IF TYPE(var1)==2 then var1:=STRING(var1); end;// this line is needed to prevent a syntax error
EXPR(varptr + ":=" + var1);// by this EXPR(varptr + ":=" + var1); line.
END;
Problems:
-the input is part of what is fed to EXPR
-the code don't show the string fed to EXPR as it is build on fly in EXPR

This is a reduced piece of code
Code:
EXPORT Indirect_Addressing()
BEGIN
EXPR("A:=9");
END;
-the string fed to EXPR is obvious, there is no guess to what is doing the code.

Example 2
a bug by design
with logical values, False is 0 and true is non zero.
AND, OR and NOT operators are documented as logical operators, thus handling only True and False values.
and we have bitwise functions BITAND, BITOR, BITNOT and BITXOR to handle all binary bitwise operations.
it turn out that if you give binary integer values to logical operators, they silently turn to bitwise;
the problem: it is undocumented. it is also unneeded since the bitwise functions are doing the job.
to circumvent the problem, one have to compare with zero before using logical operators.
(#12 <> 0) AND (#2 <> 0)

Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Error report:: a little guide line - patrice - 01-10-2014 10:46 PM



User(s) browsing this thread: 1 Guest(s)