bug#7061: loop on touch (fdutimens)

2011-07-22 Thread Jim Meyering
tags 7061 + notabug
close 7061
thanks

C de-Avillez wrote:
...
 Indeed, building from a fresh GIT did the trick. I am guessing I
 something got left over from previous builds...

 This bug can be closed.

Done.





bug#7061: loop on touch (fdutimens)

2010-09-17 Thread C de-Avillez
Hello,

I just built  ran a quick test on coreutils GIT. I received a SEGV on
touch, and ran it under GDB.

Looks like a loop.

Cheers,

cer...@xango2:/build/buildd/coreutils$ gdb --args src/touch test
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-linux-gnu.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /src/buildd/coreutils/src/touch...done.
(gdb) set pagination off
(gdb) r
Starting program: /src/buildd/coreutils/src/touch test
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x004073dc in fdutimens (fd=0, file=0x0, timespec=0x0) at utimens.c:193
193   if (dup2 (fd, fd) != fd)
(gdb) bt 3 full
#0  0x004073dc in fdutimens (fd=0, file=0x0, timespec=0x0) at 
utimens.c:193
adjusted_timespec = {{tv_sec = 0, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 
0}}
ts = 0x0
adjustment_needed = 0
st = error reading variable st (Cannot access memory at address 
0x7f5fef70)
#1  0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at 
utimens.c:269
result = value optimized out
adjusted_timespec = {{tv_sec = 0, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 
0}}
ts = 0x0
adjustment_needed = value optimized out
st = {st_dev = 0, st_ino = 0, st_nlink = 0, st_mode = 0, st_uid = 0, 
st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 0, st_blocks = 
0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 0, tv_nsec = 0}, 
st_ctim = {tv_sec = 0, tv_nsec = 0}, __unused = {0, 0, 0}}
#2  0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at 
utimens.c:269
result = value optimized out
adjusted_timespec = {{tv_sec = 0, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 
0}}
ts = 0x0
adjustment_needed = value optimized out
st = {st_dev = 0, st_ino = 0, st_nlink = 0, st_mode = 0, st_uid = 0, 
st_gid = 0, __pad0 = 0, st_rdev = 0, st_size = 0, st_blksize = 0, st_blocks = 
0, st_atim = {tv_sec = 0, tv_nsec = 0}, st_mtim = {tv_sec = 0, tv_nsec = 0}, 
st_ctim = {tv_sec = 0, tv_nsec = 0}, __unused = {0, 0, 0}}
(More stack frames follow...)
(gdb) bt -5 full
#38527 0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at 
utimens.c:269
result = value optimized out
adjusted_timespec = {{tv_sec = 8589924528, tv_nsec = 0}, {tv_sec = 0, 
tv_nsec = 4197073}}
ts = 0x0
adjustment_needed = value optimized out
st = {st_dev = 4197129, st_ino = 140737354130624, st_nlink = 
140737488345056, st_mode = 4160562656, st_uid = 32767, st_gid = 4294957064, 
__pad0 = 32767, st_rdev = 140737354129768, st_size = 255564379, st_blksize = 
140737351936210, st_blocks = 0, st_atim = {tv_sec = 140737353950688, tv_nsec = 
140733193388033}, st_mtim = {tv_sec = 0, tv_nsec = 1}, st_ctim = {tv_sec = 
140737354129768, tv_nsec = 0}, __unused = {140737353950688, 1, 0}}
#38528 0x004072aa in fdutimens (fd=0, file=0x0, timespec=0x0) at 
utimens.c:269
result = value optimized out
adjusted_timespec = {{tv_sec = 5, tv_nsec = 0}, {tv_sec = 0, tv_nsec = 
140737351981093}}
ts = 0x0
adjustment_needed = value optimized out
st = {st_dev = 29848917, st_ino = 2, st_nlink = 140737349750208, 
st_mode = 0, st_uid = 0, st_gid = 4152746968, __pad0 = 32767, st_rdev = 
140737354115432, st_size = 0, st_blksize = 4294967295, st_blocks = 24, st_atim 
= {tv_sec = 1, tv_nsec = 6336552}, st_mtim = {tv_sec = 0, tv_nsec = 1}, st_ctim 
= {tv_sec = 0, tv_nsec = 0}, __unused = {140737351953297, 1, 0}}
#38529 0x004024e2 in fdutimensat (fd=0, dir=-100, file=0x7fffde74 
test, ts=0x0, atflag=0) at fdutimensat.c:48
result = 1
#38530 0x00401f21 in touch (argc=2, argv=0x7fffdad8) at touch.c:166
ok = value optimized out
fd = 0
open_errno = 0
t = 0x77929f97
#38531 main (argc=2, argv=0x7fffdad8) at touch.c:432
c = value optimized out
date_set = value optimized out
ok = true
flex_date = value optimized out
(gdb) list
188   if (fd  0)
189 {
190   errno = EBADF;
191   return -1;
192 }
193   if (dup2 (fd, fd) != fd)
194 return -1;
195 }
196
197   /* Some Linux-based NFS clients are buggy, and mishandle time stamps
(gdb) 


cer...@xango2:/build/buildd/coreutils$ src/touch --version
touch (GNU coreutils) 8.5.154-2dd21
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html.
This is free software: you are free to change 

bug#7061: loop on touch (fdutimens)

2010-09-17 Thread Paul Eggert
On 09/17/2010 05:49 PM, C de-Avillez wrote:

 I just built  ran a quick test on coreutils GIT. I received a SEGV on
 touch, and ran it under GDB.

I don't observe the problem.  I just now grabbed a fresh copy of coreutils.
I ran your test on Ubuntu 10.04 x86 and on RHEL 5 x86-64.

My guess is that you are running coreutils with a slightly out-of-date
gnulib, or vice versa.  You need to have either both of the following patches, 
or
neither of them.

http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=2dd21704d63c4e7567695a9e43dc1631b930efe2

http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=89b0db35db10a8beccaf83909c7f62f127fb5821





bug#7061: loop on touch (fdutimens)

2010-09-17 Thread C de-Avillez
On Fri, 17 Sep 2010 19:03:30 -0700
Paul Eggert egg...@cs.ucla.edu wrote:

 On 09/17/2010 05:49 PM, C de-Avillez wrote:
 
  I just built  ran a quick test on coreutils GIT. I received a
  SEGV on touch, and ran it under GDB.
 
 I don't observe the problem.  I just now grabbed a fresh copy of
 coreutils. I ran your test on Ubuntu 10.04 x86 and on RHEL 5 x86-64.

I am running it on Ubuntu Maverick (soon to-be 10.10). I do not have
another Linux distro to test right now, but I will build a 10.04 on
KVM.

 My guess is that you are running coreutils with a slightly
 out-of-date gnulib, or vice versa.  You need to have either both of
 the following patches, or neither of them.
 
 http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=2dd21704d63c4e7567695a9e43dc1631b930efe2
 
 http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=89b0db35db10a8beccaf83909c7f62f127fb5821

Both are applied on my git copy. Hum. I will go and redo it from a
fresh git copy.

Thanks, Paul. I will post what I find.

-- 
C de-Avillez
IRC: hggdh

This email (and any attachments) is digitally signed using GNUpg
(http://gnupg.org). The public key is available at http://pgp.mit.edu.
The key Id is 0xD3133E56.


signature.asc
Description: PGP signature