Bug 454212 - -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 CFLAGS missing for fatsort
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 CFLAGS missing for fatsort
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: fatsort (Show other bugs)
8
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Till Maas
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-06 15:30 EDT by Mike
Modified: 2008-07-14 08:09 EDT (History)
0 users

See Also:
Fixed In Version: 0.9.8.2-2.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-14 08:09:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mike 2008-07-06 15:30:28 EDT
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
Comment 1 Till Maas 2008-07-06 16:04:22 EDT
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.
Comment 2 Mike 2008-07-06 18:05:02 EDT
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.
Comment 3 Mike 2008-07-06 18:29:09 EDT
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!
Comment 4 Till Maas 2008-07-06 19:02:57 EDT
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.
Comment 5 Fedora Update System 2008-07-06 19:21:57 EDT
fatsort-0.9.8.2-2.fc9 has been submitted as an update for Fedora 9
Comment 6 Fedora Update System 2008-07-06 19:23:15 EDT
fatsort-0.9.8.2-2.fc8 has been submitted as an update for Fedora 8
Comment 7 Mike 2008-07-06 21:03:49 EDT
> 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.
Comment 9 Fedora Update System 2008-07-08 22:44:11 EDT
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.
Comment 10 Fedora Update System 2008-07-08 22:48:59 EDT
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.
Comment 11 Mike 2008-07-09 07:59:37 EDT
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.
Comment 12 Till Maas 2008-07-14 08:09:52 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.