nonsense code causes infinite regress in error reports #37739
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Modeller
Processing
Relating to QGIS Processing framework or individual Processing algorithms
Describe the bug
When I type totally bogus code into the field calculator, I get an infinite number of error messages.
How to Reproduce
This is just like my bug #37737
What I expect: immediate syntax error, model will never execute, marked as invalid syntax in the XML, big red X on the screen when it's open in the graphical modeler, all because the formula '5/0 + dkdkdkd and his is this -' is not parsable by any rational computer language including the qgis one. Errors in parsing like this, 'syntax errors', can be easily detected by running the code through the parser: especially the inclusion of the '-' on the end without the second argument to the minus operator is detectable. Probably also the other words appearing in positions where keywords would be expected and aren't. And - what language allows a random long rambling sequence of keywords (or variables for that matter) like 'dkdkdkd and his is this'? Not SQL certainly, which I think is what this language is trying to implement: SQL has a very strict sequence of words that must appear in order.
What I get instead:
Unlike my 37737 bug, this one is caught when the code is run. However, it's caught too many times. In fact I get:
"OK. Execution took 19.039 s (1 outputs).
Prepare algorithm: qgis:fieldcalculator_1
Running Field calculator [2/2]
Input Parameters:
{ FIELD_LENGTH: 10, FIELD_NAME: 'snam2', FIELD_PRECISION: 3, FIELD_TYPE: 0, FORMULA: '5/0 + dkdkdkd and his is this -', INPUT: 'memory://MultiLineString?crs=USER:100000&field=fid:long(0,0)&field=cat:integer(0,0)&field=length:double(0,0)&field=localid:integer(0,0)&field=zero:integer(0,0)&field=prefix:string(14,0)&field=streetname:string(50,0)&field=ftype:string(13,0)&field=leftadd1:integer(0,0)&field=leftadd2:integer(0,0)&field=rgtadd1:integer(0,0)&field=rgtadd2:integer(0,0)&field=leftzip:integer(0,0)&field=rightzip:integer(0,0)&field=type:integer(0,0)&field=lcounty:string(4,0)&field=rcounty:string(4,0)&field=lcity:string(4,0)&field=rcity:string(4,0)&field=roadtypeid:integer(0,0)&field=emissionsingramsperhr:double(0,0)&field=DN:integer(0,0)&field=length_2:double(0,0)&uid={d628594b-4822-4073-b5f2-1cf3fc71a5b6}', NEW_FIELD: True, OUTPUT: 'TEMPORARY_OUTPUT' }
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed? [...]".
QGIS should report a meaningful error message and then abort after the first report. "SYNTAX ERROR LINE 1" is enough, one time.
QGIS and OS versions
The about screen appears completely black with no controls or text.
Additional context
c.f. #37737
The text was updated successfully, but these errors were encountered: