[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#446419: gcc-4.2: Emits irrecognizably mutilated object files when source files are on a NFS/CIFS mount.



Package: gcc-4.2
Version: 4.2.1-4
Severity: important

Linked[1] are two fully preprocessed files, a.c and b.c:

betelheise:/mnt/etherstorm# sha1sum a/a.c a/b.c
2d6476c2ee4be49ce868d9af0416a081c3ec3531  a/a.c
13a748d2f4d516e626e3998f7459146dff0231db  a/b.c

They differ by one function, which is commented out in a.c:

betelheise:/mnt/etherstorm# diff -uN a/a.c a/b.c
--- a/a.c       2007-10-12 22:33:25.000000000 +0400
+++ a/b.c       2007-10-12 22:32:15.000000000 +0400
@@ -2124,7 +2124,6 @@
     } match;
 };
 # 68 "common_iterator.c"
-/*
 struct pci_device_iterator *
 pci_slot_match_iterator_create( const struct pci_slot_match * match )
 {
@@ -2150,4 +2149,3 @@

       return iter;
 }
-*/

The illustrative scenario, which is reproducible on my machine with
a 100% reliability:

betelheise:/mnt/etherstorm# make -C a
make: Entering directory `/mnt/etherstorm/a'
rm -f *.o *.s
gcc -g a.c b.c -S
gcc -g a.s b.s -c
file a.o b.o
a.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
b.o: data
make: Leaving directory `/mnt/etherstorm/a'
betelheise:/mnt/etherstorm# cp a /tmp -R
betelheise:/mnt/etherstorm# make -C /tmp/a
make: Entering directory `/tmp/a'
rm -f *.o *.s
gcc -g a.c b.c -S
gcc -g a.s b.s -c
file a.o b.o
a.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
b.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
make: Leaving directory `/tmp/a'

/mnt/etherstorm is a CIFS mount (works the same with a NFS mount), /tmp
is, obviously, local.

Removing the -g makes it work fine.

The kernel is a stock debian one.

P.S. A note to take, perhaps, is that the lack of difference
due to the mint of the remote FS is explainable by the fact that the
actual data doesn't have a chance to hit network yet, as it's reused
immediately from the page cache.

[1]: http://www.feelingofgreen.ru/static/incoming/a.tar.gz
SHA1: 7236421746f47a739ba91a8b9cbe141a91dbaa60

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-2-amd64 (SMP w/1 CPU core)
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages gcc-4.2 depends on:
ii  binutils                      2.18-1     The GNU assembler, linker and bina
ii  cpp-4.2                       4.2.1-4    The GNU C preprocessor
ii  gcc-4.2-base                  4.2.1-4    The GNU Compiler Collection (base 
ii  libc6                         2.6.1-1    GNU C Library: Shared libraries
ii  libgcc1                       1:4.2.1-4  GCC support library
ii  libgomp1                      4.2.1-4    GCC OpenMP (GOMP) support library

Versions of packages gcc-4.2 recommends:
ii  libc6-dev                     2.6.1-1    GNU C Library: Development Librari
pn  libmudflap0-4.2-dev           <none>     (no description available)

-- no debconf information




Reply to: