-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Handling of internal plugin errors #15509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It's not possible to walk the stack in the general case, it depends on debug symbols unless you disable frame pointer elimination. It's fine to depend on it for debuggers but supporting backtraces elsewhere will hurt the performance of the language. |
Can we put an attribute on |
Is this really a problem? ICEs will still need to be handled properly, though (at the very least, they shouldn't include the bug report URL of the Rust compiler). |
cc me |
#[phase(plugin)]
extern crate plugin; would emit
One possibility would be handle this as a separate struct, so the signature of |
Traige: no specific improvements I know of. |
Triage: we now have accepted an RFC for procedural macros; I believe all of the design work that this ticket is about is happening as part of that effort. I'm going to close. |
Plugins can fail in ways that aren't the fault of the code being compiled. This could be an internal error in the plugin (which is still different from an ICE in Rust itself), or something like failure to load an external configuration file.
Ideally, plugins would call the usual methods like
bug
,err
,span_bug
, etc., and the resulting messages would include the name of the plugin crate. Unfortunately we can't do this by setting session state about which plugin is running, because they can call back intolibrustc
and errors there shouldn't be reported as plugin errors. We could introduceplugin_bug
,plugin_err
,plugin_span_bug
, etc, but this API duplication is ugly, and you have to remember to use different methods when writing plugins.The nicer (though harder-to-implement) solution is to have these functions walk the stack and then look at which shared object their caller was defined in. In glibc this can be done with
backtrace()
anddladdr()
, but I don't know how hard it is on other platforms.Whatever we do, we should also make these error methods accessible from the
Registry
, for use handling errors that occur during plugin initialization.The text was updated successfully, but these errors were encountered: