• Problem with type system in ksh - Memory fault(coredump)

    From Janis Papanagnou@21:1/5 to All on Wed Sep 21 12:14:29 2022
    In my daily work I'm rarely using types (typeset -T) with ksh.
    Currently I'm playing around with it and stumbled across an error.

    I get the error in version sh (AT&T Research) 93u+ 2012-08-01
    and as well in 93u+m (alpha) that I have installed here.

    (Note: The reproducible problem arises in a larger, more complex
    program; I was unable to reduce the program and still get that
    error, specifically the excerpt below does not trigger it, but I
    use it to explain the changes [in the larger program] that made
    the coredump problem go away.)

    #!/usr/bin/ksh

    typeset -T Coord_t=( typeset -i x=0 ; typeset -i y=0)
    enum State_t=( Active Pending Finished )
    enum Dir_t=( N S W E )

    typeset -T Job_t=(
    State_t state
    Coord_t pos
    Dir_t from
    )

    The problem seems to only appear if one of the enum-types (Dir_t
    or State_t) is the first entity in the Job_t structure. Having
    the Coord_t entity first will not trigger that "Memory fault" and
    everything works smoothly.

    Has anyone observed that behavior/bug as well and can share any
    experiences or insights? (I'm reluctant to continue using types
    since it might be an unreliable feature.)

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martijn Dekker@21:1/5 to All on Thu Sep 22 18:42:42 2022
    Op 21-09-22 om 12:14 schreef Janis Papanagnou:
    (Note: The reproducible problem arises in a larger, more complex
    program; I was unable to reduce the program and still get that
    error, specifically the excerpt below does not trigger it,

    In order to trace the problem I will need a reproducer that actually
    triggers the crash. Please email me or file a bug at github.

    --
    || modernish -- harness the shell
    || https://github.com/modernish/modernish
    ||
    || KornShell lives!
    || https://github.com/ksh93/ksh

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Martijn Dekker on Thu Sep 22 21:17:20 2022
    On 22.09.22 18:42, Martijn Dekker wrote:
    Op 21-09-22 om 12:14 schreef Janis Papanagnou:
    (Note: The reproducible problem arises in a larger, more complex
    program; I was unable to reduce the program and still get that
    error, specifically the excerpt below does not trigger it,

    In order to trace the problem I will need a reproducer that actually
    triggers the crash. Please email me or file a bug at github.

    Thank you for asking! - I've just sent you a shell script by email.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martijn Dekker@21:1/5 to All on Fri Sep 23 23:52:31 2022
    Op 22-09-22 om 21:17 schreef Janis Papanagnou:
    On 22.09.22 18:42, Martijn Dekker wrote:
    In order to trace the problem I will need a reproducer that actually
    triggers the crash. Please email me or file a bug at github.

    Thank you for asking! - I've just sent you a shell script by email.

    The search for a fix is on at: https://github.com/ksh93/ksh/issues/537


    --
    || modernish -- harness the shell
    || https://github.com/modernish/modernish
    ||
    || KornShell lives!
    || https://github.com/ksh93/ksh

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)