develooper Front page | perl.perl5.porters | Postings from September 2013

[perl #119623] GDBM_FILE: gdbm_open requires a blocksize to be a power of two

From:
Andy Dougherty
Date:
September 5, 2013 13:47
Subject:
[perl #119623] GDBM_FILE: gdbm_open requires a blocksize to be a power of two
Message ID:
rt-3.6.HEAD-1873-1378388805-803.119623-75-0@perl.org
# New Ticket Created by  Andy Dougherty 
# Please include the string:  [perl #119623]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=119623 >



This is a bug report for perl from doughera@lafayette.edu,
generated with the help of perlbug 1.39 running under perl 5.18.0.


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

ext/GDBM_File/GDBM_File.xs calls gdbm_open with GDBM_BLOCKSIZE=0.
This instructs gdbm to use the stat block size for the file system.
Unfortunately, gdbm will fail if that stat block size is not a power
of two.  See [perl #119537] for some more details.

Maybe if gdbm_open fails with gdbm_error == GDBM_BLOCK_SIZE_ERROR, we
should retry with a 'default' blocksize, something simple like 1024.  Or,
perhaps GDBM_File.xs ought to do something like stat(dirname(name)) and
then work out the "closest" power-of-two.  (Note, though,that dirname()
may alter "name", so we'd have to first make a copy and then free it.)

[config info below is irrelvant]

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=library
    severity=low
    module=GDBM_File
---
Site configuration information for perl 5.18.0:

Configured by doughera at Mon May 13 07:10:40 EDT 2013.

Summary of my perl5 (revision 5 version 18 subversion 0) configuration:
   
  Platform:
    osname=linux, osvers=3.2.0-4-amd64, archname=x86_64-linux
    uname='linux xxx 3.2.0-4-amd64 #1 smp debian 3.2.41-2 x86_64 gnulinux '
    config_args='-Dprefix=/opt/perl -Dscriptdir=/opt/perl/bin -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=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.7.2', 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='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.13'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'

Locally applied patches:
    RC2

---
@INC for perl 5.18.0:
    /opt/perl/lib/site_perl/5.18.0/x86_64-linux
    /opt/perl/lib/site_perl/5.18.0
    /opt/perl/lib/5.18.0/x86_64-linux
    /opt/perl/lib/5.18.0
    /opt/perl/lib/site_perl/5.16.2
    /opt/perl/lib/site_perl/5.16.0
    /opt/perl/lib/site_perl/5.14.2
    /opt/perl/lib/site_perl/5.12.3
    /opt/perl/lib/site_perl/5.10.1
    /opt/perl/lib/site_perl/5.8.9
    /opt/perl/lib/site_perl
    .

---
Environment for perl 5.18.0:
    HOME=/home/doughera
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=en_US.UTF-8
    LD_LIBRARY_PATH=/usr/local/lib
    LOGDIR (unset)
    PATH=/home/doughera/script:/home/doughera/bin:/opt/perl/bin:/opt/dist/bin:/opt/gnuplot/bin:/opt/groff/bin:/usr/local/script:/usr/local/bin:/opt/dist/bin:/bin:/usr/bin:/usr/X11R6/bin:.
    PERL_BADLANG (unset)
    SHELL=/bin/bash




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About