Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Sereal-Encoder CPAN distribution.

Report information
The Basics
Id:
101878
Status:
open
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
zefram [...] fysh.org
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



MIME-Version: 1.0
X-Spam-Status: No, score=-2.179 tagged_above=-99.9 required=10 tests=[AWL=-0.268, BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Content-Disposition: inline
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"
Message-ID: <20150202143302.GC18814@fysh.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -2.179
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id CAC37240106 for <cpan-bug+Sereal-Encoder@hipster.bestpractical.com>; Mon, 2 Feb 2015 09:33:12 -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 YGQkXRJK1aGQ for <cpan-bug+Sereal-Encoder@hipster.bestpractical.com>; Mon, 2 Feb 2015 09:33:11 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 9A3CC240061 for <bug-Sereal-Encoder@rt.cpan.org>; Mon, 2 Feb 2015 09:33:11 -0500 (EST)
Received: (qmail 15690 invoked by alias); 2 Feb 2015 14:33:10 -0000
Received: from river.fysh.org (HELO river.fysh.org) (5.135.154.127) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 02 Feb 2015 06:33:09 -0800
Received: from zefram by river.fysh.org with local (Exim 4.80 #2 (Debian)) id 1YII3i-0001zP-5m; Mon, 02 Feb 2015 14:33:02 +0000
Delivered-To: cpan-bug+Sereal-Encoder@hipster.bestpractical.com
Subject: blessedness lost from unreferenced scalars
Return-Path: <zefram@fysh.org>
X-RT-Mail-Extension: sereal-encoder
X-Original-To: cpan-bug+Sereal-Encoder@hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Date: Mon, 2 Feb 2015 14:33:02 +0000
X-Spam-Level:
To: bug-Sereal-Encoder@rt.cpan.org
From: Zefram <zefram@fysh.org>
X-RT-Original-Encoding: ascii
X-RT-Interface: Email
Content-Length: 789
$ perl -MSereal::Encoder=encode_sereal -MSereal::Decoder=decode_sereal -MData::Dumper=Dumper -we '@a=(3); bless \$a[0], "Foo"; print Dumper \$a[0]; print Dumper \decode_sereal(encode_sereal(\@a))->[0]' $VAR1 = bless( do{\(my $o = 3)}, 'Foo' ); $VAR1 = \3; $a[0] is blessed, but the serialisation of @a didn't preserve the blessedness. I suspect that underneath this there's some confusion about how blessing works: although blessing is always performed through a reference, and blessed objects are always handled through references, the status of being blessed is a property of the referenced object, not of the reference itself. I don't have any real code that's misbehaving due to this. It's an artificial test case that I came up with after reading the Sereal format spec. -zefram
MIME-Version: 1.0
X-Spam-Status: No, score=-5.193 tagged_above=-99.9 required=10 tests=[AWL=1.506, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, FROM_OUR_RT=-4, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
In-Reply-To: <rt-4.0.18-12322-1422887593-676.101878-4-0@rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-101878@rt.cpan.org> <20150202143302.GC18814@fysh.org> <rt-4.0.18-12322-1422887593-676.101878-4-0@rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Received: by 10.140.90.112 with SMTP id w103mr36185232qgd.65.1422889346892; Mon, 02 Feb 2015 07:02:26 -0800 (PST)
Message-ID: <CANgJU+U7L8jm0U+kZU5pDjspEL8J3Dq9cUz_46LA1Bohca8OcA@mail.gmail.com>
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -5.193
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i=@gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 2AC7A2402E6 for <cpan-bug+Sereal-Encoder@hipster.bestpractical.com>; Mon, 2 Feb 2015 10:02:41 -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 tLmL5prWNkG3 for <cpan-bug+Sereal-Encoder@hipster.bestpractical.com>; Mon, 2 Feb 2015 10:02:40 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 89E1E240061 for <bug-Sereal-Encoder@rt.cpan.org>; Mon, 2 Feb 2015 10:02:39 -0500 (EST)
Received: (qmail 17524 invoked by alias); 2 Feb 2015 15:02:39 -0000
Received: from mail-qg0-f52.google.com (HELO mail-qg0-f52.google.com) (209.85.192.52) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 02 Feb 2015 07:02:30 -0800
Received: by mail-qg0-f52.google.com with SMTP id z107so47750997qgd.11 for <bug-Sereal-Encoder@rt.cpan.org>; Mon, 02 Feb 2015 07:02:27 -0800 (PST)
Received: by 10.140.101.145 with HTTP; Mon, 2 Feb 2015 07:02:26 -0800 (PST)
Delivered-To: cpan-bug+Sereal-Encoder@hipster.bestpractical.com
Subject: Re: [rt.cpan.org #101878] blessedness lost from unreferenced scalars
Return-Path: <demerphq@gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=VInG6Xu7DSjDQbBvRTsLF0rL7vnT/yV452J04Bk6mco=; b=DEcj/y7EXiOU1FSaSCCeYVK8vMIg8gF68DkmfHSmIl5wmWX0LEVxty9TYcB1SaFoyS mDiuTLnWC/xdCNhLNjj2nFtaH6/6LXvPJ4vH78K0Rin9OPX+xypaEQFXYuk6SRVNEoIv lUrEzc3qFFOP49/Dv9YyWb9/GEFZPDaT8uOMb/33JHDapiIZPFf/49tOzwycWZ89UTWS AJikmP/n/0Cfuq3WkmF6FPnmhtImwp8EoMGnTIVjkdMd6/eulk7ZTwt4NBk1a97AYRBQ tQwKI8JUXWxVRt2GTbN+5ae+J9Xa0eu93ZSjJO2LaB1hau2YwRxah02hLEzf3tJrXRz2 9/Jw==
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+Sereal-Encoder@hipster.bestpractical.com
X-RT-Mail-Extension: sereal-encoder
Date: Mon, 2 Feb 2015 16:02:26 +0100
X-Spam-Level:
To: bug-Sereal-Encoder@rt.cpan.org
From: demerphq <demerphq@gmail.com>
RT-Message-ID: <rt-4.0.18-16895-1422889361-80.101878-0-0@rt.cpan.org>
Content-Length: 1471
On 2 February 2015 at 15:33, Zefram via RT <bug-Sereal-Encoder@rt.cpan.org> wrote:
Show quoted text
> Mon Feb 02 09:33:13 2015: Request 101878 was acted upon. > Transaction: Ticket created by zefram@fysh.org > Queue: Sereal-Encoder > Subject: blessedness lost from unreferenced scalars > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: zefram@fysh.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=101878 > > > > $ perl -MSereal::Encoder=encode_sereal -MSereal::Decoder=decode_sereal -MData::Dumper=Dumper -we '@a=(3); bless \$a[0], "Foo"; print Dumper \$a[0]; print Dumper \decode_sereal(encode_sereal(\@a))->[0]' > $VAR1 = bless( do{\(my $o = 3)}, 'Foo' ); > $VAR1 = \3; > > $a[0] is blessed, but the serialisation of @a didn't preserve the > blessedness. I suspect that underneath this there's some confusion > about how blessing works: although blessing is always performed through > a reference, and blessed objects are always handled through references, > the status of being blessed is a property of the referenced object, > not of the reference itself. > > I don't have any real code that's misbehaving due to this. It's an > artificial test case that I came up with after reading the Sereal > format spec.
Good catch. Thanks. I will think about what to do about this. We have a related issue with ties that we need to address. Yves -- perl -Mre=debug -e "/just|another|perl|hacker/"
MIME-Version: 1.0
X-Spam-Status: No, score=-4.199 tagged_above=-99.9 required=10 tests=[AWL=1.712, BAYES_00=-1.9, FROM_OUR_RT=-4, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
In-Reply-To: <rt-4.0.18-16895-1422889362-267.101878-6-0@rt.cpan.org>
Content-Disposition: inline
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-101878@rt.cpan.org> <20150202143302.GC18814@fysh.org> <rt-4.0.18-12322-1422887593-676.101878-4-0@rt.cpan.org> <CANgJU+U7L8jm0U+kZU5pDjspEL8J3Dq9cUz_46LA1Bohca8OcA@mail.gmail.com> <rt-4.0.18-16895-1422889362-267.101878-6-0@rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <20150203111738.GB25318@fysh.org>
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -4.199
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 1CE76240522 for <cpan-bug+Sereal-Encoder@hipster.bestpractical.com>; Tue, 3 Feb 2015 06:17:48 -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 VI2+Je2-CNQY for <cpan-bug+Sereal-Encoder@hipster.bestpractical.com>; Tue, 3 Feb 2015 06:17:47 -0500 (EST)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id D27DD240106 for <bug-Sereal-Encoder@rt.cpan.org>; Tue, 3 Feb 2015 06:17:46 -0500 (EST)
Received: (qmail 30935 invoked by alias); 3 Feb 2015 11:17:46 -0000
Received: from river.fysh.org (HELO river.fysh.org) (5.135.154.127) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Tue, 03 Feb 2015 03:17:44 -0800
Received: from zefram by river.fysh.org with local (Exim 4.80 #2 (Debian)) id 1YIbUA-0007Py-2W; Tue, 03 Feb 2015 11:17:38 +0000
Delivered-To: cpan-bug+Sereal-Encoder@hipster.bestpractical.com
Subject: Re: [rt.cpan.org #101878] blessedness lost from unreferenced scalars
Return-Path: <zefram@fysh.org>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+Sereal-Encoder@hipster.bestpractical.com
X-RT-Mail-Extension: sereal-encoder
Date: Tue, 3 Feb 2015 11:17:38 +0000
X-Spam-Level:
To: demerphq via RT <bug-Sereal-Encoder@rt.cpan.org>
From: Zefram <zefram@fysh.org>
RT-Message-ID: <rt-4.0.18-18100-1422962269-865.101878-0-0@rt.cpan.org>
Content-Length: 1247
A variation: $ perl -MSereal::Encoder=encode_sereal -MSereal::Decoder=decode_sereal -MData::Dumper=Dumper -we '@a=(0,3); $a[0] = \$a[1]; bless \$a[1], "Foo"; print Dumper $a[0]; print Dumper decode_sereal(encode_sereal(\@a))->[0]' $VAR1 = bless( do{\(my $o = 3)}, 'Foo' ); $VAR1 = bless( do{\(my $o = 3)}, 'Foo' ); $ perl -MSereal::Encoder=encode_sereal -MSereal::Decoder=decode_sereal -MData::Dumper=Dumper -we '@a=(3,0); $a[1] = \$a[0]; bless \$a[0], "Foo"; print Dumper $a[1]; print Dumper decode_sereal(encode_sereal(\@a))->[1]' $VAR1 = bless( do{\(my $o = 3)}, 'Foo' ); $VAR1 = \3; Sereal gets the aliasing within the array right in both cases, but whether the blessedness is preserved depends on the order in which the blessed scalar and the reference appear in the array. If the reference comes first then the blessedness is preserved; if the blessed scalar comes first then it is not. Amusingly, if you use Data::Dumper to display the whole array before encoding (print Dumper \@a), it can also fail to show the blessedness, in exactly the same pattern as Sereal. Presumably for the same underlying reasons. (Will report as a bug in Data::Dumper.) This is why the Dumper statements above look at specific array elements. -zefram


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

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