i386 version of gcc-4.5 fails to compile C or Fortran files on CIFS mounts

Bug #784705 reported by Axel Beckert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Fix Released
High
gcc-4.5 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

A user of us ran into this on his locally managed Ubuntu Natty i386 machine and I could reproduce it as follows:

auriga:~# mkdir /mnt/tmp
auriga:~# mount.cifs -o user=abe,rw,mand,uid=abe,gid=isg //unixdata/isg /mnt/tmp
Password:
auriga:~# su - abe
U !514 Z1 ?0 L1 abe@auriga:pts/8 (-su) 16:42:32 [~] > cd /mnt/tmp/cifs-test
U !515 Z2 ?0 L1 abe@auriga:pts/8 (-su) 16:42:41 [/mnt/tmp/cifs-test] > ls -l
total 12
-rwxr-xr-x 0 abe isg 25 2011-05-18 16:30 test.c*
U !516 Z3 ?0 L1 abe@auriga:pts/8 (-su) 16:42:48 [/mnt/tmp/cifs-test] > cat test.c
int main() {
        return 0;
}
U !517 Z4 ?0 L1 abe@auriga:pts/8 (-su) 16:42:51 [/mnt/tmp/cifs-test] > gcc -o test test.c
cc1: fatal error: test.c: Value too large for defined data type
compilation terminated.
U !518 Z5 ?1 L1 abe@auriga:pts/8 (-su) 16:43:00 [/mnt/tmp/cifs-test] > touch foo.f
U !519 Z6 ?0 L1 abe@auriga:pts/8 (-su) 16:43:51 [/mnt/tmp/cifs-test] > gfortran foo.f
Error: Can't open file 'foo.f'
<built-in>:0:0: fatal error: can't open input file: foo.f
compilation terminated.
U !520 Z7 ?1 L1 abe@auriga:pts/8 (-su) 16:56:49 [/mnt/tmp/cifs-test] > lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.04
Release: 11.04
Codename: natty
U !521 Z8 ?0 L1 abe@auriga:pts/8 (-su) 16:58:01 [/mnt/tmp/cifs-test] > COLUMNS=80 dpkg -l cifs-utils gcc-4.5
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii cifs-utils 2:4.5-2 Common Internet File System utilities
ii gcc-4.5 4.5.2-8ubuntu4 The GNU C compiler
U !522 Z9 ?0 L1 abe@auriga:pts/8 (-su) 16:58:33 [/mnt/tmp/cifs-test] > uname -a
Linux auriga 2.6.38-8-generic-pae #42-Ubuntu SMP Mon Apr 11 05:17:09 UTC 2011 i686 i686 i386 GNU/Linux
U !523 Z10 ?0 L1 abe@auriga:pts/8 (-su) 16:59:02 [/mnt/tmp/cifs-test] >

On unixdata runs a Samba server on Debian Lenny (2:3.2.5-4lenny14)

This is also reproducible on Debian Sid/Squeeze with gcc-4.1 through gcc-4.5 (but not the default gcc-4.6) on i386. cifs-utils is at version 2:4.9-1 there. I'll file according bug reports there later, too, and will reference them here.

(The mount options "mand" or "rw" aren't relevant, also happens with "nomand" or "ro".)

This is not reproducible in the following cases:

* with Ubuntu Natty amd64 (so it seems to be architecture-dependent)
* with Ubuntu Maverick amd64 and gcc-4.4 (probably because of amd64, not because of gcc-4.4)
* with Debian Sid i386 and gcc-4.6
* if I copy the files (e.g. with rsync -a) from the CIFS mounted file system to /tmp and compile them there
* if I use NFS instead of a CIFS mount
* if I use sshfs instead of a CIFS mount (this is also the current workaround we recommended our user as he can't do NFS mounts)

I couldn't check it on Lucid as mount.cifs bails out with "Mounting the DFS root for domain not implemented yet". And I don't have a Maverick box around.

I suspect the issue to be either in gcc-4.5 or cifs-utils, but I'm not sure in which of them.

Related branches

Axel Beckert (xtaran)
summary: - 32-bit version of gcc-4.5 fails to compile C or Fortran files on CIFS
+ i386 version of gcc-4.5 fails to compile C or Fortran files on CIFS
mounts
Axel Beckert (xtaran)
description: updated
affects: ubuntu → gcc-4.5 (Ubuntu)
Revision history for this message
In , Fabio Marconi (fabiomarconi) wrote :

A user of us ran into this on his locally managed Ubuntu Natty i386 machine and I could reproduce it as follows:

auriga:~# mkdir /mnt/tmp
auriga:~# mount.cifs -o user=abe,rw,mand,uid=abe,gid=isg //unixdata/isg /mnt/tmp
Password:
auriga:~# su - abe
U !514 Z1 ?0 L1 abe@auriga:pts/8 (-su) 16:42:32 [~] > cd /mnt/tmp/cifs-test
U !515 Z2 ?0 L1 abe@auriga:pts/8 (-su) 16:42:41 [/mnt/tmp/cifs-test] > ls -l
total 12
-rwxr-xr-x 0 abe isg 25 2011-05-18 16:30 test.c*
U !516 Z3 ?0 L1 abe@auriga:pts/8 (-su) 16:42:48 [/mnt/tmp/cifs-test] > cat test.c
int main() {
        return 0;
}
U !517 Z4 ?0 L1 abe@auriga:pts/8 (-su) 16:42:51 [/mnt/tmp/cifs-test] > gcc -o test test.c
cc1: fatal error: test.c: Value too large for defined data type
compilation terminated.
U !518 Z5 ?1 L1 abe@auriga:pts/8 (-su) 16:43:00 [/mnt/tmp/cifs-test] > touch foo.f
U !519 Z6 ?0 L1 abe@auriga:pts/8 (-su) 16:43:51 [/mnt/tmp/cifs-test] > gfortran foo.f
Error: Can't open file 'foo.f'
<built-in>:0:0: fatal error: can't open input file: foo.f
compilation terminated.
U !520 Z7 ?1 L1 abe@auriga:pts/8 (-su) 16:56:49 [/mnt/tmp/cifs-test] > lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.04
Release: 11.04
Codename: natty
U !521 Z8 ?0 L1 abe@auriga:pts/8 (-su) 16:58:01 [/mnt/tmp/cifs-test] > COLUMNS=80 dpkg -l cifs-utils gcc-4.5
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii cifs-utils 2:4.5-2 Common Internet File System utilities
ii gcc-4.5 4.5.2-8ubuntu4 The GNU C compiler
U !522 Z9 ?0 L1 abe@auriga:pts/8 (-su) 16:58:33 [/mnt/tmp/cifs-test] > uname -a
Linux auriga 2.6.38-8-generic-pae #42-Ubuntu SMP Mon Apr 11 05:17:09 UTC 2011 i686 i686 i386 GNU/Linux
U !523 Z10 ?0 L1 abe@auriga:pts/8 (-su) 16:59:02 [/mnt/tmp/cifs-test] >

This is also reproducible on Debian Sid/Squeeze with gcc-4.1 through gcc-4.5 (but not the default gcc-4.6) on i386. cifs-utils is at version 2:4.9-1 there. I'll file according bug reports there later, too, and will reference them here.

(The mount options "mand" or "rw" aren't relevant, also happens with "nomand" or "ro".)

This is not reproducible in the following cases:

* with Ubuntu Natty amd64 (so it seems to be architecture-dependent)
* with Ubuntu Maverick amd64 and gcc-4.4 (probably because of amd64, not because of gcc-4.4)
* with Debian Sid i386 and gcc-4.6
* if I copy the files (e.g. with rsync -a) from the CIFS mounted file system to /tmp and compile them there
* if I use NFS instead of a CIFS mount
* if I use sshfs instead of a CIFS mount (this is also the current workaround we recommended our user as he can't do NFS mounts)

I couldn't check it on Lucid as mount.cifs bails out with "Mounting the DFS root for domain not implemented yet". And I don't have a Maverick box around.

I suspect the issue to be either in gcc-4.5 or cifs-utils, but I'm not sure in which of them.

original report on Launchpad:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.5/+bug/784705

Revision history for this message
In , Fabio Marconi (fabiomarconi) wrote :

Sorry if not a bug in gcc, but i'm not an expert.
Thanks in advance
Fabio

Revision history for this message
Axel Beckert (xtaran) wrote :

Some more details:

Also happens with Kernel 2.6.32 from Debian Squeeze, i.e. it's not an issue of a recent kernel.

Attached a diff of normalized strace output of:
  - gcc-4.5 -o test test.c
  - gcc-4.6 -o test test.c

One difference between the two runs seems to be that test.c is opened with O_LARGEFILE in gcc-4.6, but not gcc-4.5.

Changed in gcc:
importance: Unknown → High
status: Unknown → New
Revision history for this message
In , Rguenth (rguenth) wrote :

The issue is that gcc < 4.6 does not have large file support enabled and so
on 32bit hosts with 64bit file systems you can get this if the inode number
does not fit in the 32bit stat structure. That's what we have seen on
32bit userland with 64bit kernels and big fs.

Should be fixed for 4.6.

Revision history for this message
In , Jb-gcc (jb-gcc) wrote :

Not a GCC bug.

As an aside, CIFS mounts work quite well IF the server supports the "CIFS Unix extensions"; Samba supports those, but IIRC the Windows CIFS server doesn't. Without the Unix extensions, the mounts behave very POSIX-unlike in some situations which makes many applications break, apparently including GCC. HTH, HAND.

Revision history for this message
Axel Beckert (xtaran) wrote :

Just a short comment: Looks the Samba version on the server side is also relevant: If the Samba server is Debian Squeeze (2:3.5.6~dfsg-3squeeze2), the problem vanishes, too.

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Hello Alex
Have you already seen the replies of the developers:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49052
Fabio

Revision history for this message
Axel Beckert (xtaran) wrote : Re: [Bug 784705] Re: i386 version of gcc-4.5 fails to compile C or Fortran files on CIFS mounts

Hi Fabio,

Fabio Marconi wrote:
> Have you already seen the replies of the developers:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49052

I have. "It's fixed in gcc 4.6" and "It's not a gcc bug" -- On a first
glance it can't be that both are true, but I fear that it's not one
but several bugs in several projects.... :-)

At least as I suspected, O_LARGEFILE seems to be relevant. :-)

With regards to replying, I just wanted to wait until they're visible
in Launchpad, as I don't want to create an account in yet another
Bugzilla.

  Regards, Axel
--
 ,''`. | Axel Beckert <email address hidden>, http://people.debian.org/~abe/
: :' : | Debian Developer, ftp.ch.debian.org Admin
`. `' | 1024D: F067 EA27 26B9 C3FC 1486 202E C09E 1D89 9593 0EDE
  `- | 4096R: 2517 B724 C5F6 CA99 5329 6E61 2FF9 CD59 6126 16B5

Changed in gcc:
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gcc-4.5 - 4.5.3-3ubuntu1

---------------
gcc-4.5 (4.5.3-3ubuntu1) oneiric; urgency=low

  * Update to SVN 20110708 (r176049) from the gcc-4_5-branch.
    - Fix PR target/49660, PR tree-optimization/48822,
      PR tree-optimization/49115, PR tree-optimization/49615,
      PR tree-optimization/49572, PR target/42333, PR rtl-optimization/48542,
      PR target/49307, PR c++/49440.
  * Update the Linaro support to the 4.5 branch 20110704.

gcc-4.5 (4.5.3-3) unstable; urgency=low

  * Extend multiarch support for mips/mipsel.

gcc-4.5 (4.5.3-2) unstable; urgency=low

  * Update to SVN 20110608 (r174800) from the gcc-4_5-branch.
    - Fix PR target/48774, PR tree-optimization/48809, PR middle-end/48597,
      PR c/48742, PR c/48685, PR middle-end/43085, PR bootstrap/43858,
      PR target/48288, PR c++/48046, PR fortran/48894, PR target/48857,
      PR target/48495, PR tree-optimization/48837, PR target/48900,
      PR c++/40975, PR target/48252, PR target/48708, PR c++/48936,
      PR c++/48873, PR target/49238, PR target/49186,
      PR tree-optimization/49038, PR target/43700, PR target/43995,
      PR rtl-optimization/41619, PR tree-optimization/47714, PR fortran/45786.
  * pr45979.diff: Update to the version from the trunk.
  * Update the Linaro support to the 4.5-2011.05-0 release.
  * Check for large file support (backport from 4.6). LP: #784705.
  * Add some conditionals to build the package on older releases.
  * Fix c++ biarch header installation on i386.
  * Add multiarch attributes for gnat and libgnat packages.
  * Add multiarch attributes for libgcj* packages.
  * Adjust build dependency on multiarch glibc.
  * Enable multiarch.
 -- Matthias Klose <email address hidden> Fri, 08 Jul 2011 19:39:39 +0200

Changed in gcc-4.5 (Ubuntu):
status: New → Fix Released
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.