Chapel Devs --
This is a patch that logically falls into Vass's court though everyone
should read the description to raise objections, if any.
In breaking one of Vass's futures this week, it looked like (and was) a
candidate for a 5-minute fix (TM). The issue raised was that internal
failures, when compiled in developer mode, don't do anything to mark
themselves as internal failures -- they just say something like:
'error: <message intended for developers>'
whereas for users they say something like:
'error: internal failure CAL123'
Vass suggested that something should indicate that the case was an
internal failure in developer mode as well and this didn't seem
objectionable to me (though I'd never actually noticed before).
The approach I took was to make developer mode print out:
'internal failure: <message intended for developers>'
but this unwittingly caused the user message to say:
'internal failure: internal failure CAL123'
So I then shortened the second case to simply:
'internal failure: CAL123'
If there are no objections to these formatting issues, the change itself
is pretty straightforward (though also hard to test since our tests run in
--no-devel mode). The tax on the 5-minute fix was getting other .futures,
particularly with .prediffs and .bad files, to match properly against the
new format.
-Brad
Index: test/users/vass/crash5insertAfter.bad
===================================================================
--- test/users/vass/crash5insertAfter.bad (revision 22906)
+++ test/users/vass/crash5insertAfter.bad (working copy)
@@ -1 +1 @@
-crash5insertAfter.chpl:1: error: internal failure EXP
+crash5insertAfter.chpl:1: internal failure: EXP
Index: test/users/vass/crash1callDestructorsMain.prediff
===================================================================
--- test/users/vass/crash1callDestructorsMain.prediff (revision 22906)
+++ test/users/vass/crash1callDestructorsMain.prediff (working copy)
@@ -1,3 +1,3 @@
#!/bin/bash
-sed "s/^\(error: internal failure CAL\).*$/\1/" < $2 > $2.tmp
+sed "s/^\(internal failure: CAL\).*$/\1/" < $2 > $2.tmp
mv $2.tmp $2
Index: test/users/vass/tuple-crash-1.prediff
===================================================================
--- test/users/vass/tuple-crash-1.prediff (revision 22906)
+++ test/users/vass/tuple-crash-1.prediff (working copy)
@@ -1,3 +1,3 @@
#!/bin/bash
-sed "s/^\(error: internal failure FUN\).*$/\1/" < $2 > $2.tmp
+sed "s/^\(internal failure: FUN\).*$/\1/" < $2 > $2.tmp
mv $2.tmp $2
Index: test/users/vass/crash1callDestructorsMain.bad
===================================================================
--- test/users/vass/crash1callDestructorsMain.bad (revision 22906)
+++ test/users/vass/crash1callDestructorsMain.bad (working copy)
@@ -1 +1 @@
-error: internal failure CAL
+internal failure: CAL
Index: test/users/vass/crash5insertAfter.prediff
===================================================================
--- test/users/vass/crash5insertAfter.prediff (revision 22906)
+++ test/users/vass/crash5insertAfter.prediff (working copy)
@@ -1,3 +1,3 @@
#!/bin/bash
-sed "s/\(error: internal failure EXP\).*$/\1/" < $2 > $2.tmp
+sed "s/\(internal failure: EXP\).*$/\1/" < $2 > $2.tmp
mv $2.tmp $2
Index: test/users/vass/tuple-crash-1.bad
===================================================================
--- test/users/vass/tuple-crash-1.bad (revision 22906)
+++ test/users/vass/tuple-crash-1.bad (working copy)
@@ -1 +1 @@
-error: internal failure FUN
+internal failure: FUN
Index: test/exits/sungeun/exitWithNoParensNoArgs.prediff
===================================================================
--- test/exits/sungeun/exitWithNoParensNoArgs.prediff (revision 22906)
+++ test/exits/sungeun/exitWithNoParensNoArgs.prediff (working copy)
@@ -1,3 +1,3 @@
#!/bin/bash
-sed "s/^\(exitWithNoParensNoArgs.chpl:1: error: internal failure\).*$/\1/" < $2 > $2.tmp
+sed "s/^\(exitWithNoParensNoArgs.chpl:1: internal failure:\).*$/\1/" < $2 > $2.tmp
mv $2.tmp $2
Index: test/exits/sungeun/exitWithNoParensNoArgs.bad
===================================================================
--- test/exits/sungeun/exitWithNoParensNoArgs.bad (revision 22906)
+++ test/exits/sungeun/exitWithNoParensNoArgs.bad (working copy)
@@ -1 +1 @@
-exitWithNoParensNoArgs.chpl:1: error: internal failure
+exitWithNoParensNoArgs.chpl:1: internal failure:
Index: test/parallel/begin/sungeun/initCopyWithBegin.bad
===================================================================
--- test/parallel/begin/sungeun/initCopyWithBegin.bad (revision 22906)
+++ test/parallel/begin/sungeun/initCopyWithBegin.bad (working copy)
@@ -1 +1 @@
-error: internal failure REMnnnn chpl Version 1.8.0.-999
+internal failure: REMnnnn chpl Version 1.8.0.-999
Index: test/parallel/begin/sungeun/autoCopyWithBegin.bad
===================================================================
--- test/parallel/begin/sungeun/autoCopyWithBegin.bad (revision 22906)
+++ test/parallel/begin/sungeun/autoCopyWithBegin.bad (working copy)
@@ -1 +1 @@
-error: internal failure REMnnnn chpl Version 1.8.0.-999
+internal failure: REMnnnn chpl Version 1.8.0.-999
Index: test/functions/iterators/vass/forall-without-leaderfollower.prediff
===================================================================
--- test/functions/iterators/vass/forall-without-leaderfollower.prediff (revision 22906)
+++ test/functions/iterators/vass/forall-without-leaderfollower.prediff (working copy)
@@ -1,3 +1,3 @@
#!/bin/bash
-sed 's@^[^:]*:[0-9]*: \(error: internal failure\).*$@\1@' < $2 > $2.tmp
+sed 's@^[^:]*:[0-9]*: \(internal failure:\).*$@\1@' < $2 > $2.tmp
mv $2.tmp $2
Index: test/functions/iterators/vass/forall-without-leaderfollower.bad
===================================================================
--- test/functions/iterators/vass/forall-without-leaderfollower.bad (revision 22906)
+++ test/functions/iterators/vass/forall-without-leaderfollower.bad (working copy)
@@ -1 +1 @@
-error: internal failure
+internal failure:
Index: compiler/util/misc.cpp
===================================================================
--- compiler/util/misc.cpp (revision 22906)
+++ compiler/util/misc.cpp (working copy)
@@ -92,7 +92,7 @@
}
}
- fprintf(stderr, "internal failure %s ", error);
+ fprintf(stderr, "%s ", error);
char version[128];
get_version(version);
fprintf(stderr, "chpl Version %s\n", version);
@@ -179,7 +179,17 @@
if (ast && ast->linenum())
fprintf(stderr, "%s:%d: ", cleanFilename(ast), ast->linenum());
- fprintf(stderr, err_print ? "note: " : err_fatal ? "error: " : "warning: ");
+ if (err_print) {
+ fprintf(stderr, "note: ");
+ } else if (err_fatal) {
+ if (err_user) {
+ fprintf(stderr, "error: ");
+ } else {
+ fprintf(stderr, "internal failure: ");
+ }
+ } else {
+ fprintf(stderr, "warning: ");
+ }
if (!err_user && !developer) {
print_user_internal_error();
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers