tar crashes with SIGSEGV when used with --listed-incremental option and including the root directory

Bug #687594 reported by Marcin Dylewski
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tar (Debian)
Fix Released
Unknown
tar (Ubuntu)
Fix Released
Undecided
Unassigned
Maverick
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: tar

I have a backup script which is doing incremental backups on NFS share. I am using an -g (--listed-incremental) option for that purpose. If the snapshot file does not exists (which means tar is doing full backups) everything works flawlessly. The problem occur whenever incremental backup has to be taken. Tar crashes immediately with Segmentation Fault error. I have tried to isolate NFS issues and copied the snapshot file to local storage and instructed tar to put the archive to local drive as well. The result was exactly the same. The problem occurs whenever the root directory "/" is included in the backup.

TEST CASE:
  $ tar cpf /tmp/test.tar -g /tmp/snap / --exclude="*"
  $ tar cpf /tmp/test.tar -g /tmp/snap / --exclude="*"
  Segmentation fault

After applying the fix in the linked branch, tar no longer segfaults (you have to delete the files in /tmp created with the faulty version before). The patch is taken from this upstream commit:
http://git.savannah.gnu.org/cgit/tar.git/commit/?id=e21d54e8cd3d8026ad56f90cc6bde831106c2cb9

The bug is a regression introduced in Maverick.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: tar 1.23-2
ProcVersionSignature: Ubuntu 2.6.35-22.35-server 2.6.35.4
Uname: Linux 2.6.35-22-server x86_64
Architecture: amd64
Date: Thu Dec 9 00:12:35 2010
InstallationMedia: Ubuntu-Server 10.10 "Maverick Meerkat" - Release amd64 (20101007)
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: tar

== Regression details ==
Discovered in version: 1.23-2
Last known good version: 1.22-2ubuntu1

Revision history for this message
Marcin Dylewski (marcin-dylewski-m) wrote :
Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

Thank you for your bug report. Are you doing a backup which includes the root (i.e. "/") directory?

Changed in tar (Ubuntu):
status: New → Incomplete
Revision history for this message
Marcin Dylewski (marcin-dylewski-m) wrote :

Yes i do. This is the exact command i am using:

tar czpf /mnt/auto/NFS/backup/datasets/srvdb1p-3.tar.gz -g /mnt/auto/NFS/backup/metadata/srvdb1p-snapshot.snar / --exclude=/mnt --exclude=/proc --exclude=/sys --exclude=/dev --exclude=/tmp --exclude=/var/lib/mysql

I can reproduce this bug anytime, thus let me know if any additional info can help and i will be happy to provide that. For now i am attaching output of strace -f. Maybe this will shed some light.

Revision history for this message
Marcin Dylewski (marcin-dylewski-m) wrote :

I have tried to reproduce this bug with newest version of tar (1.25) compiled manually. The result is exactly the same.

Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

The reason I was asking is that there has been a bug reported about "Segfault with --listed-incremental when archive includes root directory" in the debian bug tracker (and reported to the tar developers): http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=575298

However, this issue should be fixed in 1.25. There's a comment in the the mailing list discussion, though (http://old.nabble.com/Re%3A-tar%3A-Segfault-with---listed-incremental-when-archive-includes-root-directory-%28fwd%29-p28597856.html):
> One followup note: With the patch applied, it still segfaulted when doing an
> incremental based on a full backup done with an older version. After doing
> fresh full backups with the patched version, things do work properly.

Could you test whether 1.25 works after a new full backup? If not, please try to provide a stack trace (https://wiki.ubuntu.com/Backtrace).

Revision history for this message
Marcin Dylewski (marcin-dylewski-m) wrote :

Yep, I confirm that 1.25 works fine when i have done the new full backup first.

Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

Ok, thanks for the confirmation. I'm marking the bug as fix released (in the current development edition Natty Narwhal). But add a new task for Maverick. I think this bug qualifies for a stable release update (https://wiki.ubuntu.com/StableReleaseUpdates). Feel free to initiate this process, otherwise I'll try to do this over the weekend.

Changed in tar (Ubuntu):
status: Incomplete → Fix Released
description: updated
summary: - tar crashes with SIGSEGV when used with --listed-incremental option
+ tar crashes with SIGSEGV when used with --listed-incremental option and
+ including the root directory
tags: added: regression-release
Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

Given the positive review of the patch, the bug being a regression and its impact on typical backup scripts -- would someone be willing to upload it to proposed?

Changed in tar (Debian):
status: Unknown → Fix Released
Revision history for this message
Angel Abad (angelabad) wrote :

@Marcel, sponsors are subscribed, so could you prepare a maverick-proposed upload? This package is for main, so I have no permissions, but if you prepare a good upload for proposed securely an Ubuntu main sponsor wil sponsorize your changes. I you cant do please tell me, and I can prepare SRU for main archive.

Thanks for your contributions>

Revision history for this message
Marcel Stimberg (marcelstimberg) wrote :

@Angel, I`m not sure I fully understand: Doesn't linking a branch and proposing it for merging counts as "preparing a maverick-proposed upload"? Or do you need a debdiff? I more or less followed https://wiki.ubuntu.com/Bugs/HowToFix so if there is something missing, maybe this page should be updated.

description: updated
Revision history for this message
Artur Rona (ari-tczew) wrote :

There is nothing to sponsor. Please resubscribe ubuntu-sponsors when patch is ready.

Revision history for this message
Artur Rona (ari-tczew) wrote :

Ah, sorry. There is a bzr branch.

Revision history for this message
Benjamin Drung (bdrung) wrote :

Uploaded tar 1.23-2ubuntu2 to maverick-proposed. I had to wrap the lines in debian/changelog to not exceed 80 characters.

Changed in tar (Ubuntu Maverick):
status: New → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted tar into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Revision history for this message
Fabri Velas (fabrivelas) wrote :

The tar package from maverick-proposed fixes the issue. Thanks.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tar - 1.23-2ubuntu2

---------------
tar (1.23-2ubuntu2) maverick-proposed; urgency=low

  * Fixes segmentation fault when using --list-incremental and including the
    root directory. Backport of upstream commit
    e21d54e8cd3d8026ad56f90cc6bde831106c2cb9. Fixes LP: #687594
 -- Marcel Stimberg <email address hidden> Tue, 25 Jan 2011 21:49:35 +0100

Changed in tar (Ubuntu Maverick):
status: Fix Committed → Fix Released
tags: added: testcase
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.