Discussion:
[ast-developers] ksh 2014-01-14 beta compilation failure on OS X 10.7.5
Nathan Weeks
2014-02-05 22:03:17 UTC
Permalink
ksh 2014-01-14 fails to compile on OS X 10.7.5 (Xcode 4.6.1) due to the
following error:

========================================
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1260:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1268:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1273:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
========================================

The fix is straightforward:

========================================
--- ./src/lib/libcmd/ls.c.orig 2013-12-08 01:24:57.000000000 -0600
+++ ./src/lib/libcmd/ls.c 2014-02-04 08:34:10.000000000 -0600
@@ -1257,7 +1257,7 @@
if (!VISIBLE(state, ent))
{
fts_set(NiL, ent, FTS_SKIP);
- return;
+ return 0;
}
switch (ent->fts_info)
{
@@ -1265,12 +1265,12 @@
if (ent->fts_parent->fts_info == FTS_DNX)
break;
error(2, "%s: not found", ent->fts_path);
- return;
+ return 0;
case FTS_DC:
if (state->lsflags & LS_DIRECTORY)
break;
error(2, "%s: directory causes cycle", ent->fts_path);
- return;
+ return 0;
case FTS_DNR:
if (state->lsflags & LS_DIRECTORY)
break;
========================================

--
Nathan Weeks
IT Specialist
USDA-ARS Corn Insects and Crop Genetics Research Unit
http://weeks.public.iastate.edu/
Dr. Werner Fink
2014-02-21 14:21:06 UTC
Permalink
Post by Nathan Weeks
ksh 2014-01-14 fails to compile on OS X 10.7.5 (Xcode 4.6.1) due to the
========================================
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1260:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1268:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1273:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
========================================
========================================
--- ./src/lib/libcmd/ls.c.orig 2013-12-08 01:24:57.000000000 -0600
+++ ./src/lib/libcmd/ls.c 2014-02-04 08:34:10.000000000 -0600
@@ -1257,7 +1257,7 @@
if (!VISIBLE(state, ent))
{
fts_set(NiL, ent, FTS_SKIP);
- return;
+ return 0;
}
switch (ent->fts_info)
{
@@ -1265,12 +1265,12 @@
if (ent->fts_parent->fts_info == FTS_DNX)
break;
error(2, "%s: not found", ent->fts_path);
- return;
+ return 0;
if (state->lsflags & LS_DIRECTORY)
break;
error(2, "%s: directory causes cycle", ent->fts_path);
- return;
+ return 0;
if (state->lsflags & LS_DIRECTORY)
break;
========================================
Indeed I've similar found, also some hard crashes.

Also if one tries to add the $PWD/arch/linux.i386-64/bin to the PATH
to run the test suite with SHCOMP=$PWD/arch/linux.i386-64/bin/shcomp
and SHELL=$PWD/arch/linux.i386-64/bin/ksh the test suite crash a way.

All not enabled builtins will be found in the path $PWD/arch/linux.i386-64/bin/
even if not there. Guess: the .paths in the bin directory does not work well
with path_absolute() in src/cmd/ksh93/sh/path.c.

Also the `set -k' problem is there as the alias/hash builtins are not set BLT_DCL,
the crash with the line

ksh -c 'trap "exit 0" EXIT; typeset -T X=(typeset x; function x.get { :; }); X -a xs=((x=yo) (x=jo))'

still exists. On all architectures I see

test io(shcomp) failed at 2014-02-21+13:58:17 with exit code 269 [ 99 tests 269 errors ]

where `269' is not the number of the errors but a crash. The test scripts
treemove.sh and namespace.sh do not work with shcomp. The locale.sh script
cause the ksh to show a fortify message of the glibc

test locale begins at 2014-02-20+14:50:33
*** stack smashing detected ***: /tmp/ksh-build.LszUgz/bin/ksh terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x38)[0x3fffd30b03c]
/lib64/libc.so.6(+0x10a002)[0x3fffd30b002]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010f2fc]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010f394]
/tmp/ksh-build.LszUgz/bin/ksh[0x801128d0]
/tmp/ksh-build.LszUgz/bin/ksh[0x80112cc0]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010f6fa]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010a3f8]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010ac7e]
/tmp/ksh-build.LszUgz/bin/ksh[0x800115f8]
/tmp/ksh-build.LszUgz/bin/ksh[0x80010490]
/lib64/libc.so.6(__libc_start_main+0x114)[0x3fffd2221d8]
/tmp/ksh-build.LszUgz/bin/ksh[0x8001039a]
======= Memory map: ========
80000000-801e7000 r-xp 00000000 fc:00 629644 /tmp/ksh-build.LszUgz/bin/ksh
801e7000-801fa000 r--p 001e6000 fc:00 629644 /tmp/ksh-build.LszUgz/bin/ksh
801fa000-80202000 rw-p 001f9000 fc:00 629644 /tmp/ksh-build.LszUgz/bin/ksh
80202000-80229000 rw-p 00000000 00:00 0 [heap]
10051b87000-10051f87000 rw-p 00000000 00:00 0
3fffd1ec000-3fffd1fd000 r-xp 00000000 fc:00 1079395 /lib64/libgcc_s.so.1
3fffd1fd000-3fffd1fe000 r--p 00010000 fc:00 1079395 /lib64/libgcc_s.so.1
3fffd1fe000-3fffd1ff000 rw-p 00011000 fc:00 1079395 /lib64/libgcc_s.so.1
3fffd1ff000-3fffd201000 rw-p 00000000 00:00 0
3fffd201000-3fffd37e000 r-xp 00000000 fc:00 1079240 /lib64/libc-2.11.3.so
3fffd37e000-3fffd382000 r--p 0017c000 fc:00 1079240 /lib64/libc-2.11.3.so
3fffd382000-3fffd384000 rw-p 00180000 fc:00 1079240 /lib64/libc-2.11.3.so
3fffd384000-3fffd388000 rw-p 00000000 00:00 0
3fffd388000-3fffd38a000 r-xp 00000000 fc:00 1079274 /lib64/libutil-2.11.3.so
3fffd38a000-3fffd38b000 r--p 00002000 fc:00 1079274 /lib64/libutil-2.11.3.so
3fffd38b000-3fffd38c000 rw-p 00003000 fc:00 1079274 /lib64/libutil-2.11.3.so
3fffd38c000-3fffd38f000 r-xp 00000000 fc:00 1079246 /lib64/libdl-2.11.3.so
3fffd38f000-3fffd390000 r--p 00002000 fc:00 1079246 /lib64/libdl-2.11.3.so
3fffd390000-3fffd391000 rw-p 00003000 fc:00 1079246 /lib64/libdl-2.11.3.so
3fffd391000-3fffd392000 rw-p 00000000 00:00 0
3fffd392000-3fffd42a000 r-xp 00000000 fc:00 1079248 /lib64/libm-2.11.3.so
3fffd42a000-3fffd42b000 r--p 00097000 fc:00 1079248 /lib64/libm-2.11.3.so
3fffd42b000-3fffd42c000 rw-p 00098000 fc:00 1079248 /lib64/libm-2.11.3.so
3fffd42f000-3fffd432000 rw-p 00000000 00:00 0
3fffd432000-3fffd434000 r-xp 00000000 00:00 0 [vdso]
3fffd434000-3fffd454000 r-xp 00000000 fc:00 1079374 /lib64/ld-2.11.3.so
3fffd454000-3fffd455000 r--p 00020000 fc:00 1079374 /lib64/ld-2.11.3.so
3fffd455000-3fffd456000 rw-p 00021000 fc:00 1079374 /lib64/ld-2.11.3.so
3fffd456000-3fffd457000 rw-p 00000000 00:00 0
3fffff6f000-3fffff90000 rw-p 00000000 00:00 0 [stack]
locale.sh: line 199: 18381: Abort
locale.sh[200]: join test script failed -- exit code 262
locale.sh: line 202: out: cannot open [No such file or directory]
locale.sh[203]: LC_ALL test script failed -- expected 'f1', got ''
locale.sh: line 199: 18381: Abort
locale.sh[200]: join test script failed -- exit code 262
locale.sh: line 202: out: cannot open [No such file or directory]
locale.sh[203]: LC_ALL test script failed -- expected 'f1', got ''
test locale failed at 2014-02-20+14:50:35 with exit code 2 [ 38 tests 2 errors ]
test locale(shcomp) begins at 2014-02-20+14:50:35
/tmp/ksh-build.LszUgz/tmp1hPOkPV.PUU/shcomp-locale.ksh: line 199: 18440: Memory fault
shcomp-locale.ksh[200]: join test script failed -- exit code 267
/tmp/ksh-build.LszUgz/tmp1hPOkPV.PUU/shcomp-locale.ksh: line 202: out: cannot open [No such file or directory]
shcomp-locale.ksh[203]: LC_ALL test script failed -- expected 'f1', got ''
shcomp-locale.ksh[249]: 'LANG=C;cd _not_found_;(LANG=debug;cd _not_found_);cd _not_found_;:' failed -- exit status 260
shcomp-locale.ksh[261]: 'LANG=C;cd _not_found_;(LANG=debug;cd _not_found_);cd _not_found_;:' failed -- expected '121', got '1'
test locale(shcomp) failed at 2014-02-20+14:50:36 with exit code 4 [ 38 tests 4 errors ]

Werner
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ksh93-typedef.dif
Type: text/x-patch
Size: 391 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140221/c36fdaa2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ksh93-alias-k.dif
Type: text/x-patch
Size: 645 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140221/c36fdaa2/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ksh93-unset-f.dif
Type: text/x-patch
Size: 479 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140221/c36fdaa2/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ksh93-vi.dif
Type: text/x-patch
Size: 1305 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140221/c36fdaa2/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140221/c36fdaa2/attachment.sig>
Dr. Werner Fink
2014-02-21 14:29:36 UTC
Permalink
Post by Dr. Werner Fink
still exists. On all architectures I see
test io(shcomp) failed at 2014-02-21+13:58:17 with exit code 269 [ 99 tests 269 errors ]
where `269' is not the number of the errors but a crash.
OK gdb found from a customers core dump:

Core was generated by `/usr/bin/ksh /users/cks00/exploit/script/cks_0act.sh -b 1392927736'.
Program terminated with signal 11, Segmentation fault.
#0 sftrack (sp=0x25f40a7ca990, flag=4, data=0x5) at /usr/src/debug/ksh93/src/cmd/ksh93/sh/io.c:2415
2415 if(item->strm == sp)
(gdb) list
2410 if(pp=(struct checkpt*)shp->jmplist)
2411 {
2412 struct openlist *item;
2413 for(item=pp->olist; item; item=item->next)
2414 {
2415 if(item->strm == sp)
2416 {
2417 item->strm = 0;
2418 break;
2419 }
(gdb) print item
$1 = (struct openlist *) 0x10001
(gdb) print pp->olist
value has been optimized out
(gdb) print *item
Cannot access memory at address 0x10001
(gdb) print shp->jmplist
$2 = (jmp_buf *) 0x25f40a81dcb0
(gdb) print *shp->jmplist
$3 = {{__jmpbuf = {-6, 314, -6, 316, -6, 318, -6, 320}, __mask_was_saved = -9, __saved_mask = {__val = {0, 140588137853232, 140588140268096, 0, 0, 0, 32783537689290092,
41730078528192, 2632, 41730078115008, 1264, 0, 41730079035120, 0, 7233114627996740975, 41730078528192}}}}
(gdb) print *(struct checkpt*)shp->jmplist
$4 = {buff = {{__jmpbuf = {-6, 314, -6, 316, -6, 318, -6, 320}, __mask_was_saved = -9, __saved_mask = {__val = {0, 140588137853232, 140588140268096, 0, 0, 0, 32783537689290092,
41730078528192, 2632, 41730078115008, 1264, 0, 41730079035120, 0, 7233114627996740975, 41730078528192}}}}, prev = 0xa88, topfd = 175867072, mode = 9716, vexi = 1201,
olist = 0x25f40a851ce0, err = {context = 0x25f40a81db78, errors = 0, flags = 0, line = 245, warnings = 0, file = 0x0,
id = 0x25f40a81b361 "|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000\nu266699|9000"...}}
(gdb) print ((struct checkpt*)shp->jmplist)->olist
$5 = (struct openlist *) 0x25f40a851ce0
(gdb) print *((struct checkpt*)shp->jmplist)->olist
$6 = {strm = 0x25f40a7b84c0, next = 0x10001}
(gdb)

Werner
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140221/c02cb3fe/attachment.sig>
Nathan Weeks
2014-04-18 17:53:53 UTC
Permalink
FYI: this compilation failure with the Xcode-4.6.1-supplied Clang
still occurs with the 2014-04-15 beta.

--
Nathan Weeks
IT Specialist
USDA-ARS Corn Insects and Crop Genetics Research Unit
Crop Genome Informatics Laboratory
Iowa State University
http://weeks.public.iastate.edu/
Post by Dr. Werner Fink
Post by Nathan Weeks
ksh 2014-01-14 fails to compile on OS X 10.7.5 (Xcode 4.6.1) due to the
========================================
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1260:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1268:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1273:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
========================================
========================================
--- ./src/lib/libcmd/ls.c.orig 2013-12-08 01:24:57.000000000 -0600
+++ ./src/lib/libcmd/ls.c 2014-02-04 08:34:10.000000000 -0600
@@ -1257,7 +1257,7 @@
if (!VISIBLE(state, ent))
{
fts_set(NiL, ent, FTS_SKIP);
- return;
+ return 0;
}
switch (ent->fts_info)
{
@@ -1265,12 +1265,12 @@
if (ent->fts_parent->fts_info == FTS_DNX)
break;
error(2, "%s: not found", ent->fts_path);
- return;
+ return 0;
if (state->lsflags & LS_DIRECTORY)
break;
error(2, "%s: directory causes cycle", ent->fts_path);
- return;
+ return 0;
if (state->lsflags & LS_DIRECTORY)
break;
========================================
Indeed I've similar found, also some hard crashes.
Also if one tries to add the $PWD/arch/linux.i386-64/bin to the PATH
to run the test suite with SHCOMP=$PWD/arch/linux.i386-64/bin/shcomp
and SHELL=$PWD/arch/linux.i386-64/bin/ksh the test suite crash a way.
All not enabled builtins will be found in the path $PWD/arch/linux.i386-64/bin/
even if not there. Guess: the .paths in the bin directory does not work well
with path_absolute() in src/cmd/ksh93/sh/path.c.
Also the `set -k' problem is there as the alias/hash builtins are not set BLT_DCL,
the crash with the line
ksh -c 'trap "exit 0" EXIT; typeset -T X=(typeset x; function x.get { :; }); X -a xs=((x=yo) (x=jo))'
still exists. On all architectures I see
test io(shcomp) failed at 2014-02-21+13:58:17 with exit code 269 [ 99 tests 269 errors ]
where `269' is not the number of the errors but a crash. The test scripts
treemove.sh and namespace.sh do not work with shcomp. The locale.sh script
cause the ksh to show a fortify message of the glibc
test locale begins at 2014-02-20+14:50:33
*** stack smashing detected ***: /tmp/ksh-build.LszUgz/bin/ksh terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x38)[0x3fffd30b03c]
/lib64/libc.so.6(+0x10a002)[0x3fffd30b002]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010f2fc]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010f394]
/tmp/ksh-build.LszUgz/bin/ksh[0x801128d0]
/tmp/ksh-build.LszUgz/bin/ksh[0x80112cc0]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010f6fa]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010a3f8]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010ac7e]
/tmp/ksh-build.LszUgz/bin/ksh[0x800115f8]
/tmp/ksh-build.LszUgz/bin/ksh[0x80010490]
/lib64/libc.so.6(__libc_start_main+0x114)[0x3fffd2221d8]
/tmp/ksh-build.LszUgz/bin/ksh[0x8001039a]
======= Memory map: ========
80000000-801e7000 r-xp 00000000 fc:00 629644 /tmp/ksh-build.LszUgz/bin/ksh
801e7000-801fa000 r--p 001e6000 fc:00 629644 /tmp/ksh-build.LszUgz/bin/ksh
801fa000-80202000 rw-p 001f9000 fc:00 629644 /tmp/ksh-build.LszUgz/bin/ksh
80202000-80229000 rw-p 00000000 00:00 0 [heap]
10051b87000-10051f87000 rw-p 00000000 00:00 0
3fffd1ec000-3fffd1fd000 r-xp 00000000 fc:00 1079395 /lib64/libgcc_s.so.1
3fffd1fd000-3fffd1fe000 r--p 00010000 fc:00 1079395 /lib64/libgcc_s.so.1
3fffd1fe000-3fffd1ff000 rw-p 00011000 fc:00 1079395 /lib64/libgcc_s.so.1
3fffd1ff000-3fffd201000 rw-p 00000000 00:00 0
3fffd201000-3fffd37e000 r-xp 00000000 fc:00 1079240 /lib64/libc-2.11.3.so
3fffd37e000-3fffd382000 r--p 0017c000 fc:00 1079240 /lib64/libc-2.11.3.so
3fffd382000-3fffd384000 rw-p 00180000 fc:00 1079240 /lib64/libc-2.11.3.so
3fffd384000-3fffd388000 rw-p 00000000 00:00 0
3fffd388000-3fffd38a000 r-xp 00000000 fc:00 1079274 /lib64/libutil-2.11.3.so
3fffd38a000-3fffd38b000 r--p 00002000 fc:00 1079274 /lib64/libutil-2.11.3.so
3fffd38b000-3fffd38c000 rw-p 00003000 fc:00 1079274 /lib64/libutil-2.11.3.so
3fffd38c000-3fffd38f000 r-xp 00000000 fc:00 1079246 /lib64/libdl-2.11.3.so
3fffd38f000-3fffd390000 r--p 00002000 fc:00 1079246 /lib64/libdl-2.11.3.so
3fffd390000-3fffd391000 rw-p 00003000 fc:00 1079246 /lib64/libdl-2.11.3.so
3fffd391000-3fffd392000 rw-p 00000000 00:00 0
3fffd392000-3fffd42a000 r-xp 00000000 fc:00 1079248 /lib64/libm-2.11.3.so
3fffd42a000-3fffd42b000 r--p 00097000 fc:00 1079248 /lib64/libm-2.11.3.so
3fffd42b000-3fffd42c000 rw-p 00098000 fc:00 1079248 /lib64/libm-2.11.3.so
3fffd42f000-3fffd432000 rw-p 00000000 00:00 0
3fffd432000-3fffd434000 r-xp 00000000 00:00 0 [vdso]
3fffd434000-3fffd454000 r-xp 00000000 fc:00 1079374 /lib64/ld-2.11.3.so
3fffd454000-3fffd455000 r--p 00020000 fc:00 1079374 /lib64/ld-2.11.3.so
3fffd455000-3fffd456000 rw-p 00021000 fc:00 1079374 /lib64/ld-2.11.3.so
3fffd456000-3fffd457000 rw-p 00000000 00:00 0
3fffff6f000-3fffff90000 rw-p 00000000 00:00 0 [stack]
locale.sh: line 199: 18381: Abort
locale.sh[200]: join test script failed -- exit code 262
locale.sh: line 202: out: cannot open [No such file or directory]
locale.sh[203]: LC_ALL test script failed -- expected 'f1', got ''
locale.sh: line 199: 18381: Abort
locale.sh[200]: join test script failed -- exit code 262
locale.sh: line 202: out: cannot open [No such file or directory]
locale.sh[203]: LC_ALL test script failed -- expected 'f1', got ''
test locale failed at 2014-02-20+14:50:35 with exit code 2 [ 38 tests 2 errors ]
test locale(shcomp) begins at 2014-02-20+14:50:35
/tmp/ksh-build.LszUgz/tmp1hPOkPV.PUU/shcomp-locale.ksh: line 199: 18440: Memory fault
shcomp-locale.ksh[200]: join test script failed -- exit code 267
/tmp/ksh-build.LszUgz/tmp1hPOkPV.PUU/shcomp-locale.ksh: line 202: out: cannot open [No such file or directory]
shcomp-locale.ksh[203]: LC_ALL test script failed -- expected 'f1', got ''
shcomp-locale.ksh[249]: 'LANG=C;cd _not_found_;(LANG=debug;cd _not_found_);cd _not_found_;:' failed -- exit status 260
shcomp-locale.ksh[261]: 'LANG=C;cd _not_found_;(LANG=debug;cd _not_found_);cd _not_found_;:' failed -- expected '121', got '1'
test locale(shcomp) failed at 2014-02-20+14:50:36 with exit code 4 [ 38 tests 4 errors ]
Werner
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
David Korn
2014-05-11 19:55:50 UTC
Permalink
This has been fixed for the next update.
Post by Dr. Werner Fink
Post by Nathan Weeks
ksh 2014-01-14 fails to compile on OS X 10.7.5 (Xcode 4.6.1) due to the
========================================
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1260:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1268:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
/tmp/ast-ksh.2014-01-14/src/lib/libcmd/ls.c:1273:3: error: non-void
function 'ls' should return a value [-Wreturn-type]
return;
^
========================================
========================================
--- ./src/lib/libcmd/ls.c.orig 2013-12-08 01:24:57.000000000 -0600
+++ ./src/lib/libcmd/ls.c 2014-02-04 08:34:10.000000000 -0600
@@ -1257,7 +1257,7 @@
if (!VISIBLE(state, ent))
{
fts_set(NiL, ent, FTS_SKIP);
- return;
+ return 0;
}
switch (ent->fts_info)
{
@@ -1265,12 +1265,12 @@
if (ent->fts_parent->fts_info == FTS_DNX)
break;
error(2, "%s: not found", ent->fts_path);
- return;
+ return 0;
if (state->lsflags & LS_DIRECTORY)
break;
error(2, "%s: directory causes cycle", ent->fts_path);
- return;
+ return 0;
if (state->lsflags & LS_DIRECTORY)
break;
========================================
Indeed I've similar found, also some hard crashes.
Also if one tries to add the $PWD/arch/linux.i386-64/bin to the PATH
to run the test suite with SHCOMP=$PWD/arch/linux.i386-64/bin/shcomp
and SHELL=$PWD/arch/linux.i386-64/bin/ksh the test suite crash a way.
All not enabled builtins will be found in the path
$PWD/arch/linux.i386-64/bin/
even if not there. Guess: the .paths in the bin directory does not work well
with path_absolute() in src/cmd/ksh93/sh/path.c.
Also the `set -k' problem is there as the alias/hash builtins are not set BLT_DCL,
the crash with the line
ksh -c 'trap "exit 0" EXIT; typeset -T X=(typeset x; function x.get { :;
}); X -a xs=((x=yo) (x=jo))'
still exists. On all architectures I see
test io(shcomp) failed at 2014-02-21+13:58:17 with exit code 269 [ 99 tests 269 errors ]
where `269' is not the number of the errors but a crash. The test scripts
treemove.sh and namespace.sh do not work with shcomp. The locale.sh script
cause the ksh to show a fortify message of the glibc
test locale begins at 2014-02-20+14:50:33
*** stack smashing detected ***: /tmp/ksh-build.LszUgz/bin/ksh terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x38)[0x3fffd30b03c]
/lib64/libc.so.6(+0x10a002)[0x3fffd30b002]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010f2fc]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010f394]
/tmp/ksh-build.LszUgz/bin/ksh[0x801128d0]
/tmp/ksh-build.LszUgz/bin/ksh[0x80112cc0]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010f6fa]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010a3f8]
/tmp/ksh-build.LszUgz/bin/ksh[0x8010ac7e]
/tmp/ksh-build.LszUgz/bin/ksh[0x800115f8]
/tmp/ksh-build.LszUgz/bin/ksh[0x80010490]
/lib64/libc.so.6(__libc_start_main+0x114)[0x3fffd2221d8]
/tmp/ksh-build.LszUgz/bin/ksh[0x8001039a]
======= Memory map: ========
80000000-801e7000 r-xp 00000000 fc:00 629644
/tmp/ksh-build.LszUgz/bin/ksh
801e7000-801fa000 r--p 001e6000 fc:00 629644
/tmp/ksh-build.LszUgz/bin/ksh
801fa000-80202000 rw-p 001f9000 fc:00 629644
/tmp/ksh-build.LszUgz/bin/ksh
80202000-80229000 rw-p 00000000 00:00 0
[heap]
10051b87000-10051f87000 rw-p 00000000 00:00 0
3fffd1ec000-3fffd1fd000 r-xp 00000000 fc:00 1079395
/lib64/libgcc_s.so.1
3fffd1fd000-3fffd1fe000 r--p 00010000 fc:00 1079395
/lib64/libgcc_s.so.1
3fffd1fe000-3fffd1ff000 rw-p 00011000 fc:00 1079395
/lib64/libgcc_s.so.1
3fffd1ff000-3fffd201000 rw-p 00000000 00:00 0
3fffd201000-3fffd37e000 r-xp 00000000 fc:00 1079240
/lib64/libc-2.11.3.so
3fffd37e000-3fffd382000 r--p 0017c000 fc:00 1079240
/lib64/libc-2.11.3.so
3fffd382000-3fffd384000 rw-p 00180000 fc:00 1079240
/lib64/libc-2.11.3.so
3fffd384000-3fffd388000 rw-p 00000000 00:00 0
3fffd388000-3fffd38a000 r-xp 00000000 fc:00 1079274
/lib64/libutil-2.11.3.so
3fffd38a000-3fffd38b000 r--p 00002000 fc:00 1079274
/lib64/libutil-2.11.3.so
3fffd38b000-3fffd38c000 rw-p 00003000 fc:00 1079274
/lib64/libutil-2.11.3.so
3fffd38c000-3fffd38f000 r-xp 00000000 fc:00 1079246
/lib64/libdl-2.11.3.so
3fffd38f000-3fffd390000 r--p 00002000 fc:00 1079246
/lib64/libdl-2.11.3.so
3fffd390000-3fffd391000 rw-p 00003000 fc:00 1079246
/lib64/libdl-2.11.3.so
3fffd391000-3fffd392000 rw-p 00000000 00:00 0
3fffd392000-3fffd42a000 r-xp 00000000 fc:00 1079248
/lib64/libm-2.11.3.so
3fffd42a000-3fffd42b000 r--p 00097000 fc:00 1079248
/lib64/libm-2.11.3.so
3fffd42b000-3fffd42c000 rw-p 00098000 fc:00 1079248
/lib64/libm-2.11.3.so
3fffd42f000-3fffd432000 rw-p 00000000 00:00 0
3fffd432000-3fffd434000 r-xp 00000000 00:00 0
[vdso]
3fffd434000-3fffd454000 r-xp 00000000 fc:00 1079374
/lib64/ld-2.11.3.so
3fffd454000-3fffd455000 r--p 00020000 fc:00 1079374
/lib64/ld-2.11.3.so
3fffd455000-3fffd456000 rw-p 00021000 fc:00 1079374
/lib64/ld-2.11.3.so
3fffd456000-3fffd457000 rw-p 00000000 00:00 0
3fffff6f000-3fffff90000 rw-p 00000000 00:00 0
[stack]
locale.sh: line 199: 18381: Abort
locale.sh[200]: join test script failed -- exit code 262
locale.sh: line 202: out: cannot open [No such file or directory]
locale.sh[203]: LC_ALL test script failed -- expected 'f1', got ''
locale.sh: line 199: 18381: Abort
locale.sh[200]: join test script failed -- exit code 262
locale.sh: line 202: out: cannot open [No such file or directory]
locale.sh[203]: LC_ALL test script failed -- expected 'f1', got ''
test locale failed at 2014-02-20+14:50:35 with exit code 2 [ 38 tests 2 errors ]
test locale(shcomp) begins at 2014-02-20+14:50:35
/tmp/ksh-build.LszUgz/tmp1hPOkPV.PUU/shcomp-locale.ksh: line 199: 18440: Memory fault
shcomp-locale.ksh[200]: join test script failed -- exit code 267
cannot open [No such file or directory]
shcomp-locale.ksh[203]: LC_ALL test script failed -- expected 'f1', got ''
shcomp-locale.ksh[249]: 'LANG=C;cd _not_found_;(LANG=debug;cd
_not_found_);cd _not_found_;:' failed -- exit status 260
shcomp-locale.ksh[261]: 'LANG=C;cd _not_found_;(LANG=debug;cd
_not_found_);cd _not_found_;:' failed -- expected '121', got '1'
test locale(shcomp) failed at 2014-02-20+14:50:36 with exit code 4 [
38 tests 4 errors ]
Werner
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140511/9c232dc9/attachment.html>
Dr. Werner Fink
2014-05-14 12:37:17 UTC
Permalink
Post by David Korn
This has been fixed for the next update.
Indeed some issues are fixed but this
Post by David Korn
Post by Nathan Weeks
ksh 2014-01-14 fails to compile on OS X 10.7.5 (Xcode 4.6.1) due to the
[...]
Post by David Korn
Post by Nathan Weeks
========================================
--- ./src/lib/libcmd/ls.c.orig 2013-12-08 01:24:57.000000000 -0600
+++ ./src/lib/libcmd/ls.c 2014-02-04 08:34:10.000000000 -0600
@@ -1257,7 +1257,7 @@
if (!VISIBLE(state, ent))
{
fts_set(NiL, ent, FTS_SKIP);
- return;
+ return 0;
}
switch (ent->fts_info)
{
@@ -1265,12 +1265,12 @@
if (ent->fts_parent->fts_info == FTS_DNX)
break;
error(2, "%s: not found", ent->fts_path);
- return;
+ return 0;
if (state->lsflags & LS_DIRECTORY)
break;
error(2, "%s: directory causes cycle", ent->fts_path);
- return;
+ return 0;
if (state->lsflags & LS_DIRECTORY)
break;
========================================
is not.

Also the crash of the test script io.sh if run with shcomp is already
there, after adding a `gdb --args' in front of `$valgrind $SHELL $trace $c'
for the compile tree in shtests, I see

Program received signal SIGPIPE, Broken pipe.
0x00007ffff74b3f60 in __write_nocancel () from /lib64/libc.so.6
(gdb) up
#1 0x00000000004eeb90 in sfwr (f=0x25fffca167d0, buf=0x25fffca1a8e0, n=100, disc=0x0)
at /usr/src/packages/BUILD/ksh93/src/lib/libast/sfio/sfwr.c:209
209 if((w = syswritef(f->file,buf,n)) > 0)
#0 0x00007ffff74b3f60 in __write_nocancel () from /lib64/libc.so.6
#1 0x00000000004eeb90 in sfwr (f=0x25fffca167d0, buf=0x25fffca1a8e0, n=100, disc=0x0)
at /usr/src/packages/BUILD/ksh93/src/lib/libast/sfio/sfwr.c:209
#2 0x00000000004ddbd4 in _sfflsbuf (f=0x25fffca167d0, c=-1)
at /usr/src/packages/BUILD/ksh93/src/lib/libast/sfio/sfflsbuf.c:97
#3 0x00000000004e5f62 in sfsync (f=0x25fffca167d0) at /usr/src/packages/BUILD/ksh93/src/lib/libast/sfio/sfsync.c:133
#4 0x00000000004e5dd6 in _sfall () at /usr/src/packages/BUILD/ksh93/src/lib/libast/sfio/sfsync.c:68
#5 sfsync (f=<optimized out>) at /usr/src/packages/BUILD/ksh93/src/lib/libast/sfio/sfsync.c:94
#6 0x0000000000458385 in sh_fork (shp=0x7d09c0, flags=522, jobid=0x7fffffffc478)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/xec.c:3305
#7 0x000000000045fa53 in sh_exec (shp=0x7d09c0, t=0x25fffca52ad0, flags=0)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/xec.c:1726
#8 0x000000000045d250 in sh_exec (shp=0x7d09c0, t=0x25fffca52b70, flags=1)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/xec.c:2183
#9 0x000000000045476c in sh_subshell (shp=0x7d09c0, t=0x25fffca52b70, flags=1, comsub=3)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/subshell.c:616
#10 0x0000000000435330 in comsubst (mp=0x25fffca18900, t=0x25fffca52b70, type=3)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/macro.c:2167
#11 0x0000000000430123 in varsub (mp=0x25fffca18900) at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/macro.c:1190
#12 0x0000000000434a01 in copyto (mp=0x25fffca18900, endch=0, newquote=<optimized out>)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/macro.c:634
#13 0x00000000004364e6 in sh_macexpand (shp=0x7d09c0, argp=0x25fffca52870, arghead=0x0, flag=0)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/macro.c:245
#14 0x00000000004366d7 in sh_macpat (shp=0x3, arg=0x25fffca52870, flags=<optimized out>)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/macro.c:423
#15 0x000000000045ad7f in sh_exec (shp=0x7d09c0, t=0x25fffca52850, flags=0)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/xec.c:2924
#16 0x000000000045d09d in sh_exec (shp=0x7d09c0, t=0x25fffca52830, flags=4)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/xec.c:2286
#17 0x000000000040f317 in exfile (shp=0x7d09c0, iop=0x25fffca164d0, fno=11)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/main.c:627
#18 0x000000000040fc9a in sh_main (ac=<optimized out>, av=0x7fffffffdfc8, userinit=<optimized out>)
at /usr/src/packages/BUILD/ksh93/src/cmd/ksh93/sh/main.c:399
#19 0x00007ffff7408c36 in __libc_start_main () from /lib64/libc.so.6
#20 0x000000000040e799 in _start () at ../sysdeps/x86_64/elf/start.S:113

IMHO the socketpair had lost its reading end in case of using shcomp.

Werner
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.research.att.com/pipermail/ast-developers/attachments/20140514/cf89ab2f/attachment.sig>
Loading...