apt-mark segfaults when holding an already held package

Bug #1258958 reported by Ken Sharp
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Medium
Unassigned
Precise
Won't Fix
Medium
Unassigned

Bug Description

I'm trying to hold back a package but apt-mark keeps segfaulting.

# apt-mark hold wine1.7 wine1.7-dbg wine1.7-amd64
wine1.7 was already set on hold.
Segmentation fault (core dumped)

dmesg:
traps: apt-mark[505732] general protection ip:404d5f sp:7fff0f4a3330 error:0 in apt-mark[400000+a000]

The hold does seem to be put in place for the first package, but any additional packages have to be held one-by-one due to the fault.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: apt 0.8.16~exp12ubuntu10.16
ProcVersionSignature: Ubuntu 3.8.0-33.48~precise1-generic 3.8.13.11
Uname: Linux 3.8.0-33-generic x86_64
NonfreeKernelModules: wl
ApportVersion: 2.0.1-0ubuntu17.6
Architecture: amd64
Date: Sun Dec 8 19:11:03 2013
InstallationMedia: Ubuntu 12.04.3 LTS "Precise Pangolin" - Release amd64 (20130820.1)
MarkForUpload: True
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ken Sharp (kennybobs) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :

This is trivially reproducable by installing wine and then using the following:

(precise-amd64)root@impulse:/home/bdmurray# apt-mark hold wine1.4
wine1.4 set on hold.
(precise-amd64)root@impulse:/home/bdmurray# apt-mark hold wine1.4
wine1.4 was already set on hold.
Segmentation fault (core dumped)

Changed in apt (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Brian Murray (brian-murray) wrote :

This does not happen on Trusty, so I am setting the bug to Fix Released but will open release tasks as appropriate.

(trusty-amd64)root@impulse:/home/bdmurray# apt-mark hold 2vcard
2vcard set on hold.
(trusty-amd64)root@impulse:/home/bdmurray# apt-mark hold 2vcard
2vcard was already set on hold.

Changed in apt (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

This only affects Precise and does not crash for Q,R,S or T.

Changed in apt (Ubuntu Precise):
importance: Undecided → Medium
status: New → Triaged
summary: - apt-mark keeps segfaulting
+ apt-mark segfaults when holding an already held package
Ken Sharp (kennybobs)
tags: added: i386
Revision history for this message
Martin Tournoij (7-martin) wrote :

This also happens with unhold:

[~]# apt-mark unhold .\*
python2.7-minimal:any was already not hold.
Segmentation fault (core dumped)
Exit 139

[~]# uname -a
Linux martin-xps 3.5.0-41-generic #64somerville8-Ubuntu SMP Wed Oct 2 09:57:33 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

[~]# cat /etc/issue
Ubuntu 12.04.4 LTS \n \l

Revision history for this message
Brian Murray (brian-murray) wrote :

It looks to me like the fix for this may be contained in this diff:

https://bazaar.launchpad.net/~ubuntu-core-dev/apt/ubuntu/revision/1984#cmdline/apt-mark.cc

Particularly the changes around lines 222 to 235 e.g.

for (APT::PackageList::iterator Pkg = pkgset.begin(); Pkg != pkgset.end();)
...

The change may be more obvious in the git branch for apt.

Revision history for this message
Justin Fortier (jfortier) wrote :

Yeah having the same issue here, and it was causing issues with my puppet script to fail because it's not exiting cleanly with a 0/1 exit status. I fixed the puppet script to accept error code 139 which seems to be the error code it exits with.

Revision history for this message
Diego Rodriguez (habaner0) wrote :

I'm getting this issue as well on ubuntu 12.04

uname -a
Linux 3.2.0-69-virtual #103-Ubuntu SMP Tue Sep 2 05:21:29 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in apt (Ubuntu Precise):
status: Triaged → Won't Fix
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.