Error: Can't open directory "blah" (stat() returns -1)

Bug #459548 reported by Joel
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
tagtool (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: tagtool

Expected: tagtool would load up a list of mp3's from the specified directory.

Actual:

tagtool failed to open a cifs mounted directory.
It failed with the message: 'Error: Can't open directory "/mnt/Music" '
The stat call in file_list.c:check_working_dir() fails with a return value of -1.

I was able to get it to work by using the following steps:
1. apt-get build-dep tagtool
2. apt-get source tagtool
3. cd tagtool-0.12.3
4. CFLAGS="-D_FILE_OFFSET_BITS=64 -g" ./configure && make && make install

I have a directory mounted using cifs from fstab.
The fstab entry looks like this:
//192.168.1.2/Music /mnt/Music cifs rw,username=SomeUser,credentials=/root/.smb_creds,uid=1000,gid=1000,file_mode=0755,dir_mode=0755 0 0

The cifs server is a window home server box (essentially windows server 2003 sp2).

aptitude show tagtool
Package: tagtool
State: installed
Automatically installed: no
Version: 0.12.3-6

lsb_release -rd
Description: Ubuntu 9.10
Release: 9.10

And here is a gdb session using CFLAGS="-D_FILE_OFFSET_BITS=64 -g":
Breakpoint 1, check_working_dir () at /usr/include/bits/string3.h:99
99 (void) __builtin___memset_chk (__dest, '\0', __len, __bos0 (__dest));
(gdb) n
311 res = stat(working_dir->str, &stat_data);
(gdb) set print pretty
(gdb) info locals
res = 0
stat_data = {
  st_dev = 26,
  __pad1 = 0,
  __st_ino = 797,
  st_mode = 16877,
  st_nlink = 1,
  st_uid = 1000,
  st_gid = 1000,
  st_rdev = 0,
  __pad2 = 0,
  st_size = 0,
  st_blksize = 16384,
  st_blocks = 0,
  st_atim = {
    tv_sec = 1256353883,
    tv_nsec = 640250000
  },
  st_mtim = {
    tv_sec = 1256246783,
    tv_nsec = 952750000
  },
  st_ctim = {
    tv_sec = 1256246783,
    tv_nsec = 952750000
  },
  st_ino = 71494644084507421
}

Notice that stat_data.st_ino is clearly larger than uint32

ProblemType: Bug
Architecture: i386
Date: Fri Oct 23 22:45:52 2009
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: tagtool 0.12.3-6
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-14.48-generic-pae
SourcePackage: tagtool
Uname: Linux 2.6.31-14-generic-pae i686

Revision history for this message
Joel (t-launchpad-tannesen-com) wrote :
Revision history for this message
rogmorri (frontporsche) wrote :

Similar issue with gcc. See bug #455122

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.