Bugs item #2995500, was opened at 2010-05-02 11:17
Message generated for change (Comment added) made by marshallch
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100612&aid=2995500&group_id=612

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: critical
Status: Open
Resolution: Remind
Priority: 1
Private: No
Submitted By: Chad A. Davis (vorcidel)
Assigned to: Nobody/Anonymous (nobody)
Summary: perl -d chokes on lvalue functions

Initial Comment:
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.



----------------------------------------------------------------------

Comment By: Chris Marshall (marshallch)
Date: 2011-05-31 17:21

Message:
You can use @lvsubs = PDL::Lvalue->subs; to get the list of
all the PDL lvalue subroutines.  Then you could replace each
instance (via a source filter) as follows:

  lvsub() -> { my $tmpyuck = lvsub() }

I don't think we would even need to restrict the
filter operation to only where an lvalue assignment
is being made.  However, it would be cleaner and
easier to debug if we only did the special transform
where it was needed.

----------------------------------------------------------------------

Comment By: Chris Marshall (marshallch)
Date: 2010-08-01 12:02

Message:
Reducing the priority of this problem and marking the ticket Remind
as the PDL part of the issue has been resolved with the ugly
work-around required for use under the debugger.  Still no word
from the perl folks on a fix on their side.  In the meantime,
further work on this will be deferred until post-PDL-2.4.7.

----------------------------------------------------------------------

Comment By: Chris Marshall (marshallch)
Date: 2010-07-24 12:41

Message:
I had another thought---maybe we could use the PDL source
filter to "fix" the problem code in case a user needs to use
the debugger.  I don't get the sense that a fix for the various
perl versions is coming any time soon.

TODO: figure out how to make a test that runs under the
debugger for our test suite...

----------------------------------------------------------------------

Comment By: Chris Marshall (marshallch)
Date: 2010-05-29 19:25

Message:
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.

----------------------------------------------------------------------

Comment By: Chris Marshall (marshallch)
Date: 2010-05-28 17:42

Message:
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?

----------------------------------------------------------------------

Comment By: Chris Marshall (marshallch)
Date: 2010-05-17 13:24

Message:
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.

----------------------------------------------------------------------

Comment By: Derek Lamb (lambd)
Date: 2010-05-11 14:34

Message:
see http://rt.perl.org/rt3/Public/Bug/Display.html?id=71172 for a
description and discussion of this Perl (not necessarily PDL) bug.

----------------------------------------------------------------------

Comment By: Shlomi Fish (shlomif)
Date: 2010-05-11 10:51

Message:
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.

----------------------------------------------------------------------

Comment By: Chris Marshall (marshallch)
Date: 2010-05-02 14:34

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

Thanks again for the report.  -chm

----------------------------------------------------------------------

Comment By: Chris Marshall (marshallch)
Date: 2010-05-02 14:33

Message:
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.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=100612&aid=2995500&group_id=612

_______________________________________________
PDL-porters mailing list
PDL-porters@jach.hawaii.edu
http://mailman.jach.hawaii.edu/mailman/listinfo/pdl-porters

Reply via email to