[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: On darwin, diff <(echo ab) <(echo cd) does nothing
From: |
Vincent Lefevre |
Subject: |
Re: On darwin, diff <(echo ab) <(echo cd) does nothing |
Date: |
Sun, 21 Aug 2005 03:59:30 +0200 |
User-agent: |
Mutt/1.5.10-vl-20050813i |
On 2005-08-20 15:16:10 -0700, Paul Eggert wrote:
> Vincent Lefevre <address@hidden> writes:
>
> > On my Mac OS X 10.4.2 (Tiger) machine, with zsh and diff 2.8.1:
> >
> > prunille:~> diff <(echo ab) <(echo cd)
> > prunille:~>
If I put "cd\n" in a file, I sometimes get the result as expected:
prunille:~> diff <(echo ab) <(cat file)
prunille:~> diff <(echo ab) <(cat file)
prunille:~> diff <(echo ab) <(cat file)
1c1
< ab
---
> cd
zsh: exit 1 diff <(echo ab) <(cat file)
If I use ktrace, the diff always gives nothing. But if the file
contains a second line, the diff works.
A buffer problem or something related to a fd being closed too soon?
> Can you trace "diff" (using ktrace? sorry, I don't use Mac OS X so you
> may have to look this up yourself) to see what system calls that
> "diff" is executing?
kdump -m 16 gives with file containing only a line "cd":
28804 ktrace RET ktrace 0
28804 ktrace CALL execve(0xbfffe5cc,0xbfffeb9c,0xbfffebac)
28804 ktrace NAMI "/Users/vinc17/bin/diff"
28804 ktrace RET execve -1 errno 2 No such file or directory
28804 ktrace CALL execve(0xbfffe5cc,0xbfffeb9c,0xbfffebac)
28804 ktrace NAMI "/usr/local/bin/diff"
28804 ktrace RET execve -1 errno 2 No such file or directory
28804 ktrace CALL execve(0xbfffe5cc,0xbfffeb9c,0xbfffebac)
28804 ktrace NAMI "/opt/local/bin/diff"
28804 ktrace RET execve -1 errno 2 No such file or directory
28804 ktrace CALL execve(0xbfffe5cc,0xbfffeb9c,0xbfffebac)
28804 ktrace NAMI "/usr/bin/diff"
28804 ktrace NAMI "/usr/lib/dyld"
28804 diff RET execve 0
28804 diff CALL getuid
28804 diff RET getuid 501/0x1f5
28804 diff CALL getuid
28804 diff RET getuid 501/0x1f5
28804 diff CALL geteuid
28804 diff RET geteuid 501/0x1f5
28804 diff CALL getgid
28804 diff RET getgid 501/0x1f5
28804 diff CALL getegid
28804 diff RET getegid 501/0x1f5
28804 diff CALL
__sysctl(0xbfffe66c,0x2,0xbfffe674,0xbfffe668,0x8fe49ecc,0xa)
28804 diff RET __sysctl 0
28804 diff CALL __sysctl(0xbfffe674,0x2,0x8fe5885c,0xbfffe718,0,0)
28804 diff RET __sysctl 0
28804 diff CALL
__sysctl(0xbfffe66c,0x2,0xbfffe674,0xbfffe668,0x8fe49ef8,0xd)
28804 diff RET __sysctl 0
28804 diff CALL __sysctl(0xbfffe674,0x2,0x8fe58858,0xbfffe718,0,0)
28804 diff RET __sysctl 0
28804 diff CALL open(0x14e8,0,0)
28804 diff NAMI "/usr/lib/libSystem.B.dylib"
28804 diff RET open 3
28804 diff CALL fstat(0x3,0xbfffc63c)
28804 diff RET fstat 0
28804 diff CALL pread(0x3,0xbfffca9c,0x1000,0)
28804 diff GIO fd 3 read 4096 bytes
"Êþº¾\0\0\0\^B\0\0\0\^R\0\0\0\0"
28804 diff RET pread 4096/0x1000
28804 diff CALL pread(0x3,0xbfffca9c,0x1000,0x1000)
28804 diff GIO fd 3 read 4096 bytes
"þíúÎ\0\0\0\^R\0\0\0\0\0\0\0\^F"
28804 diff RET pread 4096/0x1000
28804 diff CALL __sysctl(0xbfffbcd0,0x2,0xbfffbcc8,0xbfffbccc,0,0)
28804 diff RET __sysctl 0
28804 diff CALL shared_region_map_file_np(0x3,0x4,0xbfffbbb0,0)
28804 diff RET shared_region_map_file_np 0
28804 diff CALL close(0x3)
28804 diff RET close 0
28804 diff CALL open(0x9000072c,0,0)
28804 diff NAMI "/usr/lib/system/libmathCommon.A.dylib"
28804 diff RET open 3
28804 diff CALL fstat(0x3,0xbfffc59c)
28804 diff RET fstat 0
28804 diff CALL pread(0x3,0xbfffc9fc,0x1000,0)
28804 diff GIO fd 3 read 4096 bytes
"Êþº¾\0\0\0\^B\0\0\0\^R\0\0\0\0"
28804 diff RET pread 4096/0x1000
28804 diff CALL pread(0x3,0xbfffc9fc,0x1000,0x1000)
28804 diff GIO fd 3 read 4096 bytes
"þíúÎ\0\0\0\^R\0\0\0\0\0\0\0\^F"
28804 diff RET pread 4096/0x1000
28804 diff CALL shared_region_map_file_np(0x3,0x3,0xbfffbeb0,0)
28804 diff RET shared_region_map_file_np 0
28804 diff CALL close(0x3)
28804 diff RET close 0
28804 diff CALL __sysctl(0xbfffea6c,0x2,0xbfffea68,0xbfffea60,0,0)
28804 diff RET __sysctl 0
28804 diff CALL __sysctl(0xbfffea6c,0x2,0xbfffea64,0xbfffea60,0,0)
28804 diff RET __sysctl 0
28804 diff CALL open(0xbfffe578,0,0x1b6)
28804 diff NAMI "/usr/share/locale/en_US.ISO8859-1/LC_CTYPE"
28804 diff RET open 3
28804 diff CALL fstat(0x3,0xbfffe4b8)
28804 diff RET fstat 0
28804 diff CALL fstat(0x3,0xbfffe2c8)
28804 diff RET fstat 0
28804 diff CALL lseek(0x3,0,0x1)
28804 diff RET lseek 0
28804 diff CALL lseek(0x3,0,0)
28804 diff RET lseek 0
28804 diff CALL read(0x3,0x1801200,0x1000)
28804 diff GIO fd 3 read 3196 bytes
"RuneMagiNONE\0\0\0\0"
28804 diff RET read 3196/0xc7c
28804 diff CALL close(0x3)
28804 diff RET close 0
28804 diff CALL stat(0xbfffecf1,0xbfffe8d8)
28804 diff NAMI "/dev/fd/15"
28804 diff RET stat 0
28804 diff CALL stat(0xbfffecfc,0xbfffe98c)
28804 diff NAMI "/dev/fd/16"
28804 diff RET stat 0
28804 diff CALL close(0x1)
28804 diff RET close 0
28804 diff CALL exit(0)
When adding a second line ".." to file, I get (after changing the
pid to 28804 as above, so that I could diff the kdump output) a few
differences like:
< 28804 ktrace CALL execve(0xbfffe5cc,0xbfffeb9c,0xbfffebac)
---
> 28804 ktrace CALL execve(0xbfffe5cc,0xbfffeba4,0xbfffebb4)
and the end is different:
[...]
28804 diff GIO fd 3 read 3196 bytes
"RuneMagiNONE\0\0\0\0"
28804 diff RET read 3196/0xc7c
28804 diff CALL close(0x3)
28804 diff RET close 0
28804 diff CALL stat(0xbfffed01,0xbfffe8d8)
28804 diff NAMI "/dev/fd/15"
28804 diff RET stat 0
28804 diff CALL stat(0xbfffed0c,0xbfffe98c)
28804 diff NAMI "/dev/fd/16"
28804 diff RET stat 0
28804 diff CALL open(0xbfffed01,0,0)
28804 diff NAMI "/dev/fd/15"
28804 diff RET open 3
28804 diff CALL open(0xbfffed0c,0,0)
28804 diff NAMI "/dev/fd/16"
28804 diff RET open 4
28804 diff CALL read(0x3,0x1802400,0x200)
28804 diff GIO fd 3 read 3 bytes
"ab
"
28804 diff RET read 3
28804 diff CALL read(0x3,0x1802403,0x1fd)
28804 diff GIO fd 3 read 0 bytes
""
28804 diff RET read 0
28804 diff CALL read(0x4,0x1802600,0x200)
28804 diff GIO fd 4 read 6 bytes
"cd
..
"
[...]
> Possibly zsh on Mac OS X 10.4.2 is operating in an incompatible way.
> What version of zsh are you using?
zsh 4.2.5 (powerpc-apple-darwin8.2.0)
from the darwinports.
--
Vincent Lefèvre <address@hidden> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
- On darwin, diff <(echo ab) <(echo cd) does nothing, Vincent Lefevre, 2005/08/20
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing, Paul Eggert, 2005/08/20
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing,
Vincent Lefevre <=
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing, Paul Eggert, 2005/08/21
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing, Vincent Lefevre, 2005/08/21
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing, Vincent Lefevre, 2005/08/21
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing, Paul Eggert, 2005/08/21
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing, Vincent Lefevre, 2005/08/21
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing, John.Cowan, 2005/08/21
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing, Paul Eggert, 2005/08/21
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing, John.Cowan, 2005/08/22
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing, Vincent Lefevre, 2005/08/23
- Re: On darwin, diff <(echo ab) <(echo cd) does nothing, Vincent Lefevre, 2005/08/23