kevinlawler / kona

Open-source implementation of the K programming language
ISC License
1.36k stars 138 forks source link

Null line causes crash after "Resume" fix #566

Closed tavmem closed 4 years ago

tavmem commented 4 years ago

If you just hit "Enter" (i.e., a null line) at the ">" symbol after type error, kona crashes.

$ rlwrap -n ./k
kona      \ for help. \\ to exit.

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  
Segmentation fault (core dumped)
$ 
tavmem commented 4 years ago

After commit titled: fix crash on issue 566 (still have a bug) entering a "null" line at ">" symbol, now causes a pop-up to top level.

kona      \ for help. \\ to exit.

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  

  :3+7
10

When getting a "null" line, k2.8 stays at "errror" level till resolved.

K 2.8 2000-10-10 Copyright (C) 1993-2000 Kx Systems
\ for help. \\ to exit.

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  
>  
>  :7+3
10 10 10 10
tavmem commented 4 years ago

After fix titled partial fix 566: Null Line no longer causes pop-up we get

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  
>
>
>
>:7+3
10 10 10 10

However, this issue is not fully resolved

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  2+2
4
    2+2
4
  2+2
4

Entering some other command like 2+2 should not cause a pop-up either. In addition, we got a double prompt (4 spaces) just before the second 2+2.

tavmem commented 4 years ago

After commit titled more progress on 566

this works

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  
>  : 7 + 3
10 10 10 10
  2+2
4

and this works

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  
>  2+2
4
>  
>  \
  2+2
4

leaving the really hard part for last

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  
>  2+2
4
>  
>  : 7 + 3
Segmentation fault (core dumped)
$
tavmem commented 4 years ago

After commit titlled resolve 2nd crash condition in 566 we get

kona      \ for help. \\ to exit.

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  2+2
4
>  : 7 + 3
>  
>  \
  2+2
4

Still need to get correct result.

tavmem commented 4 years ago

After commit noted above


kona      \ for help. \\ to exit.

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  : 7 + 3
10 10 10 10

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  2+2
4
>  : 7 + 3
10 10 10 10

  4 # 3 + "x"
type error
4 # 3 + "x"
      ^
>  2+2
4
>  2+2
4
>  : 7 + 3
10 10 10 10