-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
[macOS 12.3 ARM64] /usr/bin/awk: towc: multibyte conversion failure on: '��@' #190
Comments
OK, was a problem on my side. My |
The search for the error message finds two similar reports
The version format and another error message "input record number ... source line number ..." imply that this is a variant of nawk. However, the source code that contains the error message "towc: multibyte conversion failure on" does not seem to be found in GitHub or by Google. I guess the awk implementation is closed source. |
Thank you for the report. I'm not sure if I can fix or work around it soon, but I would like to keep it open so that other users can find it. |
Maybe rename awk to gawk and force darwin users to get a recent GNU awk? |
@SuperSandro2000 Thank you for your comment! Yeah, I think that is the valid workaround. Currently, ble.sh selects the Nevertheless, if it is possible, I'd like to support the macOS awk. |
I can provide you the following data on a recent macOS 12.3.1
The binary says that it's |
Thank you for the information! I have searched for the string |
I asked in the Apple Developer Forums. |
I found the source code of The source code contains the exact error message. Awk-32 seems to be the release version just coming after awk-27.40.1. The feature difference is explained here. I have built it in Linux with the following modification diff --git a/src/b.c b/src/b.c
index cfffcb9..fa03d40 100644
--- a/src/b.c
+++ b/src/b.c
@@ -31,7 +31,9 @@ THIS SOFTWARE.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <xlocale.h>
+//#include <xlocale.h>
+#include <locale.h>
+typedef int wctype_t;
#include <wchar.h>
#include "awk.h"
#include "awkgram.tab.h"
@@ -1256,6 +1258,7 @@ static int cclex(void) {
len = 1;
prestr += 2;
+#if 0
__collate_lookup_l(&collate_elem, &len, &prim1, &sec1, LC_GLOBAL_LOCALE);
DPRINTF("collate_elem: 0x%x p: %d s:%d\n", collate_elem, prim1, sec1);
@@ -1280,6 +1283,7 @@ static int cclex(void) {
n++;
}
}
+#endif
}
} else if (wc == '\0') {
FATAL("nonterminated character class %.20s", lastre); I thought maybe I can reproduce the problem using the obtained awk-32, but |
@tessus Sorry, I think it's not your intention, but I used the VM to quickly check the behavior of the current % bash --version
GNU bash, version 5.2.26(1)-release (x86_64-apple-darwin22.6.0)
% what /usr/bin/awk
/usr/bin/awk:
PROGRAM:awk PROJECT:awk-35
PROGRAM:awk PROJECT:awk-35
% head -c 32 /dev/urandom | awk '{print "hello"}' In the past, Now the awk version seems to be |
@akinomyoga don't worry about it. it is a dev test VM and you can use it for whatever tests you need. If it helps I can leave it running for a few weeks. You can even destroy it, and if you need it I can rollback to the point before you logged in for the first time. Just drop me a quick email if you need a rollback. Btw, when I tried to install ble (via the make command) on the VM, ble complained that it wanted gawk. I did a |
Thanks, by excluding I also complied |
GNU bash, version 5.1.16(1)-release (aarch64-apple-darwin21.1.0)
ble.sh, version 0.4.0-devel3+d340233 (noarch)
bash-preexec (iterm2_shell_integration.sh), iterm2_shell_integration.sh (noarch) (integration: on)
locale: LANG=de_DE.UTF-8 LC_COLLATE=C LC_TERMINAL=iTerm2 LC_TERMINAL_VERSION=3.4.15
terminal: TERM=xterm-256color wcwidth=12.1-west/13.1-2+ri, xterm:95 (0;95;0)
So, I changed to a new MacBook with the AppleARM chip. If I do a on a path (or
blesh
tries by itself), the following error fragment are thrown.Here is the "output" of
/usr/bin/awk --version
:The text was updated successfully, but these errors were encountered: