dpkg segfaults during debootstrap on natty armel
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro GCC |
Fix Released
|
High
|
Chung-Lin Tang | ||
debootstrap (Ubuntu) |
Invalid
|
Undecided
|
Loïc Minier | ||
Natty |
Invalid
|
Undecided
|
Loïc Minier | ||
dpkg (Ubuntu) |
Fix Released
|
High
|
James Hunt | ||
Natty |
Fix Released
|
High
|
James Hunt | ||
gcc-4.5 (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Natty |
Fix Released
|
High
|
Unassigned |
Bug Description
Binary package hint: dpkg
during debootstrap when trying to Install core packages, dpkg dies with a segfault like:
...
I: Extracting util-linux...
I: Extracting xz-utils...
I: Extracting zlib1g...
I: Installing core packages...
W: Failure trying to run: chroot /build/
researching the cause it seems that the Maintainer and Description fields are expected in /var/lib/
it is segfaulting with a status file as created by debootstrap:
Package: dpkg
Version: 1.15.8.5ubuntu1
Status: install ok installed
while the following status file makes it possible to go on with debootstrap calling the necessary commands manually:
Package: dpkg
Essential: yes
Status: install ok installed
Maintainer: bar
Version: 1.15.8.5ubuntu1
Description: foo
Related branches
- Andrew Stubbs (community): Approve
-
Diff: 87 lines (+24/-6)4 files modifiedChangeLog.linaro (+14/-0)
gcc/cfgexpand.c (+8/-4)
gcc/ipa-inline.c (+1/-1)
gcc/tree-inline.h (+1/-1)
Changed in dpkg (Ubuntu): | |
importance: | Undecided → High |
Changed in dpkg (Ubuntu Natty): | |
milestone: | none → natty-alpha-1 |
Changed in dpkg (Ubuntu Natty): | |
assignee: | nobody → James Hunt (jamesodhunt) |
status: | New → Triaged |
Changed in debootstrap (Ubuntu Natty): | |
assignee: | nobody → Loïc Minier (lool) |
Changed in dpkg (Ubuntu Natty): | |
status: | Triaged → In Progress |
tags: | added: patch |
Changed in gcc-4.5 (Ubuntu Natty): | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in gcc-linaro: | |
assignee: | nobody → Chung-Lin Tang (cltang) |
Changed in gcc-linaro: | |
status: | Triaged → In Progress |
Changed in gcc-linaro: | |
milestone: | none → 4.5-2010.12-0 |
status: | In Progress → Fix Committed |
Changed in gcc-linaro: | |
status: | Fix Committed → Fix Released |
There do appear to be potentially 2 problems here:
1) the issue whereby /var/lib/ dpkg/status is somehow truncated
"dpkg-query -l" indeed expects to find the following fields for a package as a minimum:
name, description, maintainer, version, status (required to actually get any output from "dpkg -l")
2) "dpkg-query -l" is segfaulting when given the invalid "status" file
The code detects the problem but rather than issuing an error message, it gets a SIGSEGV. What we expect to see from "dpkg -l" under the conditions in (1) is:
warning, in file '/var/lib/ dpkg/status' near line 3 package 'dpkg': dpkg/status' near line 3 package 'dpkg': Unknown/ Install/ Remove/ Purge/Hold Not/Inst/ Conf-files/ Unpacked/ halF-conf/ Half-inst/ trig-aWait/ Trig-pend /Reinst- required (Status,Err: uppercase=bad) ======= ======= ======= =====-= ======= ======= ======= ======= -====== ======= ======= ======= ======= ======= ======= ======= ======= ======= =====
missing description
warning, in file '/var/lib/
missing maintainer
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Description
+++-===
ii dpkg 1.15.8.5ubuntu1
______
I've looked at (2) first: the problem is observed when va_end() is called in lib/dpkg/ parsehelp. c:parse_ warn(). Call hierarchy is: have_field( ) -> parse_warn(). Once the function returns (just after calling va_end()), the stack has been trashed. valgrind is alas no help here as it fails on armel ("valgrind: the 'impossible' happened" [bug to be raised]).
modstatdb_init() -> parsedb() -> parse_ensure_