Inbuilt KORN Arithmetic & Test functions broken under Windows Subsystem for Linux

Hello

I seem to have come across an abnormality, with the Ubuntu ( DEBIAN ) KORN Shell package [
Version AJM 93u+ 2012-08-01 ] when it is running under the Windows Subsystem for Linux.

Basic inbuilt arithmetic and test functions appear to be broken for long lengths under WSL

<-- Beging Test Script -->

#!/bin/ksh

Y=1
Z=1
X=7680072911
C=1
until [ ${C} -eq 50 ]
do
typeset -i -l Y=$(( ${Y} + ${Y} + ${X} ))
typeset -i -l Z=$( echo “(${Z} + ${Z} + ${X})” | bc )
print “C=${C},Y=${Y},Z=${Z}, $( [ ${Y} -ne ${Z} ] && print Error || print Ok )”
C=$(( ${C} + 1 ))
done

<-- End Test Script -->

The test script returns significantly different results on standard KORN Version AJM 93u+ 2012-08-01 running under Ubuntu, Darwin, etc as opposed to running under the WSL.

<-- Ubuntu, Darwin, -->

C=1,Y=7680072913,Z=7680072913, Ok
C=2,Y=23040218737,Z=23040218737, Ok
C=3,Y=53760510385,Z=53760510385, Ok
C=4,Y=115201093681,Z=115201093681, Ok
C=5,Y=238082260273,Z=238082260273, Ok
C=6,Y=483844593457,Z=483844593457, Ok
C=7,Y=975369259825,Z=975369259825, Ok
C=8,Y=1958418592561,Z=1958418592561, Ok
C=9,Y=3924517258033,Z=3924517258033, Ok
C=10,Y=7856714588977,Z=7856714588977, Ok
C=11,Y=15721109250865,Z=15721109250865, Ok
C=12,Y=31449898574641,Z=31449898574641, Ok
C=13,Y=62907477222193,Z=62907477222193, Ok
C=14,Y=125822634517297,Z=125822634517297, Ok
C=15,Y=251652949107505,Z=251652949107505, Ok
C=16,Y=503313578287921,Z=503313578287921, Ok
C=17,Y=1006634836648753,Z=1006634836648753, Ok
C=18,Y=2013277353370417,Z=2013277353370417, Ok
C=19,Y=4026562386813745,Z=4026562386813745, Ok
C=20,Y=8053132453700401,Z=8053132453700401, Ok
C=21,Y=16106272587473713,Z=16106272587473713, Ok
C=22,Y=32212552855020337,Z=32212552855020337, Ok
C=23,Y=64425113390113585,Z=64425113390113585, Ok
C=24,Y=128850234460300081,Z=128850234460300081, Ok
C=25,Y=257700476600673073,Z=257700476600673073, Ok
C=26,Y=515400960881419057,Z=515400960881419057, Ok
C=27,Y=1030801929442911025,Z=1030801929442911025, Ok
C=28,Y=2061603866565894961,Z=2061603866565894961, Ok
C=29,Y=4123207740811862833,Z=4123207740811862833, Ok
C=30,Y=8246415489303798577,Z=8246415489303798577, Ok
C=31,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=32,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=33,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=34,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=35,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=36,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=37,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=38,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=39,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=40,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=41,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=42,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=43,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=44,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=45,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=46,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=47,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=48,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=49,Y=-9223372036854775808,Z=-9223372036854775808, Ok

<<-- WSL with the Ubuntu 16.04 & 18.04 LTS & Debian GNU/Linux Packages -->

C=1,Y=7680072913,Z=7680072913, Ok
C=2,Y=23040218737,Z=23040218737, Ok
C=3,Y=53760510385,Z=53760510385, Ok
C=4,Y=115201093681,Z=115201093681, Ok
C=5,Y=238082260273,Z=238082260273, Ok
C=6,Y=483844593457,Z=483844593457, Ok
C=7,Y=975369259825,Z=975369259825, Ok
C=8,Y=1958418592561,Z=1958418592561, Ok
C=9,Y=3924517258033,Z=3924517258033, Ok
C=10,Y=7856714588977,Z=7856714588977, Ok
C=11,Y=15721109250865,Z=15721109250865, Ok
C=12,Y=31449898574641,Z=31449898574641, Ok
C=13,Y=62907477222193,Z=62907477222193, Ok
C=14,Y=125822634517297,Z=125822634517297, Ok
C=15,Y=251652949107505,Z=251652949107505, Ok
C=16,Y=503313578287921,Z=503313578287921, Ok
C=17,Y=1006634836648753,Z=1006634836648753, Ok
C=18,Y=2013277353370417,Z=2013277353370417, Ok
C=19,Y=4026562386813745,Z=4026562386813745, Ok
C=20,Y=8053132453700401,Z=8053132453700401, Ok
C=21,Y=16106272587473712,Z=16106272587473713, Ok
C=22,Y=32212552855020336,Z=32212552855020337, Ok
C=23,Y=64425113390113584,Z=64425113390113585, Ok
C=24,Y=128850234460300080,Z=128850234460300081, Ok
C=25,Y=257700476600673056,Z=257700476600673073, Error
C=26,Y=515400960881419008,Z=515400960881419057, Error
C=27,Y=1030801929442910976,Z=1030801929442911025, Ok
C=28,Y=2061603866565894912,Z=2061603866565894961, Ok
C=29,Y=4123207740811862528,Z=4123207740811862833, Error
C=30,Y=8246415489303797760,Z=8246415489303798577, Error
C=31,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=32,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=33,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=34,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=35,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=36,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=37,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=38,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=39,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=40,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=41,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=42,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=43,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=44,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=45,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=46,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=47,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=48,Y=-9223372036854775808,Z=-9223372036854775808, Ok
C=49,Y=-9223372036854775808,Z=-9223372036854775808, Ok

Has anyone else come across abnormalities effecting the standard functionality of the KORN shell running under WSL ???

Is this a DEBIAN / Ubuntu bug or a windows WSL bug ?

Mark

Check the link at the top. This is not a place to post technical support questions. Use IRC, the Ubuntu Forums, or askubuntu.com for help.

About the Flavors category
For discussions affecting official Ubuntu Flavours.

Its a discussion about something effecting ubuntu flavours.

I’m afraid it is not. The Windows Subsystem for Linux does not affect Kubuntu, Lubuntu, Xubuntu, Ubuntu MATE, Ubuntu Studio, Ubuntu Budgie, or Ubuntu Kylin.

I think you should look at the base flavours that M$ has on its store for running inside the WSL.
Ubuntu 16.04 LTS, 18.04 LTS, Kali and Debian. all sourcing packages from …

Doesn’t matter. The official Ubuntu flavors do not run on the Windows Subsystem for Linux.

The official user space environments do

Are you trying to report a bug then? If so, this is still the wrong place for this discussion.

Its a discussion, regarding the interoperability of a major Shell ( KORN ) and its abnormalities in one of the runtime environments that the DEBIAN package, sourced form Ubuntu, runs on.

Please report the bug here. Any discussion here will get nothing done.

The BUG is already reported eeickmeyer, [ https://bugs.launchpad.net/ubuntu/+source/ksh/+bug/1818596 ], this is the discussion and awareness on the issue.

Your link is broken. Filing a bug report is all the awareness of the issue you need to bring attention to.

This is an offical flavour [ https://docs.microsoft.com/en-us/windows/wsl/enterprise ]

I’m afraid it is not. A list of official flavors is found here.

Cleary says Ubuntu 18.04 [ Canonical Group Limited ] on the link.

Which community forum group deals with the WSL ?

All those flavours source the KORN Shell DEBIAN package from the same source as the WSL.

Considering the WSL is a product of Microsoft, you would have to ask them. That said, if you look at the bottom of the Ubuntu download in the Windows store, the support link directs you to askubuntu.com. However, I’d try the General Help section in the Ubuntu Forums. If it doesn’t fit in that section, the mods are generally good at moving it to the correct section.

Its not a general help question, the bug has been filed, it’s a discussion / awareness point highlighting an issue with Korn that is sourced from ubuntu and available on all flavours.

This thread appears to have spiraled out of control. Please take a moment to consider if this is a worthwhile point to argue. A bug has been raised, awareness has been increased.

This isn’t a technical support site, but the fact that something behaves differently in one flavour (whether you deem it official or not) is certainly “interesting”.

Whether or not the behavioural differences are uniq, or isolated to KORN, is the real question.