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

Using flags causes Data::Dumper to die instead of warn #11702

Open
p5pRT opened this issue Oct 17, 2011 · 3 comments
Open

Using flags causes Data::Dumper to die instead of warn #11702

p5pRT opened this issue Oct 17, 2011 · 3 comments
Labels
dist-Data-Dumper issues in the dual-life blead-first Data-Dumper distribution type-library

Comments

@p5pRT
Copy link

p5pRT commented Oct 17, 2011

Migrated from rt.perl.org#101508 (status was 'open')

Searchable as RT101508$

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2011

From @Tux

Created by @Tux

--8<---
use strict;
use Data​::Dumper;

$Data​::Dumper​::Deparse = 1;
$Data​::Dumper​::Useqq = 1;

print Dumper {
  SV => 1,
  GLB => *STDERR,
  IO => *{$​::{STDERR}}{IO},
  FMT => *{$​::{STDOUT}}{FORMAT},
  };
-->8---

Without either of these two flags, Dumper will warn with​:

cannot handle ref type 15 at /pro/lib/perl5/5.14.1/x86_64-linux-ld/Data/Dumper.pm line 190.
$VAR1 = {
  'IO' => bless( , 'IO​::File' ),
  'GLB' => *​::STDERR,
  'FMT' => undef,
  'SV' => 1
  };

With either of these two flags, it will die​:

Can't handle IO type. at ../bisect-test.pl line 14

Perl Info

Flags:
    category=library
    severity=medium
    module=Data::Dumper

Site configuration information for perl 5.12.2:

Configured by merijn at Fri Oct 29 11:43:59 CEST 2010.

Summary of my perl5 (revision 5 version 12 subversion 2) configuration:
   
  Platform:
    osname=linux, osvers=2.6.31.14-0.4-desktop, archname=x86_64-linux-ld
    uname='linux sv03 2.6.31.14-0.4-desktop #1 smp preempt 2010-10-25 08:45:30 +0200 x86_64 x86_64 x86_64 gnulinux '
    config_args='-Duse64bitall -Duselongdouble -des'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=undef, usemultiplicity=undef
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=define
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='ccache cc', ccflags ='-fPIC -fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fPIC -fno-strict-aliasing -pipe -fstack-protector -I/pro/local/include'
    ccversion='', gccversion='4.4.1 [gcc-4_4-branch revision 150839]', 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='long double', nvsize=16, Off_t='off_t', lseeksize=8
    alignbytes=16, prototype=define
  Linker and Libraries:
    ld='ccache cc', ldflags ='-L/pro/local/lib -fstack-protector'
    libpth=/pro/local/lib /lib /usr/lib /usr/local/lib /lib64 /usr/lib64 /usr/local/lib64
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.10.1.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.10.1'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/pro/local/lib -fstack-protector'

Locally applied patches:
    


@INC for perl 5.12.2:
    /pro/lib/perl5/site_perl/5.12.2/x86_64-linux-ld
    /pro/lib/perl5/site_perl/5.12.2
    /pro/lib/perl5/5.12.2/x86_64-linux-ld
    /pro/lib/perl5/5.12.2
    .


Environment for perl 5.12.2:
    HOME=/home/merijn
    LANG=en_US.utf8
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=.:/home/merijn/bin/private:/home/merijn/bin:/pro/local/bin:/pro/bin:/usr/local/bin:/usr/lib64/mpi/gcc/openmpi/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/usr/NX/bin:/opt/gnome/bin:/usr/lib/qt3/bin:/usr/sbin:/pro/local/sbin:/sbin:/opt/cxoffice/bin:/pro/to/bin:/usr/local/sbin:/pro/3gl/CPAN/bin:/home/merijn/cxoffice/bin
    PERL_BADLANG (unset)
    SHELL=/pro/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2013

From @jkeenan

On Mon Oct 17 01​:17​:15 2011, hmbrand wrote​:

This is a bug report for perl from h.m.brand@​xs4all.nl,
generated with the help of perlbug 1.39 running under perl 5.12.2.

-----------------------------------------------------------------
[Please describe your issue here]

--8<---
use strict;
use Data​::Dumper;

$Data​::Dumper​::Deparse = 1;
$Data​::Dumper​::Useqq = 1;

print Dumper {
SV => 1,
GLB => *STDERR,
IO => *{$​::{STDERR}}{IO},
FMT => *{$​::{STDOUT}}{FORMAT},
};
-->8---

Without either of these two flags, Dumper will warn with​:

cannot handle ref type 15 at /pro/lib/perl5/5.14.1/x86_64-linux-
ld/Data/Dumper.pm line 190.
$VAR1 = {
'IO' => bless( , 'IO​::File' ),
'GLB' => *​::STDERR,
'FMT' => undef,
'SV' => 1
};

With either of these two flags, it will die​:

Can't handle IO type. at ../bisect-test.pl line 14

Data​::Dumper's performance here is sub-optimal, but I don't think it can
be described as a bug per se.

You are getting two different results because the use of
$Data​::Dumper​::Deparse or $Data​::Dumper​::Useqq triggers the pure-Perl
implementation of the library. It is indeed the case that Data​::Dumper
does not handle the 'IO' type, so the "Can't handle IO type" is the
expected failure message. (In Data​::Dumper v2.135_06, which is what
shipped with Perl 5.16.0, you can find this "croak" at line 484 of
Dumper.pm.)

With neither of the two flags, you are using the XS-implementation of
Data​::Dumper. I have no expertise with the XS side, but I concede that
I would not know what to make of a fatal error saying "cannot handle ref
type 15."

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Jan 27, 2013

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

@jkeenan jkeenan added dist-Data-Dumper issues in the dual-life blead-first Data-Dumper distribution and removed Severity Medium distro-Linux labels Jul 5, 2021
@xenu xenu removed the affects-5.12 label Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dist-Data-Dumper issues in the dual-life blead-first Data-Dumper distribution type-library
Projects
None yet
Development

No branches or pull requests

3 participants