Your message dated Wed, 21 Jul 2010 10:04:38 +0000
with message-id <[email protected]>
and subject line Bug#587912: fixed in nifticlib 2.0.0-1
has caused the Debian Bug report #587912,
regarding libnifti1: incorrect operations with large .nii.gz (zlib issue to be 
address within nifticlib)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
587912: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=587912
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libnifti1
Version: 1.1.0-3.1~debug.1
Severity: normal
Tags: patch

Hi Michael,

I've been cooking it for a bit and unfortunately still dumping it here not
fully cooked.

As you saw, we have got an issue with python-nifti not being able to handle
.nii.gz with large dimensionality [1].

Major issue (bug with casting if fprintf's I will report separately for
clarity):  nifticlib's API does support large data blocks, they rely on size_t
type for len and nmemb in znz(read|write).  But then two sides of the problem:

* zlib's gz(read|write) take len of type 'unsigned', so it cannot handle larger
  data blocks

* well, gcc was complaining about above, so in "COMP:  Explicitly
  typecast" (commit in 2008 after most recent release 1.1.0 you put into
  Debian) gzwrite call got casting done, to make it unsigned for sure.  gzread
  had casting to (int) since 2005

So, I checked with zlib guys either anything could be done on the zlib side,
but because it would break at least ABI, decision was easy -- keep it as is,
and advise providing helpers at the "user"'s level.  Below is the quote for
helpful reply from Mark Adler.  He also mentioned separately that "The code
snippet is donated, but also not tested.".

Please forward this report upstream, so they could address it in the best
manner (without me hacking it up).

Thank you in advance.

On Jun 29, 2010, at 7:18 PM, Yaroslav Halchenko wrote:
> I thought woohoo -- but then looked into the code and saw that
> gzread/gzwrite still have "unsigned" ... so it seems that support for
> large files isn't yet there, or am I mistaken?

Yaroslav,

Indeed, there is support for large files, in that large files can be opened and 
seeked.  The changes were to gzopen, gzseek, and gztell.  Without using LFS, 
you can't even *open* a large file in Linux.

gzread works just peachy on large files as well, but only a piece at a time 
where a piece has to have length that fits in an unsigned int (preferably an 
int, since gzread returns an int).  All that means is that you need
to call gzread multiple times, which is how gzread is normally used.  You can 
write a trivial wrapper function to do a single read operation to a large 
buffer.  Something like:

#define BIG (((unsigned)(-1)>>2)+1)

off_t gzreadbig(gzFile file, void *buf, off_t len)
{
  unsigned n;
  int got;
  off_t tot = 0;

  while (len) {
      n = len > BIG ? BIG : (unsigned)len;
      got = gzread(file, buf, n);         
      if (got < 0)
          return got;
      tot += got;
      len -= got;
      buf += got;
      if (got < (int)n)
          break;
  }
  return tot;
}

Mark




[1] 
http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/2010q2/001168.html


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (901, 'unstable'), (900, 'testing'), (300, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libnifti1 depends on:
ii  libc6                   2.11.1-2         Embedded GNU C Library: Shared lib
ii  zlib1g                  1:1.2.3.5.dfsg-1 compression library - runtime

libnifti1 recommends no packages.

libnifti1 suggests no packages.

-- no debconf information



--- End Message ---
--- Begin Message ---
Source: nifticlib
Source-Version: 2.0.0-1

We believe that the bug you reported is fixed in the latest version of
nifticlib, which is due to be installed in the Debian FTP archive:

libnifti-dev_2.0.0-1_amd64.deb
  to main/n/nifticlib/libnifti-dev_2.0.0-1_amd64.deb
libnifti-doc_2.0.0-1_all.deb
  to main/n/nifticlib/libnifti-doc_2.0.0-1_all.deb
libnifti2_2.0.0-1_amd64.deb
  to main/n/nifticlib/libnifti2_2.0.0-1_amd64.deb
nifti-bin_2.0.0-1_amd64.deb
  to main/n/nifticlib/nifti-bin_2.0.0-1_amd64.deb
nifticlib_2.0.0-1.debian.tar.gz
  to main/n/nifticlib/nifticlib_2.0.0-1.debian.tar.gz
nifticlib_2.0.0-1.dsc
  to main/n/nifticlib/nifticlib_2.0.0-1.dsc
nifticlib_2.0.0.orig.tar.gz
  to main/n/nifticlib/nifticlib_2.0.0.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Hanke <[email protected]> (supplier of updated nifticlib package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 20 Jul 2010 16:12:57 -0400
Source: nifticlib
Binary: libnifti2 libnifti-dev nifti-bin libnifti-doc
Architecture: source amd64 all
Version: 2.0.0-1
Distribution: unstable
Urgency: low
Maintainer: NeuroDebian Team <[email protected]>
Changed-By: Michael Hanke <[email protected]>
Description: 
 libnifti-dev - IO libraries for the NIfTI-1 data format
 libnifti-doc - NIfTI library API documentation
 libnifti2  - IO libraries for the NIfTI-1 data format
 nifti-bin  - tools shipped with the NIfTI library
Closes: 587912
Changes: 
 nifticlib (2.0.0-1) unstable; urgency=low
 .
   * New release. Library changed API, hence bumped SO version to 2.0
     (Closes: #587912).
   * Switch to dpkg-source 3.0 (quilt) format. Split git feature branches into
     quilt patch series.
   * Drop versioned -dev package.
   * Change maintainer to NeuroDebian Team <[email protected]>.
   * Switch from verbose debhelper rules to 'dh'.
   * Removed ECODE patch (merged with upstream).
   * Bumped Standards-version to 3.9.0. Now supports 'nocheck'.
Checksums-Sha1: 
 c575f05922a6d896a668e5261e9fe3afae2bda68 1357 nifticlib_2.0.0-1.dsc
 3a6187cb09767f97cef997cf492d89ac3db211df 258491 nifticlib_2.0.0.orig.tar.gz
 d604d54ceda396e74979521c7fff3864d5a7f68f 11186 nifticlib_2.0.0-1.debian.tar.gz
 7bccd6012126c131d22267305e131a2829df3562 122188 libnifti2_2.0.0-1_amd64.deb
 ce6d1679256b13db3be03315fefaf0890061742e 170942 libnifti-dev_2.0.0-1_amd64.deb
 a2ff579937af2559df9b67d247cb159efdf700a4 62080 nifti-bin_2.0.0-1_amd64.deb
 9f1a221c3f6650703cf97b1470474cb6fec43992 251148 libnifti-doc_2.0.0-1_all.deb
Checksums-Sha256: 
 93aa2d37a977318716bda5b550a886f4ee97903a25de33d6d6222cdf0e5f8748 1357 
nifticlib_2.0.0-1.dsc
 a3e988e6a32ec57833056f6b09f940c69e79829028da121ff2c5c6f7f94a7f88 258491 
nifticlib_2.0.0.orig.tar.gz
 8b6f26a8f8ac7b8a6cbd238918344dcfeb259f308eec2f967b04382514451b88 11186 
nifticlib_2.0.0-1.debian.tar.gz
 f2c65d3a1126b1dbc4d12312ddd059c7ce89c9ce0472930b5462c86202f11732 122188 
libnifti2_2.0.0-1_amd64.deb
 90afce3754c316184381da373db1811faa01fcf066ed8811359d3b40b5cacbba 170942 
libnifti-dev_2.0.0-1_amd64.deb
 ed74114274b905d7a6164b16e6f4e3bb6c815456546bf43236d40ca5dce640bf 62080 
nifti-bin_2.0.0-1_amd64.deb
 3bb0df5574292befca3506bf64698ceea7bd68cf8febb8b353f4fd4c97de6f7e 251148 
libnifti-doc_2.0.0-1_all.deb
Files: 
 32e577801bdf9c77d2a947a3cb9d3a2f 1357 libs optional nifticlib_2.0.0-1.dsc
 425a711f8f92fb1e1f088cbc55bea53a 258491 libs optional 
nifticlib_2.0.0.orig.tar.gz
 d953db649e54e5eac48f2714ffb53cfd 11186 libs optional 
nifticlib_2.0.0-1.debian.tar.gz
 c5b068e933746f2b225625331d532a34 122188 libs optional 
libnifti2_2.0.0-1_amd64.deb
 603cf7781c0fdac530b2190029f28f65 170942 libdevel optional 
libnifti-dev_2.0.0-1_amd64.deb
 e53992d2c0690572184ec12d2e2cf893 62080 utils optional 
nifti-bin_2.0.0-1_amd64.deb
 450be1ae074d19b0b723b5179ccf4ba4 251148 doc optional 
libnifti-doc_2.0.0-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkxGUhwACgkQjRFFY3XAJMjimACeLwywmNvgqQDQyYJjAp/D/9J4
I1oAoJjglKuJ6rLfTj3Ws1Jnv9oY7G+L
=JXGp
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to