17019, “ben-albrecht”, “Errors thrown inside forall do not report line number where error is thrown”, “2021-01-26T22:27:50Z”
Summary of Problem
Runtime errors thrown inside forall do not report line number where error is thrown. Instead, they report the line number of the outer forall loop. This can make debugging challenging if there is a lot of code inside the forall loop.
I included the [Design]
label because it’s not clear to me how we’d like to report line numbers within the forall loop. For example, if every iteration of a forall over 1000 iterations fails, then we’d probably still want some aggregation of the results reported back like we do today.
Steps to Reproduce
Source Code:
proc main() throws {
forall i in 1..4 {
// This line number not reported (line 5):
throw new IllegalArgumentError('failed successfully');
}
}
Compile command:
chpl repro.chpl
Execution command:
uncaught TaskErrors: 4 errors: IllegalArgumentError: failed successfully ... IllegalArgumentError: failed successfully
repro.chpl:2: thrown here
repro.chpl:2: uncaught here
Configuration Information
- Output of
chpl --version
: chpl version 1.24.0 pre-release (0be475754e)