Skip Menu |
 

This queue is for tickets about the Math-BigInt-FastCalc CPAN distribution.

Report information
The Basics
Id: 119346
Status: resolved
Priority: 0/
Queue: Math-BigInt-FastCalc

People
Owner: Nobody in particular
Requestors: felipe [...] felipegasper.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.5006



X-Source:
MIME-Version: 1.0 (Mac OS X Mail 10.2 \(3259\))
X-Source-Args:
X-Spam-Status: No, score=-1.12 tagged_above=-99.9 required=10 tests=[AWL=-0.670, BAYES_00=-1.9, DATE_IN_PAST_24_48=1.34, DKIM_SIGNED=0.1, T_DKIM_INVALID=0.01] autolearn=no
X-Mailer: Apple Mail (2.3259)
X-Source-Dir:
X-Spam-Flag: NO
Message-ID: <B8ADDF6E-47FF-4EF4-940B-FD86C521D95C [...] felipegasper.com>
content-type: text/plain; charset="utf-8"
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Antiabuse: This header was added to track abuse, please include it with any abuse report
X-Antiabuse: Primary Hostname - web3.siteocity.com
X-Antiabuse: Original Domain - rt.cpan.org
X-Antiabuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-Antiabuse: Sender Address Domain - felipegasper.com
X-Spam-Score: -1.12
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 0368D2403BB for <cpan-bug+math-bigint-fastcalc [...] hipster.bestpractical.com>; Wed, 21 Dec 2016 15:15:14 -0500 (EST)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VyJfiLA-bzUS for <cpan-bug+math-bigint-fastcalc [...] hipster.bestpractical.com>; Wed, 21 Dec 2016 15:15:13 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id CA92E24011A for <bug-math-bigint-fastcalc [...] rt.cpan.org>; Wed, 21 Dec 2016 15:15:12 -0500 (EST)
Received: (qmail 21801 invoked by alias); 21 Dec 2016 20:15:12 -0000
Received: from web3.siteocity.com (HELO web3.siteocity.com) (67.227.147.213) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 21 Dec 2016 12:15:06 -0800
Received: from cpea84e3f4359e3-cma84e3f4359e0.cpe.net.cable.rogers.com ([99.225.179.215]:62214 helo=[192.168.0.13]) by web3.siteocity.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from <felipe [...] felipegasper.com>) id 1cJNry-0003PR-Ht for bug-math-bigint-fastcalc [...] rt.cpan.org; Tue, 20 Dec 2016 12:06:30 -0500
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=softfail (invalid, public key: not available) header.i= [...] felipegasper.com
Delivered-To: cpan-bug+math-bigint-fastcalc [...] hipster.bestpractical.com
Subject: BUG: Math::BigInt::FastCalc fails on as_bytes() conversion
Return-Path: <felipe [...] felipegasper.com>
X-RT-Mail-Extension: math-bigint-fastcalc
X-Original-To: cpan-bug+math-bigint-fastcalc [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=felipegasper.com; s=default; h=To:Date:Message-Id:Subject:Mime-Version: Content-Transfer-Encoding:Content-Type:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GiOwVp7KYk8IzHYHtVONT2Jy+KLx47GTSRsrMExDz4w=; b=mrjxLKW/3wNQuKx3KB4jtc1pao nrPpH78lFUJb6iaP0ZPm7G5Jn4UQOAKV9+G+nSyzH0OZlHDi2/hDy+N3fssj8EahetJcotGCp4awv alzBpr9SkPWA3lDENUkbOigG6tjP646++OBtEg5jQCvtw1kSKlv5/jIW/2UG6c4MMr52CVRoD7uMU RkNy2stPjRKDqcDED8UdD94gtmYaWEi3u2VDJaR9iG1n52PBmUBan+4voUev9ZggHv5scJMu62h+I KY5/5ekqfsd43/4C906ZVMGNPc+BzVbC/mM9pS/XwqeFO74ViLFLN937IPtB3d6OH9gJ315cwaLrC Dp5Q3Bmg==;
Date: Tue, 20 Dec 2016 12:06:30 -0500
X-Authenticated-Sender: web3.siteocity.com: felipe [...] felipegasper.com
X-Spam-Level:
X-Get-Message-Sender-Via: web3.siteocity.com: authenticated_id: fgasper/from_h
To: bug-math-bigint-fastcalc [...] rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: Felipe Gasper <felipe [...] felipegasper.com>
X-RT-Original-Encoding: utf-8
X-RT-Interface: Email
Content-Length: 1530
Download (untitled) / with headers
text/plain 1.4k
There are warnings spewed, and the result is wrong regardless. It appears that FastCalc is doing “& 0xff” on the values--maybe something thinks they’re UTF-8? Thanks for your time! ------------- NORMAL: Show quoted text
> perl -MDevel::Peek -e'use Math::BigInt; Dump( Math::BigInt->from_hex("adf67d9812365dddebb")->as_bytes() )'
SV = PV(0x7fd5f9035610) at 0x7fd5f90d27c8 REFCNT = 1 FLAGS = (TEMP,POK,IsCOW,pPOK) PV = 0x7fd5f8c420b0 "\n\337g\331\201#e\335\336\273"\0 CUR = 10 LEN = 16 COW_REFCNT = 0 ------------- FASTCALC: felipe@Macintosh-4 12:00:27 /cpanel Show quoted text
> perl -MDevel::Peek -e'use Math::BigInt try => "FastCalc"; Dump( Math::BigInt->from_hex("adf67d9812365dddebb")->as_bytes() )'
Character in 'C' format wrapped in pack at /opt/local/lib/perl5/site_perl/5.24/Math/BigInt/Lib.pm line 993. Character in 'C' format wrapped in pack at /opt/local/lib/perl5/site_perl/5.24/Math/BigInt/Lib.pm line 993. Character in 'C' format wrapped in pack at /opt/local/lib/perl5/site_perl/5.24/Math/BigInt/Lib.pm line 993. Character in 'C' format wrapped in pack at /opt/local/lib/perl5/site_perl/5.24/Math/BigInt/Lib.pm line 993. Character in 'C' format wrapped in pack at /opt/local/lib/perl5/site_perl/5.24/Math/BigInt/Lib.pm line 993. Character in 'C' format wrapped in pack at /opt/local/lib/perl5/site_perl/5.24/Math/BigInt/Lib.pm line 993. SV = PV(0x7f8a92137d50) at 0x7f8a92125618 REFCNT = 1 FLAGS = (TEMP,POK,IsCOW,pPOK) PV = 0x7f8a91cbf250 "\n\337g\331\220\30\200\240\310\300"\0 CUR = 10 LEN = 16 COW_REFCNT = 0
MIME-Version: 1.0
In-Reply-To: <B8ADDF6E-47FF-4EF4-940B-FD86C521D95C [...] felipegasper.com>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <B8ADDF6E-47FF-4EF4-940B-FD86C521D95C [...] felipegasper.com>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-493-1482496501-1517.119346-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 133
Download (untitled) / with headers
text/plain 133b
The problem is that I forgot to add a call to $class->_num($x) to convert $x to a scalar before $x was used as an argument to pack().


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.