chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.8k stars 421 forks source link

Internal error for: `catch e: owned Error` #13344

Open ben-albrecht opened 5 years ago

ben-albrecht commented 5 years ago

I encountered the following program that segfaults when exploring work-arounds for https://github.com/chapel-lang/chapel/issues/13307 (now fixed). I think we just need to prevent the segfault and emit a helpful error message, assuming this should actually be an error.

Steps to Reproduce

Source Code:

proc hello() {
  try {
    writeln('hello');
  } catch e: owned Error {
  }
}

hello();

Compile command:

> chpl segfault.chpl

internal error: UTI-MIS-0602 chpl version 1.20.0 pre-release (2a4d3df327)

Internal errors indicate a bug in the Chapel compiler ("It's us, not you"),
and we're sorry for the hassle.  We would appreciate your reporting this bug --
please see https://chapel-lang.org/bugs.html for instructions.  In the meantime,
the filename + line number above may be useful in working around the issue.
> chpl --devel segfault.chpl
internal error: seg fault [util/misc.cpp:602]

Configuration Information

bradcray commented 5 years ago

I changed this from "error message" to "bug" because I think we should consider any internal error to be a bug and reserve the "error message" label for cases where we're generating an error message but it should be reworded / improved. (and I don't consider "internal error" to be an error message by this definition).

jabraham17 commented 4 months ago

On main today, the program in the OP has a nicer error message

foo.chpl:1: In function 'hello':
foo.chpl:4: error: unmanaged can only apply to class types (_owned is not a class type)

I think this is still a confusing error, so I am not going to close this issue. But I am relabeling it for error message improvement rather than bug