Bug 408829

Summary: YCP bindings for LibStorage have problems with integers > 2^32
Product: [openSUSE] openSUSE 11.1 Reporter: Arvin Schnell <aschnell>
Component: YaST2Assignee: Martin Vidner <mvidner>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None    
Version: Factory   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: example script

Description Arvin Schnell 2008-07-14 09:55:48 UTC
When assigning a value of 2^32+10 to an integer i and passing
that integer to HumanStringToByte (which expects a reference
to an integer) I get a Perl runtime error:

[Interpreter] Storage.ycp:337 Perl wanted to die: RuntimeError Type error in argument 4 of StorageInterface_humanStringToByte. Expected a REFERENCE to INTEGER.

Works with values smaller than 2^32.

The function HumanStringToByte is new in my part-redesign branch.
Comment 1 Martin Vidner 2008-07-14 11:49:07 UTC
Perl integers have only 32 bits on i386, so YCP uses strings to pass larger numbers to Perl (see also bug 127896, and newPerlReferenceableScalar in http://svn.opensuse.org/svn/yast/trunk/perl-bindings/src/YPerl.cc).
The above RuntimeError comes from SWIG code so it seems we need to adapt the  SWIG typemaps to account for this.
Comment 2 Arvin Schnell 2008-07-14 14:40:48 UTC
Created attachment 227637 [details]
example script
Comment 3 Martin Vidner 2008-07-14 16:17:18 UTC
Thanks, I can reproduce it now. And the responsible code is in http://svn.opensuse.org/svn/yast/trunk/perl-bindings/pluglib-bindings/swig/stdc/references.i
Hmm, it even has a testsuite in pluglib-bindings/tests (which is not compiled by default).
Comment 4 Martin Vidner 2008-07-15 10:56:50 UTC
Fixed in SVN perl-bindings. You will need to make clean in libstorage bindings because they do not specify a dependency on the typemaps.

(delaying autobuild submission until I look at the deque bug 398815)
Comment 5 Martin Vidner 2008-07-16 12:04:52 UTC
yast2-perl-bindings-2.17.0 submitted