bug#70411: [bug] install(1) fails to read /dev/stdin on Darwin
Alejandro Colomar via GNU coreutils Bug Reports <[email protected]>
| Newsgroups | gmane.comp.gnu.core-utils.bugs,gmane.comp.lib.gnulib.bugs |
|---|---|
| Message-ID | <jgncaon5sk7eukgi4teql5ydeva2zugtoc3a3l2h2gcey2cp46@wjym3lg7ob7v> |
Hi Sergei, On Fri, Apr 19, 2024 at 10:33:00PM +0100, Sergei Trofimovich wrote: > On Fri, 19 Apr 2024 00:33:52 -0700 > Paul Eggert <[email protected]> wrote: > > > On 2024-04-18 14:52, Sergei Trofimovich wrote: > > > $ clang simple.c -o simple && echo 42 | ./simple > > > 1: ino=3009428657538693161 > > > 2: ino=3009428657538693161 > > > 3: ino=1568241705 > > > > > > Note how stat() and fstat() don't agree on inode. > > > > > > Apparently it's documented in > > > https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/fstat.2.html > > > as > > > > > > BUGS > > > Applying fstat to a socket (and thus to a pipe) returns a zero'd buffer, > > > except for the blocksize field, and a unique device and inode number. > > > > The BUGS note simply means that a pipe has a unique inode number, which > > is what we want. So that's not indicating any problem. > > > > > > Oh, I see the problem now. For a socket or pipe, macOS fstat returns > > the full 64-bit inode number, whereas macOS stat returns only the low > > order 32 bits. In your example, 3009428657538693161 % (2**32) == > > 1568241705. > > > > This is a kernel bug in macOS. Can you report it or otherwise arrange to > > have the kernel bug fixed? I expect that you have better connections > > with Apple than I do. A proposed patch (relative to xnu-10063.101.15) is > > attached; I have not tested it as I don't use macOS. Thanks. > > I reported it via https://www.apple.com/feedback/macos.html Did they reply? Had the Darwin kernel bug been fixed? Have a lovely day! Alex > > > Also, I am documenting this macOS bug in Gnulib by installing the second > > attached patch to Gnulib, and am cc'ing this email to bug-gnulib. > > Thank you, Paul! > > -- > > Sergei -- <https://www.alejandro-colomar.es> Use port 80 (that is, <...:80/>).
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmi9Sx0ACgkQ64mZXMKQ wqntdw//SgzMuwOjZZNK8CksPXNkPJrqQJF1GMR+DLCoKMeJXIgME40s/9nioJg5 oFn+IvJ2H/473zHZvrfM/n4DRawRnL7WZmdLuMYk4/d448FUqbsGiPc8oLGCD4kW keCymZTvBj855U1Tiz5RsUwW2JkiOZJDthwDkkX1l955cr94W7kkdz3vx+xOHVuR lbUsFcwbPxaZeTC2WjxbHLfPFf2M9u9T80cha9nWvYPFFgJ40nILMsxTwoju8z1O Db3TBkJFA8j2TzFlNmEqvXNiNCzFcJIX1LmP+/Pff85F9BUpFFYveTe6Br+rfFoN WvN2YbJWtz9RDoSbI7VqJGNMFwPdWgzyDLb42IBK7ycWzOhSmpPQSsD5+QtZhSfV wJskFBeXDLKJJtglfEzLENuuYoQAh+UtweAv7zouH564obJTVR7q+EKBN+px70xS svEVGUqc39axi7PmliQQQFF1au0q+E7jn5M2e3aSWWWKKCgyuQUUargJqiEoVBJe pTMRJBY0fyEZ2KfgserDcNYWLuBBmKVkxWpsYBi7j/kcqmKz1fIbaDknqItI6NK7 sApheX5OdgDMVk41p/rqmmLlFWzsnkg7Fg6uwUuMJqS4WTJtsh/FR1SK4GZJwgxB 947FNFb2h3Wv4BzCDxGOs+gIzK74HG6IJiBhIX1vKm3wIwtCzlg= =Ejlf -----END PGP SIGNATURE-----