bug-coreutils
[Top][All Lists]
Advanced

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

touch gets stuck for named pipes


From: ipif
Subject: touch gets stuck for named pipes
Date: Wed, 8 Apr 2009 07:14:30 -0700 (PDT)

Hi,
I'm using coreutils-7.2 on an embedded sparc V8 with linux-2.6.21 and
uclibc-0.9.30.
The problem is, that in utime.c(73) it is tried to read a char from the file
and to write it back. As the fifo is empty touch gets stuck waiting for
input.
Because I'm crosscompiling HAVE_WORKING_UTIMES is always unset. Exporting
gl_cv_func_working_utimes solved this for me, but no the issue at all.
This also applies for coreutils-6.9.

gdb output:
(gdb) run /root/test
Starting program: /bin/touch /root/test

Program received signal SIGINT, Interrupt.
0x50029c24 in read () from /lib/libc.so.0
(gdb) bt
#0  0x50029c24 in read () from /lib/libc.so.0
#1  0x0001e790 in safe_read (fd=6, buf=0xefaa1617, count=1) at
safe-read.c:66
#2  0x00016e44 in rpl_utime (file=<value optimized out>, times=<value
optimized out>) at utime.c:71
#3  0x00016854 in gl_futimens (fd=0, file=0xffffffff <Address 0xffffffff out
of bounds>, timespec=0x0) at utimens.c:215
#4  0x00011aa8 in main (argc=2, argv=0xefaa18d4) at touch.c:185
(gdb)

strace output:
strace /bin/touch /root/test
execve("/bin/touch", ["/bin/touch", "/root/test"], [/* 18 vars */]) = 0
gettimeofday({1239194798, 996396}, NULL) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x50006000
stat("/etc/ld.so.cache", {st_mode=S_IFREG|0644, st_size=64, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
mmap(NULL, 64, PROT_READ, MAP_SHARED, 3, 0) = 0x50007000
close(3)                                = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=367844, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x50008000
read(3,
"\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0\3\0\2\0\0\0\1\0\0\374\224\0\0\0004\0"...,
4096) = 4096
mmap(NULL, 450560, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x50017000
mmap(0x50017000, 352184, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) =
0x50017000
mmap(0x5007e000, 8756, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 3, 0x57000) = 0x5007e000
mmap(0x50081000, 15840, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x50081000
close(3)                                = 0
munmap(0x50008000, 4096)                = 0
munmap(0x50007000, 64)                  = 0
stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=25292, ...}) = 0
mprotect(0x33000, 4096, PROT_READ)      = 0
mprotect(0x5007e000, 4096, PROT_READ)   = 0
mprotect(0x50015000, 4096, PROT_READ)   = 0
ioctl(0, TCSETAF or SNDCTL_TMR_SELECT, {B38400 opost isig icanon echo ...})
= 0
ioctl(1, TCSETAF or SNDCTL_TMR_SELECT, {B38400 opost isig icanon echo ...})
= 0
brk(0)                                  = 0x35000
brk(0x36000)                            = 0x36000
open("/root/test", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK|O_LARGEFILE, 0666) =
3
dup2(3, 0)                              = 0
close(3)                                = 0
open("/root/test", O_RDWR|O_LARGEFILE)  = 3
fstat64(3, {st_mode=S_IFIFO|0644, st_size=0, ...}) = 0
read(3,  <unfinished ...>

-jan
-- 
View this message in context: 
http://www.nabble.com/touch-gets-stuck-for-named-pipes-tp22951383p22951383.html
Sent from the Gnu - Coreutils - Discuss mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]