Please sync fatsort 0.9.8.3-1 (universe) from Debian unstable (main)

Bug #128517 reported by Martin Gustafsson
12
Affects Status Importance Assigned to Milestone
fatsort (Debian)
Fix Released
Unknown
fatsort (Fedora)
Fix Released
Medium
fatsort (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: fatsort

When trying to sort the files/directories in of a iriver T60, fatsort aborts with the following output:

$ fatsort /dev/sda
FATSort Utility 0.9.7 by Boris Leidner <fatsort(at)formenos.de>

File system: FAT32.

Sorting directory /
Sorting directory /MYPODDER/
Sorting directory /MYPODDER/DATA/
Sorting directory /MYPODDER/DATA/PICCACHE/
Sorting directory /MYPODDER/PICTURES/
Sorting directory /MYPODDER/PICTURES/PICTURES/
Sorting directory /MYPODDER/properties/
Sorting directory /Music/
Sorting directory /Music/Cassie/
writeClusterChain: Seek error!
sortClusterChain: Failed to write cluster chain!
sortClusterChain: Failed to sort cluster chain!
sortClusterChain: Failed to sort cluster chain!
sort_fs: Failed to sort cluster chain!
main: Failed to sort file system!

Revision history for this message
Stephan Rave (info-stephanrave) wrote :

I can confirm this. Probably a T60 specific thing?

Revision history for this message
Minsang Kim (minsangkim) wrote :

I can confirm this.
I don't even get any "sorting directory" messages..
it just goes into ClusterChain: seek error!

I'm using MPIO Solid HD400, so I guess it's not really irivers that have problem.

Revision history for this message
Minsang Kim (minsangkim) wrote :

sudo fatsort /dev/sdb
FATSort Utility 0.9.7.1 by Boris Leidner <fatsort(at)formenos.de>

File system: FAT32.

Sorting directory /
Sorting directory /Files/
writeClusterChain: Seek error!
sortClusterChain: Failed to write cluster chain!
sortClusterChain: Failed to sort cluster chain!
sort_fs: Failed to sort cluster chain!
main: Failed to sort file system!

thats' what I get.. I was wrong in the previous comment.

Revision history for this message
Sebastian Dröge (slomo) wrote :

Could you try running

fsck.vfat

on the devices? Are there any errors reported?

Revision history for this message
Minsang Kim (minsangkim) wrote :

No error on the filesystem, but of course, error would cause the program to terminate.

I found out that the program doesn't support unicode filenames, so not a bug but a lack of feature.
The program terminates with "failed to write..." message when it encounters non-latin directory or filename.

The only option to sort files in FAT is to use foldersort, which is a Windows application.
I have tried some programs online, but they won't compile.

Revision history for this message
In , Mike (mike-redhat-bugs) wrote :

Description of problem:
fatsort crash with error

 Version-Release number of selected component (if applicable):
fatsort-0.9.8.2-1.fc8

 How reproducible:
fatsort -f /dev/sdb1

 Actual results:
writeClusterChain: Seek error!
sortClusterChain: Failed to write cluster chain!
sortClusterChain: Failed to sort cluster chain!
sort_fs: Failed to sort cluster chain!
main: Failed to sort file system!

 Additional info:
'fsck.vfat /dev/sdb1' passess without any error.
There is no autofs/hald/messagebus.
Device is mounted by fstab line:
LABEL=MP3-1234 /home/mike/usb2 auto
rw,nosuid,nodev,noexec,noauto,user,uid=mike,gid=mike,umask=0077

When I get fatsort-0.9.8.2.tar.gz source and build it locally fatsort works fine.
Strange it is, because according to fatsort.spec there are no patches nor any
additional options for build.

Without '-f' flag there is additional error (not important for me):
 check_mounted: Unable to get realpath!
 sort_fs: Could not check if filesystem is mounted!
 main: Failed to sort file system!

Similar problem in ubuntu:
https://bugs.launchpad.net/ubuntu/+source/fatsort/+bug/128517

Revision history for this message
In , Till (till-redhat-bugs) wrote :

Can you please run:
rpm --verify fatsort

If the output is empty, maybe it helps when you provide a backtrace:

1) debuginfo-install fatsort
2) # gdb fatsort
3) (gdb) run -f /dev/sdb1
notice crash
4) (gdb) bt
Then post the output here, but before you do this, make sure, that it does not
contain any private information.

I notified upstream about this bug, but I was not able to reproduce it.

Revision history for this message
In , Mike (mike-redhat-bugs) wrote :

Empty output from 'rpm --verify fatsort'

(gdb) run -f /dev/sdb1
Starting program: /usr/sbin/fatsort -f /dev/sdb1
FATSort Utility 0.9.8.2 by Boris Leidner <fatsort(at)formenos.de>

File system: FAT32.

Sorting directory /
Sorting directory /-The_Offspring_-_Rise_and_Fall_Rage_and_Grace_2008.4233795.TPB/
writeClusterChain: Seek error!
sortClusterChain: Failed to write cluster chain!
sortClusterChain: Failed to sort cluster chain!
sort_fs: Failed to sort cluster chain!
main: Failed to sort file system!

Program exited with code 0377.
(gdb) bt
No stack.
(gdb)

looks like a dead end :(

On Ubuntu forum someone said that it might be related to locales.

$ locale
LANG=
LC_CTYPE=pl_PL
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

I'm working in above environment.

Revision history for this message
In , Mike (mike-redhat-bugs) wrote :

I'm trying to narrow problem.

Rpm build from this file won't work - same problem:
5e36a0d45cb06f80bb9ac6c9034230f1 fatsort-0.9.8.2-1.fc8.src.rpm

line from build by 'make':
gcc -g -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c fatsort.c -o fatsort.o

line from build by 'rpmbuild -bb fatsort.spec':
gcc -O2 -g -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -c
fatsort.c -o fatsort.o

This pendrive (mp3) is almost 4GB (without 40MB for firmware).

$ diff -u fatsort.spec-orig fatsort.spec
--- fatsort.spec-orig 2008-07-07 00:22:44.000000000 +0200
+++ fatsort.spec 2008-07-07 00:23:11.000000000 +0200
@@ -21,7 +21,7 @@

 %build
-make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_OPT_FLAGS"
+make %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64" LDFLAGS="$RPM_OPT_FLAGS"

 %install

problem "solved", but I don't know about "proper" state, need confirmation from
upstream

btw, is there anything we can do about '-f'?
 check_mounted: Unable to get realpath!
 sort_fs: Could not check if filesystem is mounted!
 main: Failed to sort file system!

Revision history for this message
In , Till (till-redhat-bugs) wrote :

Yeah, the backtrace was actually not a good idea, because fatsort did not really
crash but exited cleanly. I located the bug, the CFLAGS get completely
overwritten when they are specified on the make commandline,
"-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" need to be set. I will push fixed
packages, soon.

About the "-f", I guess this is needed because you do not have an entry for
/dev/sdb1 in /etc/fstab, there is only one with the label. Therefore fatsort
cannot check, whether or not the filesytem is mounted. If you want it do beheave
differently, you need to talk to upstream.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

fatsort-0.9.8.2-2.fc9 has been submitted as an update for Fedora 9

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

fatsort-0.9.8.2-2.fc8 has been submitted as an update for Fedora 8

Revision history for this message
Sebastian (sebastianp-deactivatedaccount-deactivatedaccount) wrote :
Revision history for this message
In , Mike (mike-redhat-bugs) wrote :

> About the "-f", I guess this is needed because you do not have an entry
> for /dev/sdb1 in /etc/fstab, there is only one with the label. Therefore
> fatsort cannot check, whether or not the filesytem is mounted. If you
> want it do beheave differently, you need to talk to upstream.

Changing 'LABEL=MP3-1234' to '/dev/sdb1' in fstab does not help.

Revision history for this message
In , Mike (mike-redhat-bugs) wrote :
Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

fatsort-0.9.8.2-2.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

fatsort-0.9.8.2-2.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Mike (mike-redhat-bugs) wrote :

Upstream has fixed "check_mounted: Unable to get realpath!" bug:
https://developer.berlios.de/bugs/?func=detailbug&bug_id=14146&group_id=2731

Updated fatsort (fatsort-0.9.8.3):
https://developer.berlios.de/project/showfiles.php?group_id=2731
works fine no matter if I have 'LABEL=MP3-1234' or '/dev/sdb1' in fstab.

Please note, that mounted filesystem trigger a proper error.

Revision history for this message
In , Till (till-redhat-bugs) wrote :

I will update fatsort soon. If you need a bug report for the realpath isssue,
please open a new bug report, but this one was only about the wrong CFLAGS.

Changed in fatsort:
status: Unknown → Fix Released
Revision history for this message
c.h. (wryfi) wrote :

I can confirm that the fedora fix linked to by Sebastian is right. I was having the same problem as the original reporter. After viewing the fedora bug report, I downloaded the ubuntu source package, added the appropriate CFLAGS to the debian control file, and rebuilt the package. It's working like a charm now.

Interestingly, if you manually run `make` from the clean source dir, the correct CFLAGS are used automatically. I don't know enough about deb packaging internals, but somehow the maintainer's CFLAGS are getting overridden by debuild.

Revision history for this message
Daniel T Chen (crimsun) wrote :

debian/rules uses a nonexistent Makefile target ("fatsort"), so the correct CFLAGS are being ignored. Change DEB_MAKE_BUILD_TARGET to use "all" instead of "fatsort".

Changed in fatsort:
assignee: nobody → crimsun
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Daniel T Chen (crimsun) wrote :
Revision history for this message
James Westby (james-w) wrote :

Hi Daniel,

As this is a packaging issue could you please report a bug in Debian
for the problem and attach the patch?

Thanks,

James

Revision history for this message
Sebastian Dröge (slomo) wrote :

This is already fixed in Debian, a sync of the latest version from unstable would be the way to go (more bugfixes there)

Revision history for this message
James Westby (james-w) wrote :

Aha! Thanks Sebastian, I checked, but I forgot to display Archived bugs. I miss
quite a few interesting bugs that way.

Thanks,

James

Revision history for this message
Daniel T Chen (crimsun) wrote :

Sorry guys, lack of due diligence on this one (and it being past my bedtime). The single change was to avoid having to file an exception for a newer version, but I understand if Sebastian prefers that approach.

Changed in fatsort:
status: Unknown → Fix Released
Revision history for this message
James Westby (james-w) wrote :

Hi motu-release,

We have a fix for this bug, but Sebastian recommended
we should pull in the new version, as it has some important
fixes. Looking at the changelog I would tend to agree. I'm
submitting this FFe so that you can decide whether the new
feature introduced are acceptable.

Thanks,

James

+07/08/2008 v0.9.8.3 * bug in check_mounted fixed
+06/11/2008 v0.9.8.2 * minor fixes in header files and make files
+ * modified README
+06/10/2008 v0.9.8.1 * some minor fixes. Thanks to Till Maas.
+09/25/2007 v0.9.8 * splitted fatsort into several source files
+ * implemented exclusive file lock (not mandatory)
+ * signals are blocked while writing to file (implemented critial sections)
+ * sorting of special directory entries (".", ".." and volume label) is now prevented
+ * enhanced mount check feature
+ * -f option to force sorting introduced
+ * small updates
+ * thanks to Joe Forster/STA for some fixes

Changed in fatsort:
assignee: crimsun → nobody
status: In Progress → New
Revision history for this message
James Westby (james-w) wrote :
Revision history for this message
James Westby (james-w) wrote :
Revision history for this message
StefanPotyra (sistpoty) wrote :

sounds sensible, +1 from me

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

FFe approved.

Changed in fatsort:
status: New → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

[Updating] fatsort (0.9.7.1-1 [Ubuntu] < 0.9.8.3-1 [Debian])
 * Trying to add fatsort...
  - <fatsort_0.9.8.3.orig.tar.gz: downloading from http://ftp.debian.org/debian/>
  - <fatsort_0.9.8.3-1.diff.gz: downloading from http://ftp.debian.org/debian/>
  - <fatsort_0.9.8.3-1.dsc: downloading from http://ftp.debian.org/debian/>
I: fatsort [universe] -> fatsort_0.9.7.1-1 [universe].

Changed in fatsort:
status: Confirmed → Fix Released
Changed in fatsort (Fedora):
importance: Unknown → Medium
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.