dpkg coredumps if FIGETBSZ ioctl return -ENOTTY

Bug #872734 reported by Goldhead
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dpkg (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

---
root@localhost:~# strace dpkg -S libc.so.6

...

open("/var/lib/dpkg/info/libtext-wrapi18n-perl.list", O_RDONLY|O_LARGEFILE) = 3
ioctl(3, FIGETBSZ, 0xbfe0463c) = -1 ENOTTY (Inappropriate ioctl for device)
open("/proc/meminfo", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77fb000
read(4, "MemTotal: 262144 kB\nMemF"..., 1024) = 532
close(4) = 0
munmap(0xb77fb000, 4096) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault
---

This may happens on some virtual filesystems because

---
if (!blocksize && ioctl(fd, FIGETBSZ, &blocksize) < 0)
  break;
---

code in src/filesdb.c leave only first pkg->clientdata defined. Seems like continue; should be there.

Please fix.

Tags: patch
Revision history for this message
Konstantin Khlebnikov (khlebnikov) wrote :
Revision history for this message
Konstantin Khlebnikov (khlebnikov) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fix-block-size-ioctl-error-handing.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Raphaël Hertzog (hertzog) wrote :

It seems to me that the proper fix is rather to not try to sort the list of packages if we don't have any meaningful value in listfile_phys_offs... thus the attached patch.

Changed in dpkg (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Raphaël Hertzog (hertzog) wrote :

A fix has been committed upstream, see commit 916bdba9095bd361cb2bccd6f566ecffdb206193.

http://anonscm.debian.org/gitweb/?p=dpkg/dpkg.git;a=commitdiff;h=916bdba9095bd361cb2bccd6f566ecffdb206193

Changed in dpkg (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (13.2 KiB)

This bug was fixed in the package dpkg - 1.16.3ubuntu1

---------------
dpkg (1.16.3ubuntu1) quantal; urgency=low

  * Merge with 1.16.3 from unstable:
    - Change the multiarch downgrade version checks in prerm/postrm
      from 1.16.2 to 1.16.0~ to reflect when multiarch landed in Ubuntu.
    - Migrate dpkg multiarch conffile (and other multi-arch-related
      conf settings) to the new DB with dpkg --add-architecture, but
      keep a copy of the old conffile if it was modified.
    - Out of paranoia, keep an option handler for foreign-architecture
      that informs people that they need to scrub their config files
      and upgrade, on the off chance that the above migration fails
      for some reason (this mitigates the chances of leaving users with
      a dpkg that fails to run due to a broken config).
  * Changes remaining from previous Ubuntu versions:
    - Add DPKG_UNTRANSLATED_MESSAGES environment check so that higher-level
      tools can get untranslated dpkg terminal log messages while at the
      same time having translated debconf prompts. This is useful for tools
      that hide the dpkg terminal by default and use apport for bug
      reporting with the untranslated error message.
    - Build-depend on gettext:any for cross-building support.
    - Apply patch from Steve McIntyre to special-case armhf/armel ELF
      objects in Shlibs/Objdump.pm, so we don't get incorrect deps.

dpkg (1.16.3) unstable; urgency=low

  [ Guillem Jover ]
  * Do not look for newline beyond the read buffer on dpkg-deb extract.
  * Check update-alternative name and link arguments for all commands.
    Closes: #665050
  * Check all dpkg-divert filename arguments to be absolute and to not
    contain newlines. Closes: #21722
  * Print errors while reading the file list files on a new line instead
    of just after the progress percentage. Closes: #552517
  * Document in dpkg-source(1) that patches for source format “3.0 (quilt)”
    are expected to apply without any fuzz. Closes: #666752
    Based on a patch by Luca Capello <email address hidden>.
  * Remove redundant -Wformat-security from default dpkg-buildflags, which
    is already implied by -Werror=format-security. Closes: #664964
    Suggested by Peter Eisentraut <email address hidden>.
  * Document in dpkg-query(1) that commands producing multiple paragraphs
    will preserve the order of the packages specified on the argument list.
  * Change start-stop-daemon --exec on GNU/Hurd, FreeBSD, NetBSD, OpenBSD
    and Solaris to check for executables matching device and inode numbers
    instead of filenames.
  * Change start-stop-daemon --name on GNU/Hurd to check the process' argv[1]
    in addition to argv[0], to handle both binaries and interpreted scripts.
    Reported by Mats Erik Andersson <email address hidden>.
  * Handle deb format versions as major.minor integers instead of strings or
    floats, the latter being susceptible to parsing errors depending on the
    current locale (although this was only affecting the old deb format).
  * Ignore the minor format version number for deb-split format, unifying
    the behaviour with the deb format.
  * Add support for an abitable containin...

Changed in dpkg (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.