kevinlawler / kona

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

k_test segfault on bench/apl.k #465

Open ibara opened 7 years ago

ibara commented 7 years ago

Hi --

On an OpenBSD/amd64 machine, kona (more precisely: k_test) segfaults while running the bench/apl.k program. I'll note that k itself has no issues running the program.

Here's the lead-up:

int add         58640
fp add          68210
int mult        83920
fp mult         85530
index           1460
char compr      480
int compr       510
int + red       300
int | red       320
bool scan       43210
mat rotate      32090
char trans      32640
int trans       33320
vec of vecs     47380
partition       1167910
Segmentation fault (core dumped)

Backtrace is attached below. Let me know if you need more information. k_test.txt

tavmem commented 7 years ago

Running "~/kona/k_test ~/kona/bench/apl.k" on Fedora-26 also segfaults:

int add     9818
fp add      11754
int mult    13781
fp mult     15835
index       275
char compr  80
int compr   80
int + red   60
int | red   60
bool scan   8403
mat rotate  5995
char trans  2077
int trans   4334
vec of vecs 9458
partition   227700
Segmentation fault (core dumped)

Similar to your experience, running "~/kona/k ~/kona/bench/apl.k" works fine on Fedora-26:

Running Tests...
int add     1201
fp add      1198
int mult    1223
fp mult     1206
index       0
char compr  0
int compr   0
int + red   0
int | red   0
bool scan   116
mat rotate  87
char trans  1042
int trans   3427
vec of vecs 0
partition   1
shape each  0
vec compar  0
int sort    0
bool compar 0
iota        50
1201 1198 1223 1206 0 0 0 0 0 116 87 1042 3427 0 1 0 0 0 0 50
[tom@new-host-3 kona]$ 

I think that the benchmark tests were designed to measure the performance of ~/kona/k and not ~/kona/k_test
I grant that ~/kona/k_test should not segfault, but I'm not sure what is to be gained by fixing k_test here.