#172: CCL error message has no file name ----------------------+----------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: new Priority: major | Milestone: Component: Cactus | Version: Keywords: | ----------------------+----------------------------------------------------- I just received the following fatal error message from Cactus:
Processing CCL files
CST error 1: -> Error parsing optional block line '' Missing { at start of block.
This error message does not tell me which thorn or file causes this.
#172: CCL error message has no file name -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: new Priority: major | Milestone: Component: Cactus | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by eschnett):
Explanation: This problem was caused by a configuration.ccl file which had the line
OPTIONAL LoopControl
instead of
OPTIONAL LoopControl { }
That is, the curly braces were missing.
#172: CCL error message has no file name -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: new Priority: major | Milestone: Component: Cactus | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by hinder):
Why are the curly braces even necessary? What sorts of things can go into the block?
#172: CCL error message has no file name -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: sbrandt Type: defect | Status: assigned Priority: major | Milestone: Component: Cactus | Version: Resolution: | Keywords: -----------------------+---------------------------------------------------- Changes (by knarf):
* owner: => sbrandt * status: new => assigned
#172: CCL error message has no file name -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: sbrandt Type: defect | Status: assigned Priority: major | Milestone: Component: Cactus | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by sbrandt):
The bug was a little worse than described. In the event of missing {}'s, the code actually went into an endless loop. The culprit was the while immediately following the error message. It was not capable of detecting end of file (i.e. when $data->[$line_number] became undefined). I added checks to ensure $data->[$Line_number] was defined in two additional while loops.
$ svn diff lib/sbin/ConfigurationParser.pl Index: lib/sbin/ConfigurationParser.pl =================================================================== --- lib/sbin/ConfigurationParser.pl (revision 4684) +++ lib/sbin/ConfigurationParser.pl (working copy) @@ -207,7 +207,7 @@ } elsif($line =~ m/^\s*OPTIONAL\s*/i) { - ($optional, $define, $line_number) = &ParseOptionalBlock($line_number, @data); + ($optional, $define, $line_number) = &ParseOptionalBlock($filename, $line_number, @data); $cfg->{"\U$thorn\E OPTIONAL"} .= "$optional "; $cfg->{"\U$thorn\E OPTIONAL \U$optional\E DEFINE"} = $define; } @@ -249,13 +249,13 @@ $line_number++; if($data->[$line_number] !~ m/^\s*{\s*$/) { - &CST_error (0, "Error parsing provides block line '$data->[$line_number]'.". + &CST_error (0, "Error parsing provides block line '$data->[$line_number]' $file_name:$line_number ". 'Missing { at start of block'); - $line_number++ while($data->[$line_number] !~ m:\s*}\s*:); + $line_number++ while(defined($data->[$line_number]) and $data->[$line_number] !~ m:\s*}\s*:); } else { - while($data->[$line_number] !~ m:\s*}\s*:) + while(defined($data->[$line_number]) and $data->[$line_number] !~ m:\s*}\s*:) { $line_number++; if($data->[$line_number] =~ m/^\s*SCRIPT\s*(.*)$/i) @@ -299,7 +299,7 @@ #@@*/ sub ParseOptionalBlock { - my ($line_number, $data) = @_; + my ($file_name, $line_number, $data) = @_; my ($optional, $define);
$data->[$line_number] =~ m/^\s*OPTIONAL\s*(.*)/i; @@ -312,13 +312,13 @@
if($data->[$line_number] !~ m/^\s*{\s*$/) { - &CST_error (0, "Error parsing optional block line '$data->[$line_number]'". + &CST_error (0, "Error parsing optional block line '$data->[$line_number]' $file_name:$line_number". ' Missing { at start of block.'); - $line_number++ while($data->[$line_number] !~ m:\s*}\s*:); + $line_number++ while(defined($data->[$line_number]) and $data->[$line_number] !~ m:\s*}\s*:); } else { - while($data->[$line_number] !~ m:\s*}\s*:) + while(defined($data->[$line_number]) and $data->[$line_number] !~ m:\s*}\s*:) { $line_number++; if($data->[$line_number] =~ m/^\s*DEFINE\s*(.*)$/i)
#172: CCL error message has no file name -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: sbrandt Type: defect | Status: assigned Priority: major | Milestone: Component: Cactus | Version: Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by knarf):
Can you please attach the patch as file to the ticket? This way things like whitespaces don't get mixed up. Thanks.
#172: CCL error message has no file name -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: sbrandt Type: defect | Status: review Priority: major | Milestone: Component: Cactus | Version: Resolution: | Keywords: -----------------------+---------------------------------------------------- Changes (by hinder):
* status: assigned => review
#172: CCL error message has no file name -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: sbrandt Type: defect | Status: closed Priority: major | Milestone: Component: Cactus | Version: Resolution: fixed | Keywords: -----------------------+---------------------------------------------------- Changes (by eschnett):
* status: review => closed * resolution: => fixed
Comment:
Applied.
trac@lists.einsteintoolkit.org