#232 perl -d chokes on lvalue functions

critical
open-remind
nobody
core (120)
1
2013-01-11
2010-05-02
Chad A. Davis
No

This works as expected
cat > perldl-lvalue.pl
#!/usr/bin/env perl
use strict;
use PDL;
print identity 1
^D
perl perldl-lvalue.pl

But this does not:

perl -d perldl-lvalue.pl

Can't return a temporary from lvalue subroutine at /usr/lib/perl5/PDL/MatrixOps.pm line 169.
at /usr/lib/perl5/PDL/MatrixOps.pm line 169
PDL::MatrixOps::identity(1) called at /home/davis/tmp/perldl-lvalue.pl line 5

I.e. PDL lvalue functions, not just this one, seem to fail under the Perl debugger.

I tried this on the PDL (2.4.5) included in my Ubuntu 10.04 (i686) and also built 2.4.6 and 2.4.6_001 from CPAN.

Discussion

1 2 3 > >> (Page 1 of 3)
  • Chad A. Davis
    Chad A. Davis
    2010-05-02

    perldl -V

     
    Attachments
  • Chris Marshall
    Chris Marshall
    2010-05-02

    See PDL/BUGS for the recommended minimum info for a bug report.

    That said, I seem to remember some discussion on a PDL mailing list
    about this problem being introduced in a newer version of perl. As is,
    for the perl I am running on cygwin, 5.10.0, I do not see the problem.
    For strawberry perl 5.10.1, I get the error.

    Thanks for reporting the problem. I'm not sure where we stand with
    the problem as far as a ticket to perl or a work-around.

     
  • Chris Marshall
    Chris Marshall
    2010-05-02

    Sorry, I did not see the attached perl -V output file.

    Thanks again for the report. -chm

     
  • Shlomi Fish
    Shlomi Fish
    2010-05-11

    I can reproduce this here on Mandriva Linux Cooker (on a 32-bit Pentium 4 machine) with
    perl-PDL-2.4.6-1mdv2010.1 and perl-5.10.1-8mdv2010.1 . It disrupts my work and I hope it will be fixed soon. Maybe I'll switch to an older (5.8.9) or newer perl to see if I can reproduce it or alternatively found a way to overcome it for perl -d sessions.

     
  • Chris Marshall
    Chris Marshall
    2010-05-17

    I've changed the priority for this to 9-Highest because it basically makes it impossible to debug PDL code in the perl debugger. It would be helpful if there were a work-around that could be used in the meantime.

     
  • Chris Marshall
    Chris Marshall
    2010-05-17

    • priority: 5 --> 9
    • milestone: --> critical
     
  • Chris Marshall
    Chris Marshall
    2010-05-28

    After reviewing the rt.perl.org ticket #71172 for this problem, it seems like something is understood about the problem. Is there a work around for the debugger so that it can be used on perl versions 5.10.1 through 5.12?

     
  • Chris Marshall
    Chris Marshall
    2010-05-29

    The work around for the problem is to use the pre-lvalue subroutine syntax for slicing operations (and other lvalue subs). The modification has been made so that the tests
    failing on win32 from the debugger "feature" now run with perl -d. E.g.:

    $piddle->diagonal(0,1) .= 10;

    becomes

    my $tmp; # work around perl -d "feature"
    ($tmp = $piddle->diagonal(0,1)) .= 10;

    Also reducing the priority slightly because there
    is a workable work around---if ugly.

     
  • Chris Marshall
    Chris Marshall
    2010-05-29

    • priority: 9 --> 7
     
1 2 3 > >> (Page 1 of 3)