Skip to content
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

IO::Uncompress::Gunzip silently does not process utf8 strings #15969

Closed
p5pRT opened this issue May 5, 2017 · 9 comments
Closed

IO::Uncompress::Gunzip silently does not process utf8 strings #15969

p5pRT opened this issue May 5, 2017 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented May 5, 2017

Migrated from rt.perl.org#131258 (status was 'rejected')

Searchable as RT131258$

@p5pRT
Copy link
Author

p5pRT commented May 5, 2017

From jeroen.vanwolffelaar@booking.com

Created by jeroen.vanwolffelaar@booking.com

This is a bug report for perl from jeroen.vanwolffelaar@​booking.com,
generated with the help of perlbug 1.39 running under perl 5.18.2.

-----------------------------------------------------------------
Calling

my $text = "This is the raw text";
gzip \$text, \my $gz or die;
my $utf8gz = $gz;
utf8​::upgrade($utf8gz);

gunzip \$utf8gz => $filename|\$uncompressed_data;

succeeds (returns 1), while stuffing the input data into file
$filename/variable $uncompressed_data, not decompressing anything.

It should either decompress the string (even though it's wasteful/silly
that it
is utf8, and it's unclear whether it should treat the utf8-bytes OR the
encoded
string-as-latin1 as the data), or return an error.

Perl Info

Flags:
    category=library
    severity=medium
    module=IO::Uncompress::Gunzip

Site configuration information for perl 5.18.2:

Configured by root at Mon Feb 20 16:49:45 CET 2017.

Summary of my perl5 (revision 5 version 18 subversion 2) configuration:

  Platform:
    osname=linux, osvers=, archname=x86_64-linux
    uname='linux gnulinux '
    config_args=''
  Compiler:
    cc='gcc', ccflags ='',
    optimize='-O2',
    cppflags=''
    ccversion='', gccversion='', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =''
    libpth=/usr/lib64
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -fstack-protector'

Locally applied patches:



@INC for perl 5.18.2:
    lib



Environment for perl 5.18.2:
    HOME=/home/jvanwolffela
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/jvanwolffela/perl5/bin
    PERL5LIB=lib
    PERL_BADLANG (unset)
    PERL_LOCAL_LIB_ROOT=/home/jvanwolffela/perl5:/home/jvanwolffela/perl5
    PERL_MB_OPT=--install_base "/home/jvanwolffela/perl5"
    PERL_MM_OPT=INSTALL_BASE=/home/jvanwolffela/perl5
    SHELL=/bin/bash

--Jeroen

@p5pRT
Copy link
Author

p5pRT commented May 6, 2017

From @jkeenan

On Fri, 05 May 2017 17​:01​:45 GMT, jeroen.vanwolffelaar@​booking.com wrote​:

This is a bug report for perl from jeroen.vanwolffelaar@​booking.com,
generated with the help of perlbug 1.39 running under perl 5.18.2.

-----------------------------------------------------------------
Calling

my $text = "This is the raw text";
gzip \$text, \my $gz or die;
my $utf8gz = $gz;
utf8​::upgrade($utf8gz);

gunzip \$utf8gz => $filename|\$uncompressed_data;

succeeds (returns 1), while stuffing the input data into file
$filename/variable $uncompressed_data, not decompressing anything.

It should either decompress the string (even though it's wasteful/silly
that it
is utf8, and it's unclear whether it should treat the utf8-bytes OR the
encoded
string-as-latin1 as the data), or return an error.

IO​::Uncompress​::Gunzip is part of the IO-Compress library, which is maintained upstream on CPAN. Please file this report by sending mail to​:

bug-IO-Compress@​rt.cpan.org

or by creating a ticket at​:

https://rt.cpan.org//Dist/Display.html?Queue=IO-Compress

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented May 6, 2017

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

@p5pRT
Copy link
Author

p5pRT commented May 6, 2017

@jkeenan - Status changed from 'open' to 'rejected'

@p5pRT p5pRT closed this as completed May 6, 2017
@p5pRT
Copy link
Author

p5pRT commented May 8, 2017

From jeroen.vanwolffelaar@booking.com

Thanks for the pointer, I filed https://rt.cpan.org/Ticket/
Display.html?id=121545 .

(maybe an idea if perlbug would've redirected me? It asked me about which
module this was, so theoretically it should be able to figure out/even
correctly route the ticket?)

--Jeroen

On Sat, May 6, 2017 at 2​:34 PM, James E Keenan via RT <
perlbug-followup@​perl.org> wrote​:

On Fri, 05 May 2017 17​:01​:45 GMT, jeroen.vanwolffelaar@​booking.com wrote​:

This is a bug report for perl from jeroen.vanwolffelaar@​booking.com,
generated with the help of perlbug 1.39 running under perl 5.18.2.

-----------------------------------------------------------------
Calling

my $text = "This is the raw text";
gzip \$text, \my $gz or die;
my $utf8gz = $gz;
utf8​::upgrade($utf8gz);

gunzip \$utf8gz => $filename|\$uncompressed_data;

succeeds (returns 1), while stuffing the input data into file
$filename/variable $uncompressed_data, not decompressing anything.

It should either decompress the string (even though it's wasteful/silly
that it
is utf8, and it's unclear whether it should treat the utf8-bytes OR the
encoded
string-as-latin1 as the data), or return an error.

IO​::Uncompress​::Gunzip is part of the IO-Compress library, which is
maintained upstream on CPAN. Please file this report by sending mail to​:

bug-IO-Compress@​rt.cpan.org

or by creating a ticket at​:

https://rt.cpan.org//Dist/Display.html?Queue=IO-Compress

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented May 8, 2017

From @iabyn

On Sat, May 06, 2017 at 07​:05​:58PM +0200, Jeroen van Wolffelaar via perl5-porters wrote​:

(maybe an idea if perlbug would've redirected me? It asked me about which
module this was, so theoretically it should be able to figure out/even
correctly route the ticket?)

Perlbug is supposed to do this. However, the code currently only does​:

  if the module is not bundled with perl​:
  suggest a mis-spelling or try http​://rt.cpan.org,
  else if module has a bug tracker entry​:
  suggest using that bug tracker instead

However, Module​::CoreList's pod entry for it's bug_tracker() method
implies that bug_tracker() is only to override the default of
  http​://rt.cpan.org/Public/Dist/Display.html?Name=$ModuleName

So perlbug won't correctly handle modules bundled with perl that have a
default bugtracker.

I think the actual logic should be​:

  if the module is not bundled with perl​:
  suggest a mis-spelling or try http​://rt.cpan.org;
  else if Module​::CoreList​::upstream($module)
  $tracker = Module​::CoreList​::bug_tracker($module)
  // "http​://rt.cpan.org/Public/Dist/Display.html?Name=$module"
  suggest using $tracker instead
  else
  accept bug report

--
"But Sidley Park is already a picture, and a most amiable picture too.
The slopes are green and gentle. The trees are companionably grouped at
intervals that show them to advantage. The rill is a serpentine ribbon
unwound from the lake peaceably contained by meadows on which the right
amount of sheep are tastefully arranged." -- Lady Croom, "Arcadia"

@p5pRT
Copy link
Author

p5pRT commented May 8, 2017

From jeroen.vanwolffelaar@booking.com

Dave, I'm extremely unfamiliar with the perl RT setup (as you noticed), can
you -- if needed -- create an issue in the right place for perlbug?

I don't think having it somewhere downstream of some unrelated IO​::Compress
issue is the right place.

Thanks, and yeah, it makes sense to adjust this in the way you describe.

--Jeroen

On Mon, May 8, 2017 at 9​:48 AM, Dave Mitchell <davem@​iabyn.com> wrote​:

On Sat, May 06, 2017 at 07​:05​:58PM +0200, Jeroen van Wolffelaar via
perl5-porters wrote​:

(maybe an idea if perlbug would've redirected me? It asked me about which
module this was, so theoretically it should be able to figure out/even
correctly route the ticket?)

Perlbug is supposed to do this. However, the code currently only does​:

if the module is not bundled with perl&#8203;:
    suggest a mis\-spelling or try http&#8203;://rt\.cpan\.org\,
else if module has a bug tracker entry&#8203;:
    suggest using that bug tracker instead

However, Module​::CoreList's pod entry for it's bug_tracker() method
implies that bug_tracker() is only to override the default of
http​://rt.cpan.org/Public/Dist/Display.html?Name=$ModuleName

So perlbug won't correctly handle modules bundled with perl that have a
default bugtracker.

I think the actual logic should be​:

if the module is not bundled with perl&#8203;:
    suggest a mis\-spelling or try http&#8203;://rt\.cpan\.org;
else if Module&#8203;::CoreList&#8203;::upstream\($module\)
    $tracker = Module&#8203;::CoreList&#8203;::bug\_tracker\($module\)
        // "http&#8203;://rt\.cpan\.org/Public/Dist/Display\.html?Name=$module"
    suggest using $tracker instead
else
    accept bug report

--
"But Sidley Park is already a picture, and a most amiable picture too.
The slopes are green and gentle. The trees are companionably grouped at
intervals that show them to advantage. The rill is a serpentine ribbon
unwound from the lake peaceably contained by meadows on which the right
amount of sheep are tastefully arranged." -- Lady Croom, "Arcadia"

@p5pRT
Copy link
Author

p5pRT commented May 9, 2017

From @pmqs

This ticket can be closed. I'm tracking it upstream in https://rt.cpan.org/Ticket/Display.html?id=121545

cheers
Paul

@p5pRT
Copy link
Author

p5pRT commented May 15, 2017

From @iabyn

On Mon, May 08, 2017 at 10​:24​:52AM +0200, Jeroen van Wolffelaar via perl5-porters wrote​:

Dave, I'm extremely unfamiliar with the perl RT setup (as you noticed), can
you -- if needed -- create an issue in the right place for perlbug?

I don't think having it somewhere downstream of some unrelated IO​::Compress
issue is the right place.

I've now created a new ticket for it, #131316

--
Never work with children, animals, or actors.

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

No branches or pull requests

1 participant