Discussion:
[ast-developers] Renaming .sh.sig.value.q and .sh.sig.value.Q to .sh.sig.value.int and .sh.sig.value.objrej?
Cedric Blancher
2013-09-14 09:42:03 UTC
Permalink
David, I have to agree with Olga that the new names, i.e.
.sh.sig.value.q and .sh.sig.value.Q are not very useful - they lack at
least the self-describing nature and alienate the users of other
platforms like C/C++, perl, python and likely others.

But I understand your concern about the name "ptr" too, so lets try
with Olga's palm leave solution and use .sh.sig.value.objref.

Patch is attached.

Ced

---------- Forwarded message ----------
From: ????? ???????????? <olga.kryzhanovska at gmail.com>
Date: 14 September 2013 01:08
Subject: Re: [ast-developers] AT&T Software Technology ast alpha
software download update
To: Glenn Fowler <gsf at research.att.com>
Cc: "ast-developers at research.att.com" <ast-developers at research.att.com>


There is a BIG issue with signals in this release. A lot of signal
related tests fail, with memory corruption:

test basic begins at 2013-09-14+00:47:47
corrupted data:region=0xfffffd7ffb590eb0:block=0xfffffd7ffb49c890:bad
byte at=904:
basic.sh[320]: ALRM signal not working
test basic failed at 2013-09-14+00:48:46 with exit code 1 [ 109 tests 1 error ]
test basic(shcomp) begins at 2013-09-14+00:48:46
corrupted data:region=0xfffffd7ffb590eb0:block=0xfffffd7ffb49c890:bad
byte at=904:
shcomp-basic.ksh[320]: ALRM signal not working
test basic(shcomp) failed at 2013-09-14+00:49:46 with exit code 1 [
109 tests 1 error ]

Olga

P.S.: I dislike the idea of renaming .sh.sig.int to .sh.sig.q. Its a
torture for people. Could you not just accept .sh.sig.int and
.sh.sig.objref, or stick with .sh.sig.int and.sh.sig.ptr? The name
"ptr" is used even by perl and python.
the AT&T Software Technology ast alpha 2013-09-13 source release
has been posted to the download site
http://www.research.att.com/sw/download/alpha/
the package names and md5 checksums are
INIT 327861e49e24dd51079c0a5316a4b2fe
ast-open dfb85d1dfb20acb8a1529bdf4b8cb89a
ast-ksh 746a556a2259aaa6d75468000e5bc36b
the md5 sums should match the ones listed on the download page
the change logs below are limited to ksh and libast
the libast changes involved a lot of meticulous multibyte code
that was hashed out off-list between { gsf roland olga }
there is a "news" link in the left side nav bar that will
be used to detail implemented and proposed ast features
as features mature the news info will migrate to the man pages
if your favorite bug/feature is not in the list below then it
hasn't been addressed yet and we don't know exactly when it will be
changes since 2013-08-29
13-09-13 --- Release ksh93v- ---
13-09-13 +The signal .sh.value variable is now a compound variable with the name
value.q corresponding to kill -q signed-integer and value.Q corresponding
to kill -Q unsigned-large-integer.
13-09-13 A bug in $(...) command substitution that corrupted a trailing
multibyte character in non-UTF-8 locales has been fixed.
13-09-13 Eliminted extranesous output of standard error when ksh is invoked
with the -v (verbose) option.
13-09-10 A bug in finding a function defined inside a type that was defined
in a namespace has been fixed.
13-09-10 A bug in the binding of function local variables inside arithmeitc
expression inside namespaces was fixed.
13-09-10 +A -Q option was added to kill to pass integers as large as pointers.
The -q option now only accepts integers as large as typeset -i.
13-09-09 A bug in command substitution has been fixed.
13-09-09 Qualified print format "%([no]unicode)q" added to prefer \u[...]
over \w[...] and override LC_OPTIONS=unicode.
13-09-04 +\w[hex] locale-specific code point literals have been added.
13-09-04 +The float(f) math function was added.
13-09-04 +The int(f) math function was fixed to return 0 for floating point
numbers larger than the maximum integer.
13-09-04 A bug in which assigning a compound indexed array a value of () did
not preserve the -C attribute has been fixed.
13-09-04 kill -q can now pass numbers as large as typeset -li and
.sh.sig.value is typeset -i rather than a compound variable.
13-09-04 kill -q yields the processor and returns 2 when siqueue fails with
EAGAIN and yield.
13-09-03 A bug in which $((x.xxx)) where x is a floating point variable and
xxx is not one of the known extensions yields a random value has
been fixed. It now is unset which has value 0 when set -u is off.
13-09-03 A bug in overriding discipline functions for types defined in
namespaces has been fixed.
13-09-03 A bug which on some systems caused a core dump for large <<< here
documents has been fixed.
13-09-12 misc/fgetcwd.c: fix stat corruption bug on systems without fdopendir()
13-09-12 path/pathcanon.c: fix bug that added extra / when fgetcwd() returned /
13-09-09 comp/setlocale.c,port/codeset.c: consistent handling of US-ASCII + conformance(0,0) across all os's
13-09-09 string/utf8towc.c,string/wctoutf8.c: add { utf8toutf32() utf8towc() wctoutf8() }
13-09-07 include/ast_std.c,comp/setlocale.c,string/stresc.c: add ast.byte_max for single byte locales
13-09-06 comp/iconv.c: add sfclrerr() to iconv_move() if all input chars not consumed
13-09-06 port/codeset.h,port/codeset.c: internal api for retrieving locale codeset names
13-09-04 string/chresc.c,stresc.c: add \w[hex] support -- thanks Roland
13-09-04 string/utf32stowcs.c,string/wcstoutf32s.c: add -- thanks Roland
13-09-04 sfio/sfsetbuf.c: fix bug where SF_GETR mode was not cleared causing subsequent memory corruption
13-09-04 vmalloc/vmopen.c,vmdcsystem.c,vmstat.c: temporarily set vm->meth.meth=0 to disable vmstat() during init
13-09-04 port/intercept.c: include <ast_standards.h> to ensure fdopendir() prototype if _lib_fdopendir
13-09-04 include/ast_std.h,comp/setlocale.c: add LC_OPTIONS=unicode and AST_LC_unicode
13-08-29 cdt/dtstrhash.c: change sign-bit hitting fnv constants to hex to silence unsigned warnings
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
--
, _ _ ,
{ \/`o;====- Olga Kryzhanovska -====;o`\/ }
.----'-/`-/ olga.kryzhanovska at gmail.com \-`\-'----.
`'-..-| / http://twitter.com/fleyta \ |-..-'`
/\/\ Solaris/BSD//C/C++ programmer /\/\
`--` `--`
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
-------------- next part --------------
diff -r -u src/cmd/ksh93/data/variables.c src/cmd/ksh93/data/variables.c
--- src/cmd/ksh93/data/variables.c 2013-09-13 19:25:27.000000000 +0200
+++ src/cmd/ksh93/data/variables.c 2013-09-14 11:04:49.246489135 +0200
@@ -129,8 +129,8 @@
"status", NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
"uid", NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
"value", NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_NODISC,
- "value.q", NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
- "value.Q", NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_UNSIGN|NV_INTEGER|NV_LONG,
+ "value.int", NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_INTEGER,
+ "value.objref", NV_RDONLY|NV_MINIMAL|NV_NOFREE|NV_UNSIGN|NV_INTEGER|NV_LONG,
"", 0
};

diff -r -u src/cmd/ksh93/sh/init.c src/cmd/ksh93/sh/init.c
--- src/cmd/ksh93/sh/init.c 2013-09-13 19:29:13.000000000 +0200
+++ src/cmd/ksh93/sh/init.c 2013-09-14 11:05:36.759202314 +0200
@@ -2151,11 +2151,11 @@
nv_setsize(np,16);
np->nvalue.llp = (Sflong_t*)&sip->si_addr;
np = create_svar(SH_SIG,"value",0,fp);
- np = create_svar(SH_SIG,"value.q",0,fp);
+ np = create_svar(SH_SIG,"value.int",0,fp);
nv_setsize(np,10);
np->nvalue.ip = &(sip->si_value.sival_int);
- np = create_svar(SH_SIG,"value.Q",0,fp);
- nv_setsize(np,10);
+ np = create_svar(SH_SIG,"value.objref",0,fp);
+ nv_setsize(np,16);
np->nvalue.llp = (Sflong_t*)&(sip->si_value.sival_ptr);
}
#endif
diff -r -u src/cmd/ksh93/tests/signal.sh src/cmd/ksh93/tests/signal.sh
--- src/cmd/ksh93/tests/signal.sh 2013-09-13 19:41:38.000000000 +0200
+++ src/cmd/ksh93/tests/signal.sh 2013-09-14 11:03:24.669683953 +0200
@@ -444,7 +444,7 @@
then compound -a rtar
function rttrap
{
- integer v=${.sh.sig.value.q}
+ integer v=${.sh.sig.value.int}
integer s=${#rtar[v][@]}
integer rtnum=$1
rtar[$v][$s]=(
@@ -516,8 +516,8 @@
trap 'c.car[c.cari++]=.sh.sig' USR1
kill -q4 -s USR1 $$
kill -q5 -s USR1 $$
-(( c.car[0].value.q == 4 )) || err_exit "\${c.car[0].value.q} is ${c.car[0].value.q} but should be 4"
-(( c.car[1].value.q == 5 )) || err_exit "\${c.car[1].value.q} is ${c.car[1].value.q} but should be 5"
-[[ ${c.car[1].value.q} == 5 ]]
+(( c.car[0].value.int == 4 )) || err_exit "\${c.car[0].value.int} is ${c.car[0].value.int} but should be 4"
+(( c.car[1].value.int == 5 )) || err_exit "\${c.car[1].value.int} is ${c.car[1].value.int} but should be 5"
+[[ ${c.car[1].value.int} == 5 ]]

exit $((Errors<125?Errors:125))
diff -r -u src/cmd/ksh93/tests/variables.sh src/cmd/ksh93/tests/variables.sh
--- src/cmd/ksh93/tests/variables.sh 2013-09-13 19:40:25.000000000 +0200
+++ src/cmd/ksh93/tests/variables.sh 2013-09-14 11:05:04.506469256 +0200
@@ -679,8 +679,8 @@

[[ ${!.sh.sig@} == *.sh.sig.pid* ]] || err_exit '.sh.sig.pid not in ${!.sh.sig@]}'
[[ ${!.sh.sig@} == *.sh.sig.status* ]] || err_exit '.sh.sig.status not in ${!.sh.sig@]}'
-[[ ${!.sh.sig@} == *.sh.sig.value.q* ]] || err_exit '.sh.sig.value.q not in ${!.sh.sig@]}'
-[[ ${!.sh.sig@} == *.sh.sig.value.Q* ]] || err_exit '.sh.sig.value.Q not in ${!.sh.sig@]}'
+[[ ${!.sh.sig@} == *.sh.sig.value.int* ]] || err_exit '.sh.sig.value.int not in ${!.sh.sig@]}'
+[[ ${!.sh.sig@} == *.sh.sig.value.objref* ]] || err_exit '.sh.sig.value.objref not in ${!.sh.sig@]}'

unset x
integer x=1
Irek Szczesniak
2013-09-14 13:03:50 UTC
Permalink
On Sat, Sep 14, 2013 at 11:42 AM, Cedric Blancher
Post by Cedric Blancher
David, I have to agree with Olga that the new names, i.e.
.sh.sig.value.q and .sh.sig.value.Q are not very useful - they lack at
least the self-describing nature and alienate the users of other
platforms like C/C++, perl, python and likely others.
But I understand your concern about the name "ptr" too, so lets try
with Olga's palm leave solution and use .sh.sig.value.objref.
Patch is attached.
I agree with Cedric. Either keep .sh.sig.value.int+.sh.sig.value.ptr
to retain commonality with other languages (C/C++, perl, python, maybe
even more) or - as alternative - use Cedric's solution in the patch.

Irek
Joshuah Hurst
2013-09-15 11:46:36 UTC
Permalink
Post by Irek Szczesniak
On Sat, Sep 14, 2013 at 11:42 AM, Cedric Blancher
Post by Cedric Blancher
David, I have to agree with Olga that the new names, i.e.
.sh.sig.value.q and .sh.sig.value.Q are not very useful - they lack at
least the self-describing nature and alienate the users of other
platforms like C/C++, perl, python and likely others.
But I understand your concern about the name "ptr" too, so lets try
with Olga's palm leave solution and use .sh.sig.value.objref.
Patch is attached.
I agree with Cedric. Either keep .sh.sig.value.int+.sh.sig.value.ptr
to retain commonality with other languages (C/C++, perl, python, maybe
even more) or - as alternative - use Cedric's solution in the patch.
I'd prefer .sh.sig.value.int and .sh.sig.value.ptr to keep the API
identical across platforms and programming languages.

Josh
David Korn
2013-09-16 17:02:37 UTC
Permalink
cc: ast-developers at research.att.com
Subject: Re: Renaming .sh.sig.value.q and .sh.sig.value.Q to .sh.sig.value.int and .sh.sig.value.objrej?
--------
Post by Cedric Blancher
P.S.: I dislike the idea of renaming .sh.sig.int to .sh.sig.q. Its a
torture for people. Could you not just accept .sh.sig.int and
.sh.sig.objref, or stick with .sh.sig.int and.sh.sig.ptr? The name
"ptr" is used even by perl and python.
The shell does not have pointers so ptr makes no sense.

The fact that perl uses ptr is not a good argument. The shell is not
perl and doesn't want to be perl. It provides a higher level
of abstraction and does not try to be a C interpreter.

You have to think of this from the point of view of the shell
programmer that does not know C.

Alll they know is that kill -q sends a signed integer, and
kill -Q sends an unsigned large integer along with the signal.
Unfortunately, the received doesn't know which of these
was sent, and therefore has to display both. If I know, then
the name would just be value.

Therefore, I need names that will identify the value of sent with -q
and the value sent with -Q. I could have used signint for -q and unsignint
and -Q for unsigned int, but felt that q and Q were simpler and more
descriptive. They don't repy on knowing the underlying C
interface.

Unless I hear a good reason, I am not likely to change it.

I listended to earlier feedback about using the shell for
intermediates between C programs and added -Q. At this point I don't
know of better names for value.q and value.Q that would be better for
non-C programmers to understand.



David Korn
dgk at research.att.com

Loading...