Bug#923609: Binary incompatibility in libgdbm6

2019-03-10 Thread Sergey Poznyakoff
Hi Dmitry,

> Thank you, Sergey. Does incompatibility goes other way too, that version
> without LFS support is incapable of reading file, created with LFS
> version?

Yes, as the accompanying NOTE-WARNING file says:

 Gdbm files have never been `portable' between different operating
 systems, system architectures, or potentially even different compilers.
 Differences in byte order, the size of file offsets, and even structure
 packing make gdbm files non-portable.

(btw, this file seems not to be included in the Debian package, perhaps
it makes sense to do so).

> I consider providing statically-linked, LFS-disabled version of
> gdbm_{load,dump,tool}, so user with database, created on stretch could
> do `gdbm_dump old.gdbm | gdbm_load new.gdbm'. Opinions?

That's nice idea. I'm all for it.

Best regards,
Sergey



Bug#923609: Binary incompatibility in libgdbm6

2019-03-07 Thread Dmitry Bogatov


[2019-03-05 17:44] Sergey Poznyakoff 
> Hello,
>
> Investigation of the attached file has shown that it has been created
> by gdbm 1.8.3 compiled without large file support (sizeof(off_t) == 4).
> In contrast, gdbm 1.18.1 was compiled with large file support enabled,
> which naturally lead to the observed behavior. Recompile it with the
> --disable-largefile flag and it will be able to read the file.

Thank you, Sergey. Does incompatibility goes other way too, that version
without LFS support is incapable of reading file, created with LFS
version?

I consider providing statically-linked, LFS-disabled version of
gdbm_{load,dump,tool}, so user with database, created on stretch could
do `gdbm_dump old.gdbm | gdbm_load new.gdbm'. Opinions?

Oh, we may need to ask release team, for we are too close to hard-freeze.
-- 
Note, that I send and fetch email in batch, once every 24 hours.
 If matter is urgent, try https://t.me/kaction
 --



Bug#923609: Binary incompatibility in libgdbm6

2019-03-05 Thread Sergey Poznyakoff
Hello,

Investigation of the attached file has shown that it has been created
by gdbm 1.8.3 compiled without large file support (sizeof(off_t) == 4).
In contrast, gdbm 1.18.1 was compiled with large file support enabled,
which naturally lead to the observed behavior. Recompile it with the
--disable-largefile flag and it will be able to read the file.

Regards,
Sergey



Bug#923609: Binary incompatibility in libgdbm6

2019-03-05 Thread Dmitry Bogatov

control: tags -1 +upstream +forwarded

Hello!

Can you please take a look at this Debian bug report [1]. It seems that
compatibility issues we discussed before and which were believed to
resolved in release 1.18.1 actually still present.

Reporter kindly provided receipe to reproduce issue and example of
problematic database.

Thank you for developing gdbm.

 [1] https://bugs.debian.org/923609
-- 
Note, that I send and fetch email in batch, once every 24 hours.
 If matter is urgent, try https://t.me/kaction
 --
--- Begin Message ---
Package: libgdbm6
Version: 1.18.1-3
Severity: serious
Control: block 923238 with -1

GDBM databases created on stretch (gdbm 1.8.3-14) are not
compatible with libgdbm in sid/buster (1.18.1-3) on at least
the i386 (32-bit x86) architecture, probably also armhf.

This means that any local user databases will break on upgrade from
stretch to buster. It also breaks a few Debian packages that use GDBM
files (known affected are libmarc-charset-perl and command-not-found).

Bug #910911 discussed a similar problem that applied to all architectures.
It seems probable that the fix for that never worked on i386 but this
was just not detected earlier. The incompatibility was reported recently
in bug #923238 and was found because Ubuntu has a better architecture
coverage on their autopkgtest setup.

Below are steps to reproduce, testing with Python 2, Python 3, and Perl.
We make a trivial GDBM database with each, containing just one key "foo"
with the value "bar". After upgrading to buster on i386, none of these
databases can be read and "Malformed database file header" is reported.
On amd64, everything works fine after the upgrade.

# start from stretch
# apt install python-gdbm python3-gdbm perl

python - <<'EOF'
import gdbm   
gdbm.open("py2-stretch.gdbm", "c")["foo"] = "bar"
EOF

python3 <<'EOF'
import dbm.gnu
dbm.gnu.open("py3-stretch.gdbm", "c")["foo"] = "bar"
EOF

perl <<'EOF'
use GDBM_File;
tie %h,  q(GDBM_File), "perl-stretch.gdbm", _WRCREAT, 0640
  or die "opening GDBM file failed: $!";
$h{foo} = "bar"
EOF

# ls -l *.gdbm
-rw-r- 1 root root 12294 Mar  2 19:04 perl-stretch.gdbm
-rw-r--r-- 1 root root 12294 Mar  2 19:04 py2-stretch.gdbm
-rw-r--r-- 1 root root 12294 Mar  2 19:04 py3-stretch.gdbm

# upgrade to buster
# sed -i s/stretch/buster/ /etc/apt/sources.list && apt update && apt 
dist-upgrade && apt install gdbmtool

# test with gdbmtool
# gdbmtool py2-stretch.gdbm fetch foo
gdbmtool: stdin:1.1-10: cannot open database py2-stretch.gdbm: Malformed 
database file header
# gdbmtool py3-stretch.gdbm fetch foo
gdbmtool: stdin:1.1-10: cannot open database py3-stretch.gdbm: Malformed 
database file header
# gdbmtool perl-stretch.gdbm fetch foo
gdbmtool: stdin:1.1-10: cannot open database perl-stretch.gdbm: Malformed 
database file header

# similar results with any of these:

perl <<'EOF'
use GDBM_File;
 tie %h,  q(GDBM_File), "perl-stretch.gdbm", _READER, 0640
  or die "opening GDBM file failed: $!";
print $h{foo}, "\n";
EOF

python <<'EOF'
import gdbm
print(gdbm.open("py2-stretch.gdbm", "r")["foo"])
EOF

python3 <<'EOF'
import dbm.gnu 
print(dbm.gnu.open("py3-stretch.gdbm", "r")["foo"])
EOF

-- 
Niko Tyni   nt...@debian.org

--- End Message ---