Skip Menu |

This queue is for tickets about the String-LCSS_XS CPAN distribution.

Report information
The Basics
Id: 76906
Status: open
Priority: 0/
Queue: String-LCSS_XS

People
Owner: Nobody in particular
Requestors: BBYRD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.2
Fixed in: (no value)



Subject: Bizarre failure for $tied_obj->{scalar} passing vs. $scalar passing
This may be a XS thing that needs to be checked for, but passing tied variables has some bizarre failures: use String::LCSS_XS 'lcss'; use SNMP; SNMP::loadModules('ALL'); SNMP::initMib(); my $g = '.1.3.6.1.2.1.10.127.6'; print "LCSS: ".lcss($SNMP::MIB{'DOCS-QOS-MIB::docsQosPktClassTable'}->{objectID}, $g)."\n"; my $h = $SNMP::MIB{'DOCS-QOS-MIB::docsQosPktClassTable'}->{objectID}; print "LCSS: ".lcss($h, $g)."\n"; This prints: LCSS: LCSS: .1.3.6.1.2.1.10.127. So, merely storing the variable into a scalar fixes the problem, but it shouldn't react this way. Pure Perl would always pass the real value at that point, so this has to be some sort of type casting problem with XS. I've already checked a standard object ref pass, and that works. It's only with tied ones.
On Mon Apr 30 17:06:59 2012, BBYRD wrote: Show quoted text
> This may be a XS thing that needs to be checked for, but passing tied > variables has some bizarre failures: > > use String::LCSS_XS 'lcss'; > use SNMP; > > SNMP::loadModules('ALL'); > SNMP::initMib(); > > my $g = '.1.3.6.1.2.1.10.127.6'; > print "LCSS: > ".lcss($SNMP::MIB{'DOCS-QOS-MIB::docsQosPktClassTable'}->{objectID}, > $g)."\n"; > my $h = $SNMP::MIB{'DOCS-QOS-MIB::docsQosPktClassTable'}->{objectID}; > print "LCSS: ".lcss($h, $g)."\n"; > > This prints: > > LCSS: > LCSS: .1.3.6.1.2.1.10.127. > > So, merely storing the variable into a scalar fixes the problem, but it > shouldn't react this way. Pure Perl would always pass the real value at > that point, so this has to be some sort of type casting problem with XS. > > I've already checked a standard object ref pass, and that works. It's > only with tied ones.
Putting SvGETMAGIC(s), SvGETMAGIC(t) before the SvOK checks would solve this, I think.