Bug #13505
closed
circular require prints the backtrace directly to stderr
Added by Eregon (Benoit Daloze) over 7 years ago.
Updated almost 7 years ago.
Description
The "loading in progress, circular require considered harmful" warning prints the caller backtrace directly to stderr:
if (RTEST(ruby_verbose)) {
rb_warning("loading in progress, circular require considered harmful - %s", ftptr);
rb_backtrace_print_to(rb_stderr);
}
This is suboptimal as rb_warning now eventually delegates to Warning.warn, which can handle the warning, but not the backtrace printed separetely to $stderr.
I think the backtrace should be sent together to Warning.warn so the entire warning can be treated/filtered/etc correctly in Warning.warn.
- Tracker changed from Bug to Feature
- Target version set to 2.5
- Status changed from Open to Closed
Applied in changeset trunk|r58471.
load.c: backtrace of circular require
Thank you for the fix nobu.
I believe it should also send everything (message + backtrace) as a single String to Warning.warn.
I did that in r58493.
It would be nice to backport this to 2.4 for easier exception filtering,
but I guess it's not so common to backport features like this?
- Tracker changed from Feature to Bug
- Backport set to 2.3: DONTNEED, 2.4: REQUIRED, 2.5: DONTNEED
I believe this is a bug of Warning.warn feature in 2.4.
I will move this ticket to Bug to backport the changesets.
- Backport changed from 2.3: DONTNEED, 2.4: REQUIRED, 2.5: DONTNEED to 2.3: DONTNEED, 2.4: DONE, 2.5: DONTNEED
ruby_2_4 r62435 merged revision(s) 58471,58493.
Also available in: Atom
PDF
Like0
Like0Like0Like0Like0Like0Like0