dpkg truncates lines in 'status' file which begin with two spaces.

Bug #1611133 reported by Dragan S.
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dpkg (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

On Ubuntu 12.04.5 LTS command dpkg version 1.16.1.2ubuntu7.7 seems to experience issues when updating packages.

In one instance the status file seems to have over a thousand lines that have been truncated. It only seems to truncate package comments that are indented with two spaces. No indent or single space indent lines are all fine but lines that have a double space get truncated. They are not gone in the file they are just replaced by a line that has two spaces and a new line.

Programmatically I would describe the problem as in perhaps a failure in reading the comment from the source and writing an empty string into the target:

Comment = read_comment(next_line);

fprintf(Status, " %s\n", Comment);

So if there was an error in read_comment and function returned an empty string "", this would explain why some lines were getting truncated.

Dragan S. (dragan-s)
tags: added: dpkg precise ubuntu
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Do you have dpkg status files that you can share, both good and bad?

What do you mean by Package comments -> do you mean Description: field?

Looking at my /var/lib/dpkg/status as well as automatic backups in /var/backups/dpkg.status.* I don't see a single package with a Comment: field.

Do you have sample .deb packages, which result in truncation post install?

https://www.debian.org/doc/debian-policy/ch-controlfields.html mentions Comment: field, however, as an example of user-defined / custom fields, which would not be standards compliant / shouldn't be part of any Ubuntu package.

Revision history for this message
Dragan S. (dragan-s) wrote :

Hi Dimitri-

yes my mistake, I meant Description field. I will upload the good and the bad files momentarily...

Revision history for this message
Dragan S. (dragan-s) wrote :
Revision history for this message
Dragan S. (dragan-s) wrote :
tags: added: sts
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

The diff between good and bad looks very bad.

Louis Bouchard (louis)
Changed in dpkg (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Louis Bouchard (louis-bouchard)
Revision history for this message
Louis Bouchard (louis) wrote :

turns out that the issue was caused by an external script which modified the status file.

Changed in dpkg (Ubuntu):
status: Confirmed → Invalid
assignee: Louis Bouchard (louis-bouchard) → nobody
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.