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
Attempt to reload [...] aborted after failed "eval use...", followed by another use #13797
Comments
From @wolfsageCreated by wolfsage@gmail.comWhen a module is require'd in an eval but dies, and then later require'd, This seems like something we could perhaps fix. Example: mhorsfall@tworivers:~/example$ cat RO.pm eval "use RO2;"; 1; mhorsfall@tworivers:~/example$ cat RO2.pm die "Hah\n"; 1; mhorsfall@tworivers:~/example$ cat t.pl mhorsfall@tworivers:~/example$ perl t.pl Perl Info
|
From @jkeenanOn Fri May 02 06:09:08 2014, alh wrote:
And the actual error message is ... ?
-- |
The RT System itself - Status changed from 'new' to 'open' |
From @wolfsageOn Wed, Dec 3, 2014 at 9:17 PM, James E Keenan via RT
In this case, "Hah\n": mhorsfall@tworivers:~/example$ cat t2.pl This boils down to a module being required that may die/croak at If instead of just saying "Attempt to reload [module] aborted", we said: "Attempt to reload [module] aborted, previous try was here" ...And/or "Attempt to reload [module] aborted, previous error was "..."" ...I think it would go a long way. -- Matthew Horsfall (alh) |
@wolfsage, discussion in this ticket petered out back in 2014. Have you had further thoughts about this problem? Thank you very much. |
I agree with @wolfsage, we should track the previous error, and then show it. I have written code to do this myself, and I think it should be standard. We should have a parallel data structure to %INC (something like %INC_ERROR) which contains the error which resulted in %INC containing a false value. There are some tricks that have to be kept in mind, if someone does delete $INC{foo} then we should also trigger a delete $INC_ERROR{foo} (imo). Im happy to try to help with this one, although i dont have a lot of time these days. I think its a bit tricky as to what i think needs to be done we probably need to tie %INC (or add some magic to it at least), and think its currently possible to tie %INC anyway, so it is not immediately clear how the magic would work. I dont think this should be closed. BTW, I suspect that with Require hooks this is probably a /bit/ easier to do than it once was.... |
I was somewhat concerned about error lifetime for exception objects if we were storing them for later. But it doesn't seem like this should be a problem. Normally, the error from require will be a string. If the module loading fails due to the module throwing an exception object, the error will be stringified with a Another potential thought is that it could increase memory usage. But modules failing to load due to compilation errors is a rather rare case. I doubt there would be enough of these in an otherwise working program for any extra memory used to be a problem. So I don't see any real problem with a |
Not if there are $SIG{DIE} hooks in place upgrading the string to an object.
Huh? I didnt follow your reasoning there.
Yeah, I never saw any issue with it at Booking, and that code has been tracking these errors for years. |
True, but internally
If a module throws an error while loading it, the If an |
|
Migrated from rt.perl.org#121787 (status was 'open')
Searchable as RT121787$
The text was updated successfully, but these errors were encountered: