Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

21 views
Skip to first unread message

Janis Papanagnou

unread,
Sep 21, 2022, 6:14:36 AM9/21/22
to
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

Martijn Dekker

unread,
Sep 22, 2022, 12:42:50 PM9/22/22
to
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


Janis Papanagnou

unread,
Sep 22, 2022, 3:17:26 PM9/22/22
to
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

Martijn Dekker

unread,
Sep 23, 2022, 5:52:38 PM9/23/22
to
Op 22-09-22 om 21:17 schreef Janis Papanagnou:
The search for a fix is on at: https://github.com/ksh93/ksh/issues/537
0 new messages