bug-hurd
[Top][All Lists]
Advanced

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

Re: libzstd :: non-regular file test failure


From: Diego Nieto Cid
Subject: Re: libzstd :: non-regular file test failure
Date: Tue, 3 Dec 2024 12:42:47 -0300

El mar, 3 dic 2024 a las 11:54, Samuel Thibault
(<samuel.thibault@gnu.org>) escribió:
>
> Diego Nieto Cid, le mar. 03 déc. 2024 11:47:08 -0300, a ecrit:
> > El mar, 3 dic 2024 a las 11:26, Samuel Thibault
> > (<samuel.thibault@gnu.org>) escribió:
> >
> >     INTOVOID="/dev/null"
> >     case "$UNAME" in
> >       GNU) DEVDEVICE="/dev/random" ;;
> >       *) DEVDEVICE="/dev/zero" ;;
>
> Possibly the -o option is using DEVDEVICE while it should be useing
> INTOVOID? (and that wasn't noticed on linux just because it's 666 there)
>

DEVDEVICE is only used for that specific test. There are no other
usages in the file.

Apparently, it needs to be something different than /dev/null [1].
Upstream switched to
/dev/zero [2] for all OSes except Hurd.

Using /dev/zero on Hurd makes the test fail:

    $ dd if=/dev/zero of=tmp bs=1k count=64 && ./programs/zstd tmp -f
-o /dev/zero
    64+0 records in
    64+0 records out
    65536 bytes (66 kB, 64 KiB) copied, 0 s, Infinity B/s
    tmp                  :  0.04%   (  64.0 KiB =>     24 B, /dev/zero)
    zstd: /dev/zero: Success
    zstd: Refusing to remove non-regular file /dev/zero

On GNU/Linux, that command-line does not print the "Refusing..."
message (nor the "Success" one):

    $  dd if=/dev/zero of=tmp bs=1k count=64 && zstd tmp -f -o /dev/zero
    64+0 records in
    64+0 records out
    65536 bytes (66 kB, 64 KiB) copied, 0,00330334 s, 19,8 MB/s
    tmp                  :  0.04%   ( 65536 =>     24 bytes, /dev/zero)

The proper fix for this test, I presume, would be to make it work with
/dev/zero and remove the special case from the test script.

---
[1] https://github.com/facebook/zstd/issues/1116#issuecomment-386092430
[2] 
https://github.com/facebook/zstd/commit/7ca12a1455cc47c2f178fbd5b963fa8a1e4f0e71



reply via email to

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