Skip to content

COW bug in :encoding layer #16489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
p5pRT opened this issue Apr 6, 2018 · 5 comments
Closed

COW bug in :encoding layer #16489

p5pRT opened this issue Apr 6, 2018 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 6, 2018

Migrated from rt.perl.org#133066 (status was 'resolved')

Searchable as RT133066$

@p5pRT
Copy link
Author

p5pRT commented Apr 6, 2018

From @pali

Following code modifies variable $valid​:

use strict;
use warnings;
use Data​::Dumper;

my $valid = "\x61\x00\x00\x00";
my $tmp = $valid;
print Dumper $valid;
open my $fh, '<​:encoding(UTF32-LE)', \$tmp or die;
my $str = <$fh>;
close $fh;
print Dumper $valid;

Output is​:

$VAR1 = 'a';
$VAR1 = '';

From jhietaniemi@​gmail.com Wed Feb 14 08​:08​:54 2018
Return-Path​: <jhietaniemi@​gmail.com>
X-Original-To​: rt-perl5@​rtperl.dev
Delivered-To​: rt-perl5@​rtperl.dev
Received​: from xx1.develooper.com (xx1.dev [10.0.100.115])
  by rtperl.develooper.com (Postfix) with ESMTP id B8B2D7A9
  for <rt-perl5@​rtperl.dev>; Wed, 14 Feb 2018 08​:08​:54 -0800 (PST)
Received​: from localhost (xx1.develooper.com [127.0.0.1])
  by localhost (Postfix) with ESMTP id 9125111F2D5
  for <rt-perl5@​rtperl.dev>; Wed, 14 Feb 2018 08​:08​:54 -0800 (PST)
X-Spam-Checker-Version​: SpamAssassin 3.3.1 (2010-03-16) on mx3.develooper.com
X-Spam-Status​: No, score=-1.9 required=6.0 tests=BAYES_00,DKIM_SIGNED,
  DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1
Received​: from xx1.develooper.com (xx1.develooper.com [127.0.0.1])
  by localhost (Postfix) with SMTP id 006D711EF35
  for <rt-perl5@​rtperl.dev>; Wed, 14 Feb 2018 08​:08​:52 -0800 (PST)
Received​: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54])
  (using TLSv1 with cipher AES128-SHA (128/128 bits))
  (No client certificate requested)
  by xx1.develooper.com (Postfix) with ESMTPS id 59AAB11F2E1
  for <perlbug@​perl.org>; Wed, 14 Feb 2018 08​:08​:41 -0800 (PST)
Received​: by mail-lf0-f54.google.com with SMTP id 37so11283204lfs.7
  for <perlbug@​perl.org>; Wed, 14 Feb 2018 08​:08​:41 -0800 (PST)
DKIM-Signature​: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=gmail.com; s=20161025;
  h=sender​:reply-to​:subject​:to​:references​:from​:message-id​:date
  :user-agent​:mime-version​:in-reply-to​:content-language
  :content-transfer-encoding;
  bh=K4DBcrQgUC7X+nhLWqPH3j9jM5K2qWxkIOgoS0cTMcc=;
  b=q5BSrLwCRVvxje2juIetQuDyOiUAupZ5GGqIBi/A5/SzFa2RCjLxNI1JeSleTTjSeS
  E/SrmLtuatcgC+FP+9uTMCwg6otzZ1dERv3bqDe9V40I5sBtY3V3CNv5vh7TPb7suSoR
  HE2A8Tgq13tswKjveg9/DfSXIpO3tLNe/+yfRvxLyZrjmrX+bW60C74Hzs5nRFSpZctH
  4Jv+abcfPOs6Ws4ERw1UBq6+Yr2Y1b2zV3zk7qsofTjR85TLvmvad/DCWdeHbYSng846
  ZCxnoPjoOv53LLEPUlYlzYePf4mX4B942FYAc4H1bcH4GVe0OPVxpBbkAtNyS1ThVzMw
  0PGQ==
X-Google-DKIM-Signature​: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=1e100.net; s=20161025;
  h=x-gm-message-state​:sender​:reply-to​:subject​:to​:references​:from
  :message-id​:date​:user-agent​:mime-version​:in-reply-to
  :content-language​:content-transfer-encoding;
  bh=K4DBcrQgUC7X+nhLWqPH3j9jM5K2qWxkIOgoS0cTMcc=;
  b=qA5H+81BoDM4Y4Wx1ITcHKSFYXXP4hn1UQL7sXo60aLmxHCwoeUxjta8KSy3LeGVcz
  qVzLOqUHqvMzbYnfv4XLi0v+b8rBf348ujCU9MRSWq+lP8pRnIFnLDUgei3WRwFiCOnA
  9H+xLpcm5f1Hp7PYThpsdgLW70BXcC29HIAvJ2WYJk57g+ajuspR1PqHY4JjGil0mshz
  iSDwMXR5N6klmnfkCSd50I0gyOAjPoWkh9xLlriXj9FN4wgYBIgLfv/Qi8S4NFPlxPKk
  ruktE9a1ggzakkgvrLRDFK+P77BDwOKYg7beUl3MqTPH/b8vewN+85v8o9p9yGt/yhmB
  yN6Q==
X-Gm-Message-State​: APf1xPCu+enrBuhs/teerk98xp5SNNqzsi3HWmhatX6x8OykbJ+iKNH7
  MfxyxVGfzeykURZiJN2LvlkuHGVs
X-Google-Smtp-Source​: AH8x225pLgcUFyvZPA8yglR9h+bHSwa5jaA+iBj8/FUOgvME1RentSPqCdUs5EcMkJ1akRaqGY3iLQ==
X-Received​: by 10.25.166.209 with SMTP id p200mr3979385lfe.90.1518624518062;
  Wed, 14 Feb 2018 08​:08​:38 -0800 (PST)
Received​: from Vredefort2.local (dsl-hkibng22-54f8da-191.dhcp.inet.fi. [84.248.218.191])
  by smtp.gmail.com with ESMTPSA id i65sm2713655lfb.11.2018.02.14.08.08.36
  (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
  Wed, 14 Feb 2018 08​:08​:37 -0800 (PST)
Sender​: "jhi@​iki.fi" <jhietaniemi@​gmail.com>
Reply-To​: jhi@​iki.fi
Subject​: Re​: t/io/openpid.t makes test harness sluggish; reduce sleep time
To​: James E Keenan <jkeenan@​pobox.com>, perlbug@​perl.org
References​: <8c8f0d5b-abb3-d6ef-b2b5-07ffbb092eb2@​pobox.com>
From​: Jarkko Hietaniemi <jhi@​iki.fi>
Message-ID​: <d352f1c9-6943-0987-021b-28754f9f2abc@​iki.fi>
Date​: Wed, 14 Feb 2018 18​:08​:35 +0200
User-Agent​: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv​:58.0)
Gecko/20100101 Thunderbird/58.0
MIME-Version​: 1.0
In-Reply-To​: <8c8f0d5b-abb3-d6ef-b2b5-07ffbb092eb2@​pobox.com>
Content-Type​: text/plain; charset=utf-8; format=flowed
Content-Language​: en-US
Content-Transfer-Encoding​: 7bit
X-PMX-Version​: 5.6.1.2065439, Antispam-Engine​: 2.7.2.376379, Antispam-Data​: 2018.2.14.160316
X-PMX-Spam​: Gauge=X, Probability=10%, Report='
WEBMAIL_REPLYTO_NOT_FROM 0.5, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_600_699 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, NO_CTA_URI_FOUND 0, NO_URI_FOUND 0, NO_URI_HTTPS 0, REFERENCES 0, REPLYTO_SAMEAS_FROM 0, SPF_PASS 0, WEBMAIL_SOURCE 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __DQ_NEG_HEUR 0, __DQ_NEG_IP 0, __FORWARDED_MSG 0, __FRAUD_MONEY_CURRENCY 0, __FRAUD_MONEY_CURRENCY_DOLLAR 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_SENDER 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_REPLYTO 0, __HELO_GMAIL 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __MOZILLA_USER_AGENT 0, __NO_HTML_TAG_RAW 0, __PHISH_SPEAR_STRUCTURE_1 0, __PHISH_SPEAR_STRUCTURE_2 0,
__RDNS_GMAIL 0, __REFERENCES 0, __REPLYTO_SAMEAS_FROM_ACC 0, __REPLYTO_SAMEAS_FROM_ADDY 0, __REPLYTO_SAMEAS_FROM_DOMAIN 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __SUBJ_ALPHA_NEGATE 0, __TO_MALFORMED_2 0, __TO_NAME 0, __TO_NAME_DIFF_FROM_ACC 0, __TO_REAL_NAMES 0, __USER_AGENT 0, __YOUTUBE_RCVD 0, __blackholes.mail-abuse.org_TIMEOUT , __zen.spamhaus.org_ERROR '

On 2/14/18 17​:45, James E Keenan wrote​:

When you run 'make test_harness' often enough, you quickly become aware
that, despite setting $TEST_JOBS to an appropriate value, certain test
files are slow and block the forward movement of the harness. The first
such file I notice is t/io/openpid.t, which contains two commands which
each sleep for 30 seconds.

The amount of 'sleep' requested has been unchanged since commit c8fc8fb
in 2003. Do we still need to sleep so much? If not, please review

I fully admit that I have no recollection of the reasoning 15 years later.

patch attached.

Thank you very much.
Jim Keenan

From carlos@​carlosguevara.com Sat Feb 24 21​:05​:32 2018
Return-Path​: <carlos@​carlosguevara.com>
X-Original-To​: rt-perl5@​rtperl.dev
Delivered-To​: rt-perl5@​rtperl.dev
Received​: from xx1.develooper.com (xx1.dev [10.0.100.115])
  by rtperl.develooper.com (Postfix) with ESMTP id DE82A143
  for <rt-perl5@​rtperl.dev>; Sat, 24 Feb 2018 21​:05​:32 -0800 (PST)
Received​: from localhost (xx1.develooper.com [127.0.0.1])
  by localhost (Postfix) with ESMTP id 9C2AB11DA20
  for <rt-perl5@​rtperl.dev>; Sat, 24 Feb 2018 21​:05​:32 -0800 (PST)
X-Spam-Checker-Version​: SpamAssassin 3.3.1 (2010-03-16) on mx3.develooper.com
X-Spam-Status​: No, score=-1.9 required=6.0 tests=BAYES_00,DKIM_SIGNED,
  DKIM_VALID,RCVD_IN_DNSWL_NONE,TVD_SPACE_RATIO,URIBL_BLOCKED autolearn=ham
  version=3.3.1
Received​: from xx1.develooper.com (xx1.develooper.com [127.0.0.1])
  by localhost (Postfix) with SMTP id B69B111E025
  for <rt-perl5@​rtperl.dev>; Sat, 24 Feb 2018 21​:05​:29 -0800 (PST)
Received​: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45])
  (using TLSv1 with cipher AES128-SHA (128/128 bits))
  (No client certificate requested)
  by xx1.develooper.com (Postfix) with ESMTPS id D100011E00E
  for <perlbug@​perl.org>; Sat, 24 Feb 2018 21​:05​:27 -0800 (PST)
Received​: by mail-wm0-f45.google.com with SMTP id z81so11561479wmb.4
  for <perlbug@​perl.org>; Sat, 24 Feb 2018 21​:05​:27 -0800 (PST)
DKIM-Signature​: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=carlosguevara-com.20150623.gappssmtp.com; s=20150623;
  h=mime-version​:from​:date​:message-id​:subject​:to;
  bh=Qj+bpoLezgmlviCDIbP2VIK93wly17mvtMAFjw2ek10=;
  b=0ieCcBMmwdwgkM2CIQMSPqose6wAqIgspesWWlU36DNMnORBORDXBE99qB+gYeHl6H
  fflaR6BXPrCebGok5Dwfa0+AVDori4/gQr/7G24llgr1ytgAF/4QqS4FZNkY8sy+jG01
  16XcZFZARmVTT2v4tv5kOiBZxMoX9wmJGCGmpRx7d2VF3Sz2KEKnNDdiFybPf4ZCwMLn
  3DWrMER3Hws7W5Y9+OybOS1wCzavzkeHJpliIpEipIVvs+UqesJtOhxVtn0lNBSjB8ze
  0vVWShThJ690ABf+8SCkoi3fON6x9gWaQrtOUer8TwtFvWPs48EUF+nblOWVZMSkvy2m
  UAFg==
X-Google-DKIM-Signature​: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=1e100.net; s=20161025;
  h=x-gm-message-state​:mime-version​:from​:date​:message-id​:subject​:to;
  bh=Qj+bpoLezgmlviCDIbP2VIK93wly17mvtMAFjw2ek10=;
  b=BQI5TPdJ3BqR9McNhOpr+3P4AiQmKbEbOFSTklBosIYHZgndsrLsf9KgthKDEORp3J
  PZEXGsbeALUg8jJHUFQAxNoEMd573ZZJoGaKceu7tL3C7+Xzy8gDIOLKc4cFUTEdSEfe
  mcJSvfO/vOoE9uGOGw/G2QLmwlYhP3Bvfx5bZhYttUrwMCWm/ooltdJpkz2q8awxoXFb
  kRFXuI/TIRpsI7IF9+LG4KsRO3rbWuauOCPguBeT7YeHDDfKl+xS/lLHMukjUYlLXfqA
  KWTCTg4ytLjKdYq4Fk4PQQ/mZI4m/kiKIOkGtuxoGpyddvtHlgYclBMLQjFyQT1zXn2u
  BueA==
X-Gm-Message-State​: APf1xPCjmWANG7CgodPwM2NaewTPHeRnAN8edlgP3FMizBBoP9LK8vsy
  84/WaWSHFjA/3Nbc7ATEFHYMQ/7m7zpj0mBEJHAGu78GSmM=
X-Google-Smtp-Source​: AG47ELtjfMrY4J7SofEiolIVAFUxBJwj8n+raEhYQ2h7Vh3l3l2vIwVyFsLK/Wp4mLu7SAXkV8bVAmfYLde4SZgMch0=
X-Received​: by 10.80.221.74 with SMTP id u10mr5205462edk.198.1519535112077;
Sat, 24 Feb 2018 21​:05​:12 -0800 (PST)
MIME-Version​: 1.0
Received​: by 10.80.173.221 with HTTP; Sat, 24 Feb 2018 21​:04​:31 -0800 (PST)
From​: Carlos Guevara <carlos@​carlosguevara.com>
Date​: Sat, 24 Feb 2018 23​:04​:31 -0600
Message-ID​: <CAASMjLF4NjvZSP+RZQ8Qa95nN0=sx+B5UQdWEpxBaxC7qBxEmg@​mail.gmail.com>
Subject​: Blead Breaks CPAN​: Test​::MockObject
To​: perlbug@​perl.org
Content-Type​: text/plain; charset="UTF-8"
X-PMX-Version​: 5.6.1.2065439, Antispam-Engine​: 2.7.2.376379, Antispam-Data​: 2018.2.25.45415
X-PMX-Spam​: Gauge=IIIIIIII, Probability=8%, Report='
HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODYTEXTP_SIZE_400_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_100_199 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CT_TEXT_PLAIN_UTF8_CAPS 0, DATE_TZ_NA 0, DKIM_SIGNATURE 0, NO_URI_HTTPS 0, SINGLE_URI_IN_BODY 0, SMALL_BODY 0, SPF_PASS 0, URI_WITH_PATH_ONLY 0, WEBMAIL_SOURCE 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __DQ_NEG_HEUR 0, __DQ_NEG_IP 0, __HAS_FROM 0, __HAS_MSGID 0, __HELO_GMAIL 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __NO_HTML_TAG_RAW 0, __PHISH_SPEAR_HTTP_RECEIVED 0, __PHISH_SPEAR_STRUCTURE_1 0, __PHISH_SPEAR_STRUCTURE_2 0, __RDNS_GMAIL 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __SUBJ_ALPHA_NEGATE 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_IN_BODY 0, __URI_NOT_IMG 0, __URI_NO_MAILTO 0, __URI_NS , __URI_WITH_PATH 0, __YOUTUBE_RCVD 0,
__zen.spamhaus.org_ERROR '

It looks like blead broke Test​::MockObject​:
http​://www.cpantesters.org/cpan/report/cf360f98-19e0-11e8-809c-69696b55ae40

@p5pRT
Copy link
Author

p5pRT commented Apr 6, 2018

From @iabyn

On Thu, Apr 05, 2018 at 08​:32​:14PM -0700, via RT wrote​:

# New Ticket Created by
# Please include the string​: [perl #133066]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=133066 >

Following code modifies variable $valid​:

use strict;
use warnings;
use Data​::Dumper;

my $valid = "\x61\x00\x00\x00";
my $tmp = $valid;
print Dumper $valid;
open my $fh, '<​:encoding(UTF32-LE)', \$tmp or die;
my $str = <$fh>;
close $fh;
print Dumper $valid;

Output is​:

$VAR1 = 'a';
$VAR1 = '';

This was fixed in 5.27.9.

--
The Enterprise's efficient long-range scanners detect a temporal vortex
distortion in good time, allowing it to be safely avoided via a minor
course correction.
  -- Things That Never Happen in "Star Trek" #21

@p5pRT
Copy link
Author

p5pRT commented Apr 6, 2018

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Apr 6, 2018

From @pali

On Friday 06 April 2018 01​:48​:02 Dave Mitchell via RT wrote​:

On Thu, Apr 05, 2018 at 08​:32​:14PM -0700, via RT wrote​:

# New Ticket Created by
# Please include the string​: [perl #133066]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=133066 >

Following code modifies variable $valid​:

use strict;
use warnings;
use Data​::Dumper;

my $valid = "\x61\x00\x00\x00";
my $tmp = $valid;
print Dumper $valid;
open my $fh, '<​:encoding(UTF32-LE)', \$tmp or die;
my $str = <$fh>;
close $fh;
print Dumper $valid;

Output is​:

$VAR1 = 'a';
$VAR1 = '';

This was fixed in 5.27.9.

Date​: Wed, 7 Feb 2018 20​:37​:57 +0100

Why my email was received by RT server just now after 2 months??

@p5pRT
Copy link
Author

p5pRT commented Apr 6, 2018

@iabyn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant