Date: Mon, 2 Nov 2020 11:55:01 -0800
From: enh <e...@google.com>
To: Rob Landley <r...@landley.net>
Cc: toybox <toybox@lists.landley.net>
Subject: Re: [Toybox] [PATCH] Make it easier to switch regex
        implementations.
Message-ID:
        <CAJgzZopFOyG=nvBVwexX1xDSgA_cq_S=r0puyz7fuwaa1cg...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

On Fri, Oct 30, 2020 at 7:12 PM Rob Landley <r...@landley.net> wrote:


On 10/28/20 7:06 PM, enh via Toybox wrote:
One reason to use toybox on the host is to get the same behavior across
Android/Linux/macOS. Unfortunately (as we've seen from a few bugs) one
area where that doesn't quite work is that toybox uses the libc regular
expression implementation.
Which another reason the version of toybox you distribute should be statically
linked against bionic.
aye, but "host bionic" is a longer project with no-one funded to work on it.

?Just out of curiousity, just what is 'bionic', and why is it so special that toybox should be forced to provide a specific version for it?


Especially, when as you say, it's not a funded project!


I've come across the name (mainly here) a few times now, but as as far as I know, I don't use it or need it, so i've ignored it until now, considering it to be one of the esoteric breeds.

That's fine, and mostly what users want, but
those folks trying to get the exact same behavior everywhere might want
to switch in a known regex implementation (bionic's NetBSD regex
implementation, say) for increased consistency.
By statically linking the binaries against bionic. :)

(Did you ever fix the "hello world segfaults in a chroot that doesn't have
/dev/null because bionic's _start code does a lot with no error checking" issue?
no, that's actually a deliberate crash. that's definitely not a
supported _device_ configuration, and we deliberately minimize the
differences between host and device. (it's 99% of the point of having
host bionic in the first place!)

That actually works pretty well, but portability.h has an #ifndef test
for REG_STARTEND before including <regex.h> that gets in the way. To
make up for that, this patch removes the unnecessary #include <regex.h>
from grep.c itself.
Applied, but it's one measure of a whack-a-mole problem space.
there's never going to be a "host bionic for macOS" anyway, so this is
necessary if not sufficient.

unfortunately, something (presumably a kernel or file system change)
seems to have broken a dd test on cuttlefish, so that's the next thing
i need to look at when i can find some time:

FAIL: dd sync,noerror
echo -ne "I WANT\n" > input
echo -ne '' | dd if=input of=outFile seek=8860 bs=1M conv=sync,noerror
2>/dev/null &&
    stat -c "%s" outFile && rm -f outFile
--- expected 2020-10-29 16:10:58.647991948 -0500
+++ actual 2020-10-29 16:10:58.667991947 -0500
@@ -1 +1 @@
-9291431936
+701497344


Rob
_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to