-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mention that GNU sed is needed for MacOS #169
Comments
really? i thought i'd fixed the nproc issue? i was forced to switch to 10.15 this week, but i'd been building on 10.14 before then. and building on 10.15 works for me [with just a GNU sed added to my path] right now.
yeah, unfortunately |
I tried one more time, but with The only problem that I still get is this:
A quick temporary fix that I use is to replace:
with:
P.S. 26 more tools compiled for me, compared to |
i suspect that's because you didn't make clean and your bad sed left things in a bad state? it's working fine for me. i don't see any nproc error if i build on 10.15 with the regular linux defconfig; just the expected build failures from linux-specific tools. can you reproduce the error and include it here? |
(also note that while you can build df on macos, it doesn't list all the file systems.) |
@enh-google , you might be right, thank you. But to confirm your idea I wrote a script:
It did work first four times without any issues. Fifth time, however, it produced this error:
It might be the problem that I got previously, before adding I ran this Bash script six more times. Sixth time I got the same error. So, for me it fails to compile roughly 15-20% of the time. |
Wait, config2help segfaulted? It shouldn't... This was on mac? |
@landley , yes. This is the command that fails:
Yes, I am using Mac. When I go and run
– it segfaults 22–34% of the time. Which is consistent with my previous observation that building toybox on my machine fails roughly every fifth time on average. (Also, |
if you're wondering "why haven't we seen this in asan builds?"... it's because the config2help build doesn't use $CFLAGS, so it doesn't get the ASan flags. i've sent a patch to enable asan for the host binaries too to the mailing list. (i've also sent a fix for the trivial mkflags bug it finds.) with ASan, this config2help crash is a 100% reproducible use-after-free on Linux:
|
Ok, allocated in parse(), freed on line 432 (marshalling data between lists) then used on 496. The marshalling data between lists is freeing the list wrapper structure but not the string, so something is still pointing to the old wrapper structure and didn't get updated for the new list? But dlist_zap() calls dlist_pop() which should adjust the list, is ->help pointing to an old list head? (In which case it should output noticeably wrong data? And this implies it's an entry with no usage: line it's generating help text for?) Hmmm, I inserted a memset(dd, 0xaa, sizeof(struct double_list)); at line 149 right before the free() and "make defconfig" still isn't breaking for me on Linux? (If it follows any of those pointers after the memset it should segfault. I tried "make macos_defconfig" and ran "make clean && make" five times to be sure, then did your 1000 calls loop and still didn't hit it.) |
No, grab_dashlines() uses a double_list ** and passes it to zap_blank_lines() which passes it to dlist_zap() which passes it to dlist_pop() meaning if ->help needs to be adjusted it should be adjusted. How is this pointing to an old list entry? I've reproduced the asan complaint with the android ndk, but I don't understand how it's supposed to actually happen in the code, and I have yet to make it happen by poisoning the freed memory? Hmmm... |
poisoning works for me. this is a 100% reproducible SIGSEGV crash on Linux without ASan:
(but i can't see the bug either.) |
Sigh, did gcc "optimize out" the memset if I didn't remove the free()? (Is there a way to get it to STOP DOING THAT? -fdowhatIsaynotwhatyouthinkImean) |
does this ticket relate to this? |
Did 16c0ba5 fix it? (Well, work around. I should do a proper fix, but that's what was triggering it.) |
After a month on no reply to whether the previous commit worked around it, I'm assuming it did closing this. |
(i can confirm that with the workaround i no longer see this on Linux with ASAN=1 or on macOS.) |
Building with
make
fails with errors from clang on MacOS. The reason is thatgsed
is not found and there is no warning or instruction to install it.I think, that either a warning should be added (possibly into
scripts/portability.sh
) or a note into the "Building toybox" section of README. Better both.P.S. Also, to compile toybox I had to set
CPUS=1
, comment#include "generated/newtoys.h"
in lib/help.c, and comment quite a few commands in.config
, ending up with 136 of them. (Maybe it helps someone out there.)OS version: MacOS Mojave 10.14.6
The text was updated successfully, but these errors were encountered: