Posted on 2006-10-19 17:17:13-07 by erichacker
Lvalue problems on ActiveState Windows?
Is anyone else experiencing Lvalue problems on ActiveState Windows?

I have Want 0.12 installed on ActiveState Perl on Windows XP. I can't pass t/28-lvalue when I attempt to install a newer version of OIO.

I installed OIO 1.52 ppm from Winnepeg originally, before installing Want 0.12. I decided lvalue would be useful and upgraded Want, but could never get lvalue to work on OIO 1.52.

I appreciate any ideas.

Test reuslts: t/28-lvalue.........ok 1/0OIO::Args error: Missing arg(s) to 'Foo->set_foo1' Package: main File: t/28-lvalue.t Line: 101 Trace begun at (eval 36) line 5 Foo::__ANON__('Foo=SCALAR(0x1c3ae4c)') called at t\28-lvalue.t line 101 # Looks like your test died just after 7. t/28-lvalue.........dubious Test returned status 255 (wstat 65280, 0xff00) after all the subtests completed successfully
Direct Responses: 3291 | Write a response
Posted on 2006-10-19 18:29:19-07 by jdhedden in response to 3287
Re: Lvalue problems on ActiveState Windows?
First of all, you didn't mention which version of ActivePerl you're using.
To use :lvalue, you need 5.8.0 or later.
If that isn't the problem, I'm not sure what it could be. OIO 1.52 was tested on ActivePerl 5.8.0 through 5.8.8 as can be seen here.
In any event, I recommend upgrading to ActivePerl 5.8.8 and the latest version of OIO (currently 2.14) off of CPAN.
Direct Responses: 3300 | Write a response
Posted on 2006-10-20 19:56:07-07 by erichacker in response to 3291
Re: Lvalue problems on ActiveState Windows?
I apologize for forgetting the Perl version. It was 5.8.8 build 816. I updated to 8.19 with no difference.
Installed OIO 2.14 with force since it couldn't pass t28. As expected, problem did not go away.

Installed OIO 2.14 on another system without Want 0.12, then upgraded Want to 0.12. t28 still fails. System 2 is Activestate perl 5.8.8 Build 816.

I'll try it in the eclipse debugger and see if that sheds any light, but I can't today.
Direct Responses: 3305 | Write a response
Posted on 2006-10-21 20:04:02-07 by erichacker in response to 3300
Re: Lvalue problems on ActiveState Windows?
Below is the Foo code from setting DEBUG in OIO.

From line 101 in 28-lvalue.t
$obj->set_foo1() = $b2;
In the eclipse debugger I am seeing $rv set to 1 on line 3. $wobj set to '' and then the error gets called at line 5.

I can't see why line 3 returns what it does as Want::want_lvalue is not perl.

See below for variable values

I'd guess that this is a Want bug, but really I'm way over my head at this point.

if there is anything else I can provide, please let me know.
package Foo; *Foo::set_foo1 = sub :lvalue { my $rv = !Want::want_lvalue(0); my $wobj = (Want::wantref() eq 'OBJECT'); if ((@_ < 2) && ($rv || $wobj)) { OIO::Args->die( 'message' => q/Missing arg(s) to 'Foo->set_foo1'/, 'location' => [ caller() ]); } my $assign; if (my @args = Want::wantassign(1)) { @_ = ($_[0], @args); $assign = 1; } if (@_ > 1) { $field->[${$_[0]}] = $_[1]; Want::lnoreturn if $assign; Want::rreturn($field->[${$_[0]}]) if $rv; } ((@_ > 1) && $wobj && !Scalar::Util::blessed($field->[${$_[0]}])) ? $_[0] : $field->[${$_[0]}]; }; *Foo::get_foo1 = sub { $field->[${$_[0]}]; };

28-lvalue.t Variables
$b1 Baz=SCALAR(0x3099108)-> 1 $b2 Baz=SCALAR(0x3098fa0)-> 2 $obj Foo=SCALAR(0x3099900)-> 1 $val Baz=SCALAR(0x3099108)-> 1 $val2 Baz=SCALAR(0x3099108)-> 1
OIO Variables:
$field ARRAY(0x1ee522c)... [0] empty slot [1] Baz=SCALAR(0x3099108)-> 1 %DEEP_CLONE <empty hash> %DUMP_FIELDS ... 'Foo' HASH(0x30ee150)... 'bar1' ARRAY(0x316deb8)... 'bar2' ARRAY(0x316e284)... 'bar3' ARRAY(0x316e188)... 'baz1' ARRAY(0x316ddbc)... 'baz2' ARRAY(0x30cbef4)... 'baz3' ARRAY(0x30f17d8)... 'get_foo1' ARRAY(0x3188800)... 'get_foo2' ARRAY(0x316e89c)... 'get_foo3' ARRAY(0x316e8f0)... 'num1' ARRAY(0x3007f38)...Cut... 'num2' ARRAY(0x310a428)...Cut... 'num3' ARRAY(0x30de9ac)...Cut... %FIELD_TYPE ... 'ARRAY(0x3008154)' 'Baz' 'ARRAY(0x30081c0)' 'Baz' 'ARRAY(0x300822c)' 'Baz' 'ARRAY(0x30082a4)' 'NUMERIC' 'ARRAY(0x3008310)' 'NUMERIC' 'ARRAY(0x300837c)' 'NUMERIC' %INIT_ARGS <empty hash> %WEAK <empty hash> @FIELD_TYPE_INFO ... [0] ARRAY(0x30f646c)... [0] ARRAY(0x300837c) <empty array> [1] 'NUMERIC' [1] ARRAY(0x30f1688)... [0] ARRAY(0x3008310) <empty array> [1] 'NUMERIC' [2] ARRAY(0x310a02c)... [0] ARRAY(0x30082a4) <empty array> [1] 'NUMERIC' [3] ARRAY(0x2ffdf78)... [0] ARRAY(0x300822c) <empty array> [1] 'Baz' [4] ARRAY(0x30f16f4)... [0] ARRAY(0x30081c0) <empty array> [1] 'Baz' [5] ARRAY(0x2ffe4dc)... [0] ARRAY(0x3008154) <empty array> [1] 'Baz'
Direct Responses: 3309 | Write a response
Posted on 2006-10-23 17:02:02-07 by jdhedden in response to 3305
Re: Lvalue problems on ActiveState Windows?
  I'd guess that this is a Want bug

Yuck. It's even more insidious than that: It's the PPM version of Want that is defective. When I use the PPM version, it gives the nasty errors you saw on 28-lvalue.t. When I download Want via CPAN, and build it myself, all is well. Beats me why that is, but I hope this helps.
Direct Responses: 3331 | Write a response
Posted on 2006-10-25 18:20:24-07 by jdhedden in response to 3309
Re: Lvalue problems on ActiveState Windows?
  the PPM version of Want that is defective

It seems that the cause of this is that PPMs are built against Perl 5.8.0 in order to maintain backwards compatibility. This means that PPMs are susceptible to any XS code generations bugs that existed in 5.8.0. Thus, it is probably a good idea not to use PPMs for any modules that have XS code in them.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.