Your message dated Sun, 01 Dec 2019 11:49:56 +0000
with message-id <[email protected]>
and subject line Bug#925544: fixed in rust-ripgrep 11.0.2-1
has caused the Debian Bug report #925544,
regarding ripgrep: Exits immediately without warning if it encounters a NUL
byte inside the file to be searched, might exit with wrong exit code depending
on the position of the match
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
925544: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925544
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ripgrep
Version: 0.10.0-2
Severity: important
Tags: upstream
Hi,
with several GB via STDIN, rg as well as rg -F immediately exited
without any output while fgrep found many hits until it issued the
warning "Binary file (standard input) matches".
Consider the following example (based on the attached file):
→ cat -v aeh.txt
a
M-CM-$
^@
a
→ cat aeh.txt | fgrep a
Binary file (standard input) matches
→ cat aeh.txt | fgrep -a a
a
a
→ cat aeh.txt | rg a
a
→ cat aeh.txt | rg -a a
a
a
In the third example with "rg a", rg neither crashed nor issued a
warning. fgrep in comparison issued a warning.
While the above example might be close to what fgrep does, just without
the warning, the following example is even worse:
→ cat aeh.txt | fgrep ä
Binary file (standard input) matches
→ echo $?
0
→ cat aeh.txt | fgrep ö
→ echo $?
1
→ cat aeh.txt | rg ä
→ echo $?
1
→ cat aeh.txt | rg ö
→ echo $?
1
→ cat aeh.txt | rg -a ä
ä
→ echo $?
0
So fgrep properly indicates with the exit code if there was a hit even
though it didn't output anything besides the warning about binary junk.
But even though the hit would have been before the NUL byte, rg claims
(via exit code) that there is no hit inside the STDIN despite "rg -a"
says otherwise (via output and exit code).
"cat aeh.txt | strace rg ä" shows that it exits rather quickly after
having read the NUL byte:
read(0, "a\n\303\244\n\0\na\n", 8192) = 9
sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0
munmap(0x7fbfac3d0000, 8192) = 0
exit_group(1) = ?
+++ exited with 1 +++
Constraints to trigger the issue: data must contain a NUL byte and
neither of the options "-a" and "--text" must be set. On larger files
(gigabytes) it is obvious that rg exits preliminarily if the NUL byte is
close to the beginning solely because of how quick the command exits. We
actually discovered the issue that way: rg exited way too quickly and
without any output at all, especially in comparison to fgrep.
Impact: Does not indicate that there were hits and preliminarily exits
without further notice, hence can yield wrong results (exit code as well
as output) without any indication of there being an issue.
Workaround: always use option -a or --text when contents might contain
binary junk.
P.S.: Yes, fgrep/grep/egrep also has its issues there like the warning
being on STDOUT, not STDERR, but it's still much more clear in
indicating the issue compared to rg.
P.P.S.: I also tried to see if the options -F and --no-encoding make a
difference in this case, but they don't.
P.P.P.S.: This might be related to
https://github.com/BurntSushi/ripgrep/issues/1207
a
ä
_SHA384:256)
(Exim 4.92)
(envelope-from <[email protected]>)
id 1ibNji-0001YQ-2m
for [email protected]; Sun, 01 Dec 2019 11:49:58 +0000
Received: from fasolo.debian.org ([138.16.160.17]:51902)
from C=NA,ST=NA,L=Ankh Morpork,O=Debian SMTP,OU=Debian SMTP
CA,CN=fasolo.debian.org,[email protected] (verified)
by muffat.debian.org with esmtps
(TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.89)
(envelope-from <[email protected]>)
id 1ibNjh-00075T-Km; Sun, 01 Dec 2019 11:49:57 +0000
Received: from dak by fasolo.debian.org with local (Exim 4.89)
(envelope-from <[email protected]>)
id 1ibNjg-000DeQ-HG; Sun, 01 Dec 2019 11:49:56 +0000
From: Sylvestre Ledru <[email protected]>
To: [email protected]
X-DAK: dak process-upload
X-Debian: DAK
X-Debian-Package: rust-ripgrep
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Subject: Bug#925544: fixed in rust-ripgrep 11.0.2-1
Message-Id: <[email protected]>
Date: Sun, 01 Dec 2019 11:49:56 +0000
Source: rust-ripgrep
Source-Version: 11.0.2-1
We believe that the bug you reported is fixed in the latest version of
rust-ripgrep, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Sylvestre Ledru <[email protected]> (supplier of updated rust-ripgrep
package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Format: 1.8
Date: Sun, 01 Dec 2019 12:16:32 +0100
Source: rust-ripgrep
Architecture: source
Version: 11.0.2-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Rust Maintainers
<[email protected]>
Changed-By: Sylvestre Ledru <[email protected]>
Closes: 925544 925603 945021
Changes:
rust-ripgrep (11.0.2-1) unstable; urgency=medium
.
* Package ripgrep 11.0.2 from crates.io using debcargo 2.4.0
(Closes: #945021, #925544)
* Remove the jemallocator dependencies (still in NEW)
disable-jemallocator.diff
* Improve the description (Closes: #925603)
Checksums-Sha1:
b5b68c509f0c9b6181cadc636bcc4348aef1a020 2600 rust-ripgrep_11.0.2-1.dsc
c7229d89e2e3578635238068d23d8c0341565a0d 243275 rust-ripgrep_11.0.2.orig.tar.gz
da422841ccad2419b69750066e29f2d8bf2dc21e 5488
rust-ripgrep_11.0.2-1.debian.tar.xz
ae8ec246a8b9ea1e5fe1c99ea6ccbc180df92190 10388
rust-ripgrep_11.0.2-1_amd64.buildinfo
Checksums-Sha256:
b7cc6051c49db2ef2b5613f58a48070f330e9565f028106ba7e1b51159417348 2600
rust-ripgrep_11.0.2-1.dsc
d903146d825e92f77f95d1e1e8e5272f42253978c07d58c2294467a14dca126f 243275
rust-ripgrep_11.0.2.orig.tar.gz
bc8ac7f417625c949c48b3b100dd586ddfaa9929dc5f6fa1b94519f9c9542ca2 5488
rust-ripgrep_11.0.2-1.debian.tar.xz
5fdf6289a998039d8cb1455df898cc6127d6e297ade2feb2794ea9f1ffdac27e 10388
rust-ripgrep_11.0.2-1_amd64.buildinfo
Files:
961e54dfb51b88dbff0e43ba22fb34d7 2600 utils optional rust-ripgrep_11.0.2-1.dsc
07f67dd4022ce7ce5e0b031482826b64 243275 utils optional
rust-ripgrep_11.0.2.orig.tar.gz
d8cb6646cc6887bdd41da0c47934ff91 5488 utils optional
rust-ripgrep_11.0.2-1.debian.tar.xz
d786f0a8bb905add516aeda9fc07eb59 10388 utils optional
rust-ripgrep_11.0.2-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEtg21mU05vsTRqVzPfmUo2nUvG+EFAl3joukACgkQfmUo2nUv
G+H9VQ//egtv1/WChCDzlKiY9ZvGgJfADUw/gebSM4XmstV8n11GPSwCwyYhbVsI
7L+0GUWCP1/W39WKlqFPy5aQd3aJkBNDHJhhXtkOfcUN5gRyV6tKVuOTM7dYxKF8
BV/lg1Hnf+DwUHj0Qakhoet87fjgqnYuljZR71tGqVIaRVYwGFST9Z1imRBEr9sO
vUu6yl5bIbrXyXaYXbuAD7NO/bDdpCK02S4YH42KQHNGUCq5iVFx4hszYhzeAdrV
3Ba1urgzLbEVBiYzfzs72nm0QaZUtOH1+Sv2LjXUED07BJcjdR8eMrBWwu4cQR0l
k4p0geVtIQP7mdDfXcfunKCCWNh5Hjjz4SUfFPgbqg6eO1F5Cz4zcYebZt5Ywn8h
ubVQ92JwSijJDv5h39U0ki/+dFbjnFnlVZ6UE45W/FcH88hTcmxz9Bay8UaImCWG
+mKjlxasNamr/pUmx1mBrGKRO6qcJbRMBw0SaEDc1krkBC91NBQA7MJc/MoAdmMq
/cYJm4nLmpWtw2ntB1VSMo67vQNwDijD/uYeylgkTt9j4kw5lVzTilKhXjBaMs44
8rCI9YQ5vfyUFpWxXOoJ303oMTtAClkUSENpU1WRSJtDrn3Squy28FopZ5y4O7t9
eARinl9OgbI7goVnQ+iDWSkRx5ibeQ8C0T1plwMVcGKp8Xdi3uQ=
=qwzb
-----END PGP SIGNATURE-----
--- End Message ---