-
Notifications
You must be signed in to change notification settings - Fork 154
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
ksh93 dumps core in emacs mode while entering characters in different locale. #6
Labels
Comments
@lijog Are you able to reproduce it if you build from current master branch ? |
I am closing this bug due to lack of activity. Please reopen if it is still reproducible. |
citrus-it
added a commit
to citrus-it/ast
that referenced
this issue
Dec 30, 2020
citrus-it
added a commit
to citrus-it/ast
that referenced
this issue
Dec 30, 2020
citrus-it
added a commit
to citrus-it/ast
that referenced
this issue
Jan 4, 2021
citrus-it
added a commit
to citrus-it/ast
that referenced
this issue
Jan 4, 2021
citrus-it
added a commit
to citrus-it/ast
that referenced
this issue
Jan 4, 2021
citrus-it
added a commit
to citrus-it/ast
that referenced
this issue
Jan 5, 2021
citrus-it
added a commit
to citrus-it/ast
that referenced
this issue
Jan 5, 2021
citrus-it
added a commit
to citrus-it/ast
that referenced
this issue
Jan 8, 2021
citrus-it
added a commit
to citrus-it/ast
that referenced
this issue
Jan 8, 2021
McDutchie
added a commit
to ksh93/ksh
that referenced
this issue
Jan 8, 2021
This change is pulled from here: https://github.com/oracle/solaris-userland/blob/master/components/ksh93/patches/240-22461939.patch Information: att#6 George Lijo wrote on 14 Mar 2016: > I observed this issue in a Solaris 11 system on ksh2012-08-01 > [...]. The issue can be reproduced if we add Asian locales to > ibus (such as Korean). In the ksh93 shell prompt, input some > Asian character. ksh promptly dumps core [...]. > > The coredump happens at the following line no 320 in > src/cmd/ksh93/edit/emacs.c > if(c!='\t' && c!=ESC && !isdigit(c)). > > I referred the vi.c code and added the digit(c) macro, i.e. > ((c&~STRIP)==0 && isdigit(c)) and replaced the isdigit(c) usage > with the "digit(c)" macro.
citrus-it
added a commit
to citrus-it/ast
that referenced
this issue
Jan 16, 2021
gkamat
pushed a commit
to gkamat/ast
that referenced
this issue
Apr 28, 2021
Backport the ksh2020 fix for timezone name determination Partial fix for att#6.
gkamat
pushed a commit
to gkamat/ast
that referenced
this issue
Apr 28, 2021
"UTC" is the modern name for what used to be "GMT", but ksh still preferred GMT. On systems configured to use the UTC time zone, this caused a 'printf %T' regression test failure in tests/builtins.sh as the external 'data' utility will prefer UTC these days. src/lib/libast/tm/tmdata.c: - Reorder the name alternatives for UTC/GMT so that UTC is the first preference. src/cmd/ksh93/tests/builtins.sh: - Report expected and actual values on 'printf %T' failure. Related: att#6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I observed this issue in a Solaris 11 system on ksh2012-08-01, ie the master version. I guess this issue is present in the later versions too as the relevant code has not changed.
The issue can be reproduced if we add Asian locales to ibus (such as Korean).
In the ksh93 shell prompt, input some Asian character. ksh promptly dumps core with the following stacktrace.
bash-4.2$ pstack core
core 'core' of 1134: ksh
00000000004f1cf4 ed_emacsread () + 404
00000000004a5096 slowread () + 116
0000000000592d12 sfrd () + 482
000000000058b707 _sffilbuf () + 297
00000000005936ac sfreserve () + 2ac
0000000000477ae2 exfile () + 6e2
0000000000477393 sh_main () + af3
00000000004767dd main () + 4d
0000000000476614 ???????? ()
The coredump happens at the following line no 320 in src/cmd/ksh93/edit/emacs.c
i.e if(c!='\t' && c!=ESC && !isdigit(c)).
I referred the vi.c code and added the digit(c) macro, i.e
((c&~STRIP)==0 && isdigit(c)) and replaced the isdigit(c) usage with the "digit(c)" macro. Here's the patch which fixes the issue for me.
--- INIT.2012-08-01.old/src/cmd/ksh93/edit/emacs.c 2016-01-18 03:52:58.380801240 -0800
+++ INIT.2012-08-01/src/cmd/ksh93/edit/emacs.c 2016-02-05 01:39:08.350312914 -0800
@@ -90,6 +90,7 @@
static int print(int);
static int _isword(int);
define isword(c) _isword(out[c])
+# define digit(c) ((c&~STRIP)==0 && isdigit(c))
#else
define gencpy(a,b) strcpy((char_)(a),(char_)(b))
@@ -97,6 +98,7 @@
define genlen(str) strlen(str)
define print(c) isprint(c)
define isword(c) (isalnum(out[c]) || (out[c]=='_'))
+# define digit(c) isdigit(c)
#endif /*SHOPT_MULTIBYTE */
typedef struct emacs
@@ -317,7 +319,7 @@
count = 1;
adjust = -1;
i = cur;
int digit,ch;
digit = 0;
value = 0;
{
i=ed_getchar(ep->ed,0);
ed_ungetchar(ep->ed,i);
The text was updated successfully, but these errors were encountered: