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

Andy Dougherty
September 5, 2013 13:47
[perl #119623] GDBM_FILE: gdbm_open requires a blocksize to be a power of two
Message ID:
# New Ticket Created by  Andy Dougherty 
# Please include the string:  [perl #119623]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
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]
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:
    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
    cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    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
  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:

@INC for perl 5.18.0:

Environment for perl 5.18.0:
    LANG (unset)
    LANGUAGE (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)
    SHELL=/bin/bash Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About