Open p5pRT opened 8 years ago
The dump() builtin has been deprecated and barely working for as long as I can remember. Even back in 2002 it 'has probably outlived most of its usefulness.' Is it finally time to get rid of it?
If that is too much\, then at least the unqualified use of dump() rather than CORE::dump()\, which has given a deprecation warning since 2002\, should go. (Arguably the deprecation warning was for the feature as a whole rather than just invoking it without the CORE:: prefix\, but either way...)
(Personally I would like dump() to return the stringification of a data structure\, like Data::Dumper::Dumper and as the CPAN module Data::Dump currently provides\, but that is for another day.)
On Thu\, Jan 28\, 2016 at 04:27:51AM -0800\, Ed Avis wrote:
# New Ticket Created by "Ed Avis" # Please include the string: [perl #127405] # in the subject line of all future correspondence about this issue. # \<URL: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=127405 >
This is a bug report for perl from eda@waniasset.com\, generated with the help of perlbug 1.40 running under perl 5.22.1.
----------------------------------------------------------------- [Please describe your issue here]
The dump() builtin has been deprecated and barely working for as long as I can remember. Even back in 2002 it 'has probably outlived most of its usefulness.' Is it finally time to get rid of it?
If that is too much\, then at least the unqualified use of dump() rather than CORE::dump()\, which has given a deprecation warning since 2002\, should go. (Arguably the deprecation warning was for the feature as a whole rather than just invoking it without the CORE:: prefix\, but either way...)
I don't think it will be a great loss if dump() gets dumped.
Has it ever worked in a useful way? I started using perl in 1995\, and even then you were advised not to even think of using it.
(Personally I would like dump() to return the stringification of a data structure\, like Data::Dumper::Dumper and as the CPAN module Data::Dump currently provides\, but that is for another day.)
That I think should remain on CPAN. But removing dump() allows modules to export a "dump" subroutine.
Abigail
The RT System itself - Status changed from 'new' to 'open'
Abigail wrote:
Has it ever worked in a useful way?
Its usefulness always depended on the availability of the undump utility\, which turns the core dump into an executable. (If you think about it\, these are really quite similar kinds of file\, both specifying mainly a program's memory layout and content.) undump is necessarily quite OS-specific\, so the availability was only ever patchy at best. There is a Linux ELF port\, but it's not widely packaged.
The actual trick that dump+undump achieves has really gone out of fashion since the 1980s. This can partly be attributed to faster machines making the startup delays smaller\, but countervailing that we use bigger programs and have more stringent performance expectations. Perhaps the unpopularity is due to the embuggerance the technique incurs with the modern high usage of dynamic linking.
You'd think there'd still be a niche for it around Perl\, with some people being awfully concerned about Moose startup times. But it's a terrible effort to go to for each affected program\, so only really appealing when you have a single specific large-footprint frequently-invoked program (like Emacs\, the prototypical undump user). The process is quite contrary to the dynamism we're accustomed to with Perl. Compare also how much effort we've put into bytecode caching\, another effort to reduce startup times.
-zefram
Even for emacs\, the undump / unexec approach might be going away:
http://lwn.net/SubscriberLink/673724/a5165e8736a4fac2/
-- Ed Avis \eda@​waniasset\.com
In Perl 5.30\, dump is no longer a reserved word. You have to say CORE::dump().
Out of interest what was the rationale for keeping the code around as CORE::dump() rather than removing it altogether? Does it have any users?
I remember FC saying he used it for breakpointing when he is debugging. That way he has a well defined C level sub he could breakpoint in the debugger which he could then call from perl as needed.
Yves
On Mon\, 23 Sep 2019\, 11:48 Ed Avis via RT\, \perlbug\-followup@​perl\.org wrote:
In Perl 5.30\, dump is no longer a reserved word. You have to say CORE::dump().
Out of interest what was the rationale for keeping the code around as CORE::dump() rather than removing it altogether? Does it have any users?
--- via perlbug: queue: perl5 status: open https://rt-archive.perl.org/perl5/Ticket/Display.html?id=127405
On Mon\, 23 Sep 2019 12:43:53 +0200 demerphq \demerphq@​gmail\.com wrote:
I remember FC saying he used it for breakpointing when he is debugging. That way he has a well defined C level sub he could breakpoint in the debugger which he could then call from perl as needed.
Isn't that what study() is used for too?
-- Paul "LeoNerd" Evans
leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/
Oh. Shoot. Maybe I'm confusing the two. Probably. Good catch.
Yves
On Mon\, 23 Sep 2019\, 12:47 Paul "LeoNerd" Evans\, \leonerd@​leonerd\.org\.uk wrote:
On Mon\, 23 Sep 2019 12:43:53 +0200 demerphq \demerphq@​gmail\.com wrote:
I remember FC saying he used it for breakpointing when he is debugging. That way he has a well defined C level sub he could breakpoint in the debugger which he could then call from perl as needed.
Isn't that what study() is used for too?
-- Paul "LeoNerd" Evans
leonerd@leonerd.org.uk | https://metacpan.org/author/PEVANS http://www.leonerd.org.uk/ | https://www.tindie.com/stores/leonerd/
On Mon\, Sep 23\, 2019 at 02:48:39AM -0700\, Ed Avis via RT wrote:
In Perl 5.30\, dump is no longer a reserved word. You have to say CORE::dump().
Out of interest what was the rationale for keeping the code around as CORE::dump() rather than removing it altogether? Does it have any users?
How would we know whether it has any users? Or rather\, can we ever know it doesn't have any users?
Abigail
On Mon\, Sep 23\, 2019 at 11:48 AM Ed Avis via RT \perlbug\-followup@​perl\.org wrote:
In Perl 5.30\, dump is no longer a reserved word. You have to say CORE::dump().
Out of interest what was the rationale for keeping the code around as CORE::dump() rather than removing it altogether? Does it have any users?
What would be the rationale of removing it?
Is it standing in anyone's way?
Leon
I occasionally use CODE::dump to actually generate a core file programmatically instead of sending SIGABRT to $$\, as the latter is async and may arrive sometime later\, not exactly where I need it.
Perhaps the documentation should be changed? It currently says
Primarily this is so that you can use the undump program (not supplied) to turn your core dump into an executable binary...
It could instead say something like
Primarily for debugging purposes. The older function of making an executable (via a separate 'undump' program) is now obsolete.
Dana Tue\, 24 Sep 2019 03:53:37 -0700\, randir reče:
I occasionally use CODE::dump to actually generate a core file programmatically instead of sending SIGABRT to $$\, as the latter is async and may arrive sometime later\, not exactly where I need it.
Would it be possible to use PERL_SIGNALS=unsafe to get the non-deferred behavior?
On Tue\, 24 Sep 2019 13:37:01 -0700\, slaven@rezic.de wrote:
Would it be possible to use PERL_SIGNALS=unsafe to get the non- deferred behavior?
It's async kernel delivery\, not async perl handling\, what's the culprit here.
On Wed\, Sep 25\, 2019 at 3:28 PM Sergey Aleynikov via RT \perlbug\-followup@​perl\.org wrote:
On Tue\, 24 Sep 2019 13:37:01 -0700\, slaven@rezic.de wrote:
Would it be possible to use PERL_SIGNALS=unsafe to get the non- deferred behavior?
It's async kernel delivery\, not async perl handling\, what's the culprit here.
That doesn't sound right. POSIX requires that "If the value of pid causes sig to be generated for the sending process\, and if sig is not blocked for the calling thread and if no other thread has sig unblocked or is waiting in a sigwait() function for sig\, either sig or at least one pending unblocked signal shall be delivered to the sending thread before kill() returns."
Leon
On Wed\, 25 Sep 2019 10:23:46 -0700\, LeonT wrote:
POSIX requires that ...
Never thought about this. Is it also true for windows builds (aka are they POSIX compliant)? But this still requires running under unsafe signals\, which is not the default and not always possible to set.
On Wed\, Sep 25\, 2019 at 7:34 PM Sergey Aleynikov via RT \perlbug\-followup@​perl\.org wrote:
Never thought about this. Is it also true for windows builds (aka are they POSIX compliant)?
No\, Windows is very much not a POSIX\, and in fact almost nothing about signals on Windows is usable.
But this still requires running under unsafe signals\, which is not the default and not always possible to set.
No it doesn't. Deferred signaling only affects Perl's signal handlers\, it doesn't affect a lack of an explicit signal handler.
Leon
Migrated from rt.perl.org#127405 (status was 'open')
Searchable as RT127405$