Navigation Menu

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

Bug in cpan/DB_File/t/db-hash.t (5.28 RC-2) #16588

Open
p5pRT opened this issue Jun 14, 2018 · 11 comments
Open

Bug in cpan/DB_File/t/db-hash.t (5.28 RC-2) #16588

p5pRT opened this issue Jun 14, 2018 · 11 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 14, 2018

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

Searchable as RT133280$

@p5pRT
Copy link
Author

p5pRT commented Jun 14, 2018

From @Abigail

Created by @Abigail

When trying to build perl from git on a new laptop, I get test
failures in cpan/DB_File/t/db-hash.t​:

The test output contained a few lines with a few million NULs -- they
have been replaced (otherwise, perlbug would not accept the report).

  Use of uninitialized value $value in string eq at cpan/DB_File/t/db=
-hash.t line 224.
  Use of uninitialized value $values[0] in string eq at cpan/DB_File/=
t/db-hash.t line 224.
  Use of uninitialized value $value in lc at cpan/DB_File/t/db-hash.t=
line 224.
  Use of uninitialized value $h{""} in string eq at cpan/DB_File/t/db=
-hash.t line 243.
  Use of uninitialized value in numeric eq (=3D=3D) at cpan/DB_File/t=
/db-hash.t line 252.
  Use of uninitialized value in numeric eq (=3D=3D) at cpan/DB_File/t=
/db-hash.t line 252.
  Use of uninitialized value in numeric eq (=3D=3D) at cpan/DB_File/t=
/db-hash.t line 252.
  Use of uninitialized value in numeric eq (=3D=3D) at cpan/DB_File/t=
/db-hash.t line 252.
  Use of uninitialized value in numeric eq (=3D=3D) at cpan/DB_File/t=
/db-hash.t line 252.
  Use of uninitialized value in numeric eq (=3D=3D) at cpan/DB_File/t=
/db-hash.t line 252.
  Use of uninitialized value in numeric eq (=3D=3D) at cpan/DB_File/t=
/db-hash.t line 252.
  Use of uninitialized value in numeric eq (=3D=3D) at cpan/DB_File/t=
/db-hash.t line 252.
  Use of uninitialized value $foo[18] in join or string at cpan/DB_Fi=
le/t/db-hash.t line 261.
  Use of uninitialized value $foo[36] in join or string at cpan/DB_Fi=
le/t/db-hash.t line 261.
  Use of uninitialized value $foo[48] in join or string at cpan/DB_Fi=
le/t/db-hash.t line 261.
  Use of uninitialized value $foo[58] in join or string at cpan/DB_Fi=
le/t/db-hash.t line 261.
  Use of uninitialized value $foo[59] in join or string at cpan/DB_Fi=
le/t/db-hash.t line 261.
  Use of uninitialized value $foo[60] in join or string at cpan/DB_Fi=
le/t/db-hash.t line 261.
  Use of uninitialized value $foo[62] in join or string at cpan/DB_Fi=
le/t/db-hash.t line 261.
  Use of uninitialized value $foo[63] in join or string at cpan/DB_Fi=
le/t/db-hash.t line 261.
  Use of uninitialized value $foo[92] in join or string at cpan/DB_Fi=
le/t/db-hash.t line 261.
  Use of uninitialized value $foo[114] in join or string at cpan/DB_F=
ile/t/db-hash.t line 261.
  Use of uninitialized value $foo[140] in join or string at cpan/DB_F=
ile/t/db-hash.t line 261.
  Use of uninitialized value $foo[187] in join or string at cpan/DB_F=
ile/t/db-hash.t line 261.
  Use of uninitialized value $foo[188] in join or string at cpan/DB_F=
ile/t/db-hash.t line 261.
  Use of uninitialized value $foo[189] in join or string at cpan/DB_F=
ile/t/db-hash.t line 261.
  1..166
  ok 1
  ok 2
  ok 3
  ok 4
  ok 5
  ok 6
  ok 7
  ok 8
  ok 9
  ok 10
  ok 11
  ok 12
  ok 13
  ok 14
  ok 15
  ok 16
  ok 17
  ok 18
  ok 19
  ok 20
  ok 21
  ok 22
  not ok 23
  not ok 24
  not ok 25
  ok 26
  not ok 27
  not ok 28
  ok 29
  not ok 30
  ok 31
  ok 32
  ok 33
  ok 34
  ok 35
  ok 36
  not ok 37
  ok 38
  ok 39
  ok 40
  ok 41
  ok 42
  ok 43
  ok 44
  not ok 45
  not ok 46
  ok 47
  ok 48
  ok 49
  ok 50
  ok 51
  ok 52
  ok 53
  ok 54
  ok 55
  ok 56
  ok 57
  ok 58
  ok 59
  ok 60
  ok 61
  ok 62
  ok 63
  ok 64
  ok 65
  ok 66
  ok 67
  not ok 68
  ok 69
  # Fetch Key : expected 'fred' got 'fred <4128275 NULs deleted>Use=
of uninitialized value $h{"Fred"} in string eq at cpan/DB_File/t/db-hash.t=
line 572.
  =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00'
  not ok 70
  ok 71
  not ok 72
  # Fetch Value : expected '[Jxe]' got ''
  not ok 73
  not ok 74
  not ok 75
  # k [Fred]
  not ok 76
  # Fetch Key : expected 'FRED' got ''
  # Fetch Value : expected '[Jxe]' got ''
  not ok 77
  ok 78
  ok 79
  ok 80
  ok 81
  not ok 82
  ok 83
  # Fetch Key : expected 'fred' got 'fred <4127986 NULs deleted>Use=
of uninitialized value $v in concatenation (.) or string at cpan/DB_File/t=
/db-hash.t line 748.
  =00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=00=
=00=00=00=00=00=00=00=00=00=00'
  not ok 84
  ok 85
  not ok 86
  ok 87
  ok 88
  not ok 89
  not ok 90
  ok 91
  ok 92
  ok 93
  ok 94
  ok 95
  ok 96
  ok 97
  not ok 98
  ok 99
  ok 100
  not ok 101
  ok 102
  ok 103
  ok 104
  ok 105
  not ok 106
  ok 107
  ok 108
  ok 109
  ok 110
  ok 111
  not ok 112
  ok 113
  ok 114
  ok 115
  ok 116

Perl Info

Flags:
    category=3Dlibrary
    severity=3Dmedium

Site configuration information for perl 5.28.0:

Configured by abigail at Thu Jun 14 15:11:09 CEST 2018.

Summary of my perl5 (revision 5 version 28 subversion 0) configuration:
  Commit id: 197e7984e9f640254af80f8553707bad217f3814
  Platform:
    osname=3Ddarwin
    osvers=3D17.6.0
    archname=3Ddarwin-2level
    uname=3D'darwin aurora.fritz.box 17.6.0 darwin kernel version 17.6.0: t=
ue may 8 15:22:16 pdt 2018; root:xnu-4570.61.1~1release_x86_64 x86_64 '
    config_args=3D'-des -Uusedevel'
    hint=3Drecommended
    useposix=3Dtrue
    d_sigaction=3Ddefine
    useithreads=3Dundef
    usemultiplicity=3Dundef
    use64bitint=3Ddefine
    use64bitall=3Ddefine
    uselongdouble=3Dundef
    usemymalloc=3Dn
    default_inc_excludes_dot=3Ddefine
    bincompat5005=3Dundef
  Compiler:
    cc=3D'cc'
    ccflags =3D'-fno-common -DPERL_DARWIN -mmacosx-version-min=3D10.13 -fno=
-strict-aliasing -pipe -fstack-protector-strong -I/opt/local/include -DPERL=
_USE_SAFE_PUTENV'
    optimize=3D'-O3'
    cppflags=3D'-fno-common -DPERL_DARWIN -mmacosx-version-min=3D10.13 -fno=
-strict-aliasing -pipe -fstack-protector-strong -I/opt/local/include'
    ccversion=3D''
    gccversion=3D'4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)'
    gccosandvers=3D''
    intsize=3D4
    longsize=3D8
    ptrsize=3D8
    doublesize=3D8
    byteorder=3D12345678
    doublekind=3D3
    d_longlong=3Ddefine
    longlongsize=3D8
    d_longdbl=3Ddefine
    longdblsize=3D16
    longdblkind=3D3
    ivtype=3D'long'
    ivsize=3D8
    nvtype=3D'double'
    nvsize=3D8
    Off_t=3D'off_t'
    lseeksize=3D8
    alignbytes=3D8
    prototype=3Ddefine
  Linker and Libraries:
    ld=3D'cc'
    ldflags =3D' -mmacosx-version-min=3D10.13 -fstack-protector-strong -L/o=
pt/local/lib'
    libpth=3D/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDef=
ault.xctoolchain/usr/lib/clang/9.1.0/lib /Applications/Xcode.app/Contents/D=
eveloper/Toolchains/XcodeDefault.xctoolchain/usr/lib /usr/lib /opt/local/lib
    libs=3D-lpthread -ldbm -ldl -lm -lutil -lc
    perllibs=3D-lpthread -ldl -lm -lutil -lc
    libc=3D
    so=3Ddylib
    useshrplib=3Dfalse
    libperl=3Dlibperl.a
    gnulibc_version=3D''
  Dynamic Linking:
    dlsrc=3Ddl_dlopen.xs
    dlext=3Dbundle
    d_dlsymun=3Dundef
    ccdlflags=3D' '
    cccdlflags=3D' '
    lddlflags=3D' -mmacosx-version-min=3D10.13 -bundle -undefined dynamic_l=
ookup -L/opt/local/lib -fstack-protector-strong'



@INC for perl 5.28.0:
    lib
    /Users/abigail/Perl/CPAN/Regexp-Common2/lib
    /Users/abigail/Perl/CPAN/Test-Regexp/lib
    /Users/abigail/Perl/CPAN/Puzzle-Stuff/lib
    /usr/local/lib/perl5/site_perl/5.28.0/darwin-2level
    /usr/local/lib/perl5/site_perl/5.28.0
    /usr/local/lib/perl5/5.28.0/darwin-2level
    /usr/local/lib/perl5/5.28.0


Environment for perl 5.28.0:
    DYLD_LIBRARY_PATH (unset)
    HOME=3D/Users/abigail
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=3DUTF-8
    LD_LIBRARY_PATH=3D/Users/abigail/Lib:/usr/local/lib:/usr/lib:/lib:/usr/=
X11R6/lib
    LOGDIR (unset)
    PATH=3D/Users/abigail/Bin:/opt/perl/current/bin:/opt/local/bin:/usr/loc=
al/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/ga=
mes:/opt/git/bin:/Users/abigail/Perl/Photos:/Users/abigail/Perl/Bin:/opt/my=
sql/bin:/opt/local/bin:/Users/abigail/bin
    PERL5LIB=3D/Users/abigail/Perl/CPAN/Regexp-Common2/lib:/Users/abigail/P=
erl/CPAN/Test-Regexp/lib:/Users/abigail/Perl/CPAN/Puzzle-Stuff/lib
    PERLDIR=3D/opt/perl/current
    PERL_BADLANG (unset)
    SHELL=3D/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Jun 16, 2018

From @pmqs

On Thu, 14 Jun 2018 07​:13​:49 -0700, abigail@​abigail.be wrote​:

This is a bug report for perl from abigail@​abigail.be,
generated with the help of perlbug 1.41 running under perl 5.28.0.

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

When trying to build perl from git on a new laptop, I get test
failures in cpan/DB_File/t/db-hash.t​:

The test output contained a few lines with a few million NULs -- they
have been replaced (otherwise, perlbug would not accept the report).
...

This appears to be a duplicate of https://rt.cpan.org/Ticket/Display.html?id=125238.

That report suggests that the BerkelyDB library in MacOS is in a place that DB_File hasn't been configured to use. In the section "Let's make libdb work" from #125238, it says that the BerkeleyDB library is installed in /opt/local/lib/db48.

If that is the case here, edit the config.in file for DB_File and set

INCLUDE = /opt/local/include/db48
LIB = /opt/local/lib/db48

the rebuild & test DB_File.

Alternatively set the environment variables DB_FILE_INCLUDE to /opt/local/include/db48 and DB_FILE_LIB to /opt/local/lib/db48, the rebuild & test DB_File.

If this works, I'll add a note to the Troubleshooting section in the README

cheers
Paul

@p5pRT
Copy link
Author

p5pRT commented Jun 16, 2018

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

@p5pRT
Copy link
Author

p5pRT commented Jun 17, 2018

From @Abigail

On Sat, Jun 16, 2018 at 03​:50​:59PM -0700, Paul Marquess via RT wrote​:

On Thu, 14 Jun 2018 07​:13​:49 -0700, abigail@​abigail.be wrote​:

This is a bug report for perl from abigail@​abigail.be,
generated with the help of perlbug 1.41 running under perl 5.28.0.

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

When trying to build perl from git on a new laptop, I get test
failures in cpan/DB_File/t/db-hash.t​:

The test output contained a few lines with a few million NULs -- they
have been replaced (otherwise, perlbug would not accept the report).
...

This appears to be a duplicate of https://rt.cpan.org/Ticket/Display.html?id=125238.

That report suggests that the BerkelyDB library in MacOS is in a place that DB_File hasn't been configured to use. In the section "Let's make libdb work" from #125238, it says that the BerkeleyDB library is installed in /opt/local/lib/db48.

If that is the case here, edit the config.in file for DB_File and set

INCLUDE = /opt/local/include/db48
LIB = /opt/local/lib/db48

the rebuild & test DB_File.

Alternatively set the environment variables DB_FILE_INCLUDE to /opt/local/include/db48 and DB_FILE_LIB to /opt/local/lib/db48, the rebuild & test DB_File.

If this works, I'll add a note to the Troubleshooting section in the README

That seems to do the trick.

Thanks,

Abigail

@p5pRT
Copy link
Author

p5pRT commented Jun 17, 2018

From @pmqs

Do you know if MacOS ships with the Berkeley DB include file, db.h? Otherwise DB_File.xs wouldn’t compile at all.

Seems strange to have that include file, but not the library.

@p5pRT
Copy link
Author

p5pRT commented Jun 17, 2018

From @pmqs

On Sun, 17 Jun 2018 01​:31​:15 -0700, pmqs wrote​:

Do you know if MacOS ships with the Berkeley DB include file, db.h?
Otherwise DB_File.xs wouldn’t compile at all.

Seems strange to have that include file, but not the library.

Actually – looking at your bug report again, most of the DB_File test harness passed. That means there needs to be a version of the Berkeley DB library available.

If you get a chance, could you see what this gives you when run in the DB_File source directory after you’ve run “make test” (without setting any of the INCLUDE/LIB variables to point to /opt/local/lib/db48)

  perl -Mblib -MDB_File -e 'print qq{Built with Berkeley DB ver $DB_File​::db_ver\n}'
  perl -Mblib -MDB_File -e 'print qq{Running with Berkeley DB ver $DB_File​::db_version\n}'

thanks
Paul

@p5pRT
Copy link
Author

p5pRT commented Jun 17, 2018

From @Abigail

On Sun, Jun 17, 2018 at 01​:43​:53AM -0700, Paul Marquess via RT wrote​:

On Sun, 17 Jun 2018 01​:31​:15 -0700, pmqs wrote​:

Do you know if MacOS ships with the Berkeley DB include file, db.h?
Otherwise DB_File.xs wouldn’t compile at all.

Seems strange to have that include file, but not the library.

Actually – looking at your bug report again, most of the DB_File test harness passed. That means there needs to be a version of the Berkeley DB library available.

If you get a chance, could you see what this gives you when run in the DB_File source directory after you’ve run “make test” (without setting any of the INCLUDE/LIB variables to point to /opt/local/lib/db48)

   perl \-Mblib \-MDB\_File \-e 'print qq\{Built with Berkeley DB ver $DB\_File&#8203;::db\_ver\\n\}'
   perl  \-Mblib \-MDB\_File \-e 'print qq\{Running with Berkeley DB ver $DB\_File&#8203;::db\_version\\n\}'

  $ cd cpan/DB_File
  $ ../../perl -I../../lib -Iblib -MDB_File -E 'say "Built with Berkeley DB ver $DB_File​::db_ver"'
Built with Berkeley DB ver 1
  $ ../../perl -I../../lib -Iblib -MDB_File -E 'say "Built with Berkeley DB version $DB_File​::db_version"'
Built with Berkeley DB version 1

Regards,

Abigail

@p5pRT
Copy link
Author

p5pRT commented Jun 17, 2018

From @pmqs

If you get a chance, could you see what this gives you when run in the DB_File source directory after you’ve run “make test” (without setting any of the INCLUDE/LIB variables to point to /opt/local/lib/db48)

   perl \-Mblib \-MDB\_File \-e 'print qq\{Built with Berkeley DB ver $DB\_File&#8203;::db\_ver\\n\}'
   perl  \-Mblib \-MDB\_File \-e 'print qq\{Running with Berkeley DB ver $DB\_File&#8203;::db\_version\\n\}'

$ cd cpan/DB_File
$ ../../perl -I../../lib -Iblib -MDB_File -E 'say "Built with Berkeley DB ver $DB_File​::db_ver"'
Built with Berkeley DB ver 1
$ ../../perl -I../../lib -Iblib -MDB_File -E 'say "Built with Berkeley DB version $DB_File​::db_version"'
Built with Berkeley DB version 1

Version 1 ! Now I'm confused.

Running that test without messing with DB_File INCLUDE/LIB variables implies there already is a copy of the original version 1 Berkeley DB library (the one that DB_File was originally written for) on MacOS.

Why it is failing only one of the test is weird. Need to think about what to do nest.

thanks
Paul

@p5pRT
Copy link
Author

p5pRT commented Jun 21, 2018

From @craigberry

On Sun, Jun 17, 2018 at 2​:43 PM, paul.marquess via perl5-porters
<perl5-porters@​perl.org> wrote​:

If you get a chance, could you see what this gives you when run in the DB_File source directory after you’ve run “make test” (without setting any of the INCLUDE/LIB variables to point to /opt/local/lib/db48)

   perl \-Mblib \-MDB\_File \-e 'print qq\{Built with Berkeley DB ver $DB\_File&#8203;::db\_ver\\n\}'
   perl  \-Mblib \-MDB\_File \-e 'print qq\{Running with Berkeley DB ver $DB\_File&#8203;::db\_version\\n\}'

$ cd cpan/DB_File
$ ../../perl -I../../lib -Iblib -MDB_File -E 'say "Built with Berkeley DB ver $DB_File​::db_ver"'
Built with Berkeley DB ver 1
$ ../../perl -I../../lib -Iblib -MDB_File -E 'say "Built with Berkeley DB version $DB_File​::db_version"'
Built with Berkeley DB version 1

Version 1 ! Now I'm confused.

Running that test without messing with DB_File INCLUDE/LIB variables implies there already is a copy of the original version 1 Berkeley DB library (the one that DB_File was originally written for) on MacOS.

Why it is failing only one of the test is weird. Need to think about what to do nest.

I get the same thing, but after "brew install berkeley-db" get​:

$ cd cpan/DB_File
$ ../../perl -I../../lib -Iblib -MDB_File -E 'say "Built with Berkeley
DB ver $DB_File​::db_ver"'
Built with Berkeley DB ver 6.002032
$ ../../perl -I../../lib -Iblib -MDB_File -E 'say "Built with
Berkeley DB version $DB_File​::db_version"'
Built with Berkeley DB version 6.2

and all tests passing, so that is a workaround for people who need
DB​::File working.

Now back to the default situation. Apparently Berkeley DB is present
on macOS High Sierra but is located in libSystem.B.dylib rather than
in its own library​:

<https://discussions.apple.com/thread/8125401>

and it's buggy. Not sure how to work around that.

@p5pRT
Copy link
Author

p5pRT commented Jun 21, 2018

From @craigberry

On Thu, Jun 21, 2018 at 7​:59 AM, Craig A. Berry <craig.a.berry@​gmail.com> wrote​:

Now back to the default situation. Apparently Berkeley DB is present
on macOS High Sierra but is located in libSystem.B.dylib rather than
in its own library​:

<https://discussions.apple.com/thread/8125401>

and it's buggy. Not sure how to work around that.

Actually, the Berkeley v1 functions appear to be in libsystem_c​:

$ nm /usr/lib/system/libsystem_c.dylib | egrep
'dbpanic|dbopen|bt_open|hash_open|rec_open|dbpanic'
00000000000142d8 T ___bt_open
0000000000016eab T ___dbpanic
0000000000016ee4 T ___hash_open
000000000001bbd0 T ___rec_open
0000000000016e39 T _dbopen

and the /usr/include/db.h appears to be consistent with that (ancient
BSD license with no mention of Sleepycat or Oracle). Apple includes
much later versions of Berkeley DB in its open source listings​:

<https://opensource.apple.com/source/BerkeleyDB/>

but where that gets installed (or if it does) is something I have not
managed to figure out. It may only be used as part of some other
package.

Where things go obviously wrong with the db-hash.t test is right here​:

# tie to the same file again, do not supply a type - should default to HASH
ok(22, $X = tie(%h,'DB_File',$Dfile, O_RDWR, 0640) );

Right before this %h is empty, and right after it, %h has 10 entries.
The keys are each 4128769 bytes long consisting mostly or entirely of
NULs (hard to tell with the debugger) and the values are undef. But
there is probably something wrong before that as the file referenced
by $Dfile is over 200MB​:

$ ls -l dbhash.tmp
-rw-r----- 1 craig staff 205520896 Jun 21 17​:31 dbhash.tmp

That zips down to about 200K, but that's still a bit big to attach here.

I don't know if or when I'll be able to debug this further.

@p5pRT
Copy link
Author

p5pRT commented Jul 13, 2018

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

No branches or pull requests

2 participants