Skip Menu |

This queue is for tickets about the DB_File CPAN distribution.

Report information
The Basics
Id: 129753
Status: resolved
Priority: 0/
Queue: DB_File

People
Owner: Nobody in particular
Requestors: yanlinlin82 [...] gmail.com
Cc:
AdminCc:

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



Subject: DB_File hash key generation conflict with "strict refs" in perl v5.28.2
I got this error message when using DB_File to cache a very big hash set: ``` $ perl foo.pl Can't use string ("HASH(0x5644281ae7e8)") as a HASH ref while "strict refs" in use at foo.pl line 10. ``` Here goes the foo.pl, a minimal script for reproducing the error: ``` $ cat foo.pl #!/usr/bin/perl use strict; use warnings; use DB_File; my %hash = (); tie %hash, "DB_File", "cache.$$"; for my $i (0 .. 1e9) { $hash{$i} = { value => $i }; $hash{$i}->{square} = $i * $i; } ``` My perl version info goes in the attachment ('perl-version-info.log', generated by 'perl -V').
Subject: perl-version-info.log
Summary of my perl5 (revision 5 version 28 subversion 2) configuration: Platform: osname=linux osvers=4.19.44-gentoo archname=x86_64-linux uname='linux yanll-laptop 4.19.44-gentoo #1 smp thu may 23 05:54:56 cst 2019 x86_64 intel(r) core(tm) i7-7700hq cpu @ 2.80ghz genuineintel gnulinux ' config_args='-des -Dinstallprefix=/usr -Dinstallusrbinperl=n -Ui_xlocale -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none -Dinc_version_list=5.26.2 -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dnoextensions=ODBM_File -Duseshrplib -Darchname=x86_64-linux -Dcc=x86_64-pc-linux-gnu-gcc -Doptimize=-march=native -O2 -pipe -Dldflags=-Wl,-O1 -Wl,--as-needed -Dprefix=/usr -Dsiteprefix=/usr/local -Dvendorprefix=/usr -Dscriptdir=/usr/bin -Dprivlib=/usr/lib64/perl5/5.28.2 -Darchlib=/usr/lib64/perl5/5.28.2/x86_64-linux -Dsitelib=/usr/local/lib64/perl5/5.28.2 -Dsitearch=/usr/local/lib64/perl5/5.28.2/x86_64-linux -Dvendorlib=/usr/lib64/perl5/vendor_perl/5.28.2 -Dvendorarch=/usr/lib64/perl5/vendor_perl/5.28.2/x86_64-linux -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dvendorman1dir=/usr/share/man/man1 -Dvendorman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dlibperl=libperl.so.5.28.2 -Dlocincpth=/usr/include -Dglibpth=/lib64 /usr/lib64 -Duselargefiles -Dd_semctl_semun -Dcf_by=Gentoo -Dmyhostname=localhost -Dperladmin=root@localhost -Ud_csh -Dsh=/bin/sh -Dtargetsh=/bin/sh -Uusenm -Ui_xlocale -Di_ndbm -Di_gdbm -Di_db -DDEBUGGING=none -Dinc_version_list=5.26.2 -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Dnoextensions=ODBM_File' hint=recommended useposix=true d_sigaction=define useithreads=undef usemultiplicity=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='x86_64-pc-linux-gnu-gcc' ccflags ='-fwrapv -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' optimize='-march=native -O2 -pipe' cppflags='-fwrapv -fno-strict-aliasing -pipe' ccversion='' gccversion='8.3.0' gccosandvers='' intsize=4 longsize=8 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long' ivsize=8 nvtype='double' nvsize=8 Off_t='off_t' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='x86_64-pc-linux-gnu-gcc' ldflags ='-Wl,-O1 -Wl,--as-needed' libpth=/usr/local/lib64 /lib64 /usr/lib64 /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include-fixed /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat perllibs=-ldl -lm -lcrypt -lutil -lc libc=libc-2.29.so so=so useshrplib=true libperl=libperl.so.5.28.2 gnulibc_version='2.29' Dynamic Linking: dlsrc=dl_dlopen.xs dlext=so d_dlsymun=undef ccdlflags='-Wl,-E' cccdlflags='-fPIC' lddlflags='-shared -march=native -O2 -pipe -Wl,-O1 -Wl,--as-needed' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF Locally applied patches: gentoo/hints_hpux - Fix hpux hints gentoo/aix_soname - aix gcc detection and shared library soname support gentoo/EUMM-RUNPATH - https://bugs.gentoo.org/105054 cpan/ExtUtils-MakeMaker: drop $PORTAGE_TMPDIR from LD_RUN_PATH gentoo/config_over - Remove -rpath and append LDFLAGS to lddlflags gentoo/opensolaris_headers - Add headers for opensolaris gentoo/patchlevel - List packaged patches for perl-5.28.2-r1(#4) in patchlevel.h gentoo/cleanup-paths - Cleanup PATH and shrpenv gentoo/enc2xs - Tweak enc2xs to follow symlinks and ignore missing @INC directories. gentoo/darwin-cc-ld - https://bugs.gentoo.org/297751 darwin: Use $CC to link gentoo/cpan_definstalldirs - Provide a sensible INSTALLDIRS default for modules installed from CPAN. gentoo/interix - Fix interix hints gentoo/create_libperl_soname - https://bugs.gentoo.org/286840 Set libperl soname gentoo/mod_paths - Add /etc/perl to @INC gentoo/EUMM_perllocalpod - cpan/ExtUtils-MakeMaker: remove targets that generate perllocal.pod gentoo/drop_fstack_protector - https://bugs.gentoo.org/348557 Don't force -fstack-protector on everyone gentoo/usr_local - Configure: Don't include sources in /usr/local/ for compiling perl gentoo/D-SHA-CFLAGS - https://bugs.gentoo.org/506818 Do not set custom CFLAGS in cpan/Digest-SHA gentoo/io_socket_ip_tests - cpan/IO-Socket-IP: Disable network tests gentoo/tests - Fix EUMM podlocal tests gentoo/no-nsl-cl.patch - gentoo/no_porting_tests - Disable porting tests which create fun false-failures all over travis gentoo/pathtools_enoent - Disable PathTools tests which fails under sandboxing debian/cpan-missing-site-dirs - Fix CPAN::FirstTime defaults with nonexisting site dirs if a parent is writable debian/makemaker-pasthru - Pass LD settings through to subdirectories fixes/memoize_storable_nstore - [rt.cpan.org #77790] Memoize::Storable: respect 'nstore' option not respected fixes/podman-pipe - Better errors for man pages from standard input fixes/respect_umask - Respect umask during installation fixes/net_smtp_docs - [rt.cpan.org #36038] Document the Net::SMTP 'Port' option fixes/document_makemaker_ccflags - [rt.cpan.org #68613] Document that CCFLAGS should include $Config{ccflags} fixes/parallel-manisort.patch - Fix parallel building fixes/storable-metasploit.patch - [PATCH 1/2] (perl #133706) remove exploit code from Storable fixes/storable-probing.patch - [PATCH 2/2] (perl #133708) remove build-time probing for stack limits for Storable fixes/gdbm-test.patch - [PATCH] ext/GDBM_File/t/fatal.t: handle non-fatality Built under linux Compiled at May 25 2019 14:56:30 %ENV: PERL5LIB="/home/yanll/perl5/lib/perl5:~/Tools/bioperl-live-release-1-7-2" PERL_LOCAL_LIB_ROOT="/home/yanll/perl5" PERL_MB_OPT="--install_base "/home/yanll/perl5"" PERL_MM_OPT="INSTALL_BASE=/home/yanll/perl5" @INC: /home/yanll/perl5/lib/perl5/x86_64-linux /home/yanll/perl5/lib/perl5 ~/Tools/bioperl-live-release-1-7-2 /etc/perl /usr/local/lib64/perl5/5.28.2/x86_64-linux /usr/local/lib64/perl5/5.28.2 /usr/lib64/perl5/vendor_perl/5.28.2/x86_64-linux /usr/lib64/perl5/vendor_perl/5.28.2 /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl/5.26.2 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/5.28.2/x86_64-linux /usr/lib64/perl5/5.28.2
Storing complex data structures with DB_File requires some help. Below is from the DB_File documentation. How do I store complex data structures with DB_File? ---------------------------------------------------- Although DB_File cannot do this directly, there is a module which can layer transparently over DB_File to accomplish this feat. Check out the MLDBM module, available on CPAN in the directory modules/by-module/MLDBM.
Thank you very much! I will check and use the MLDBM module. On Wed Jun 05 07:25:25 2019, PMQS wrote: Show quoted text
> Storing complex data structures with DB_File requires some help. > > Below is from the DB_File documentation. > > > How do I store complex data structures with DB_File? > ---------------------------------------------------- > Although DB_File cannot do this directly, there is a module which can > layer transparently over DB_File to accomplish this feat. > > Check out the MLDBM module, available on CPAN in the directory > modules/by-module/MLDBM.