libchewing icon indicating copy to clipboard operation
libchewing copied to clipboard

assertion fail in ChoiceEndChoice()

Open kcwu opened this issue 9 years ago • 3 comments

How to reproduce

$ xxd -r > assert-AddChi
00000000: 4406 06c4 0030 3c                        D....0<
$ ./configure
$ make all check
$ ./test/stress -loop 1 -extra -file assert-AddChi
stress: choice.c:477: int ChoiceEndChoice(ChewingData *): Assertion `pgdata->chiSymbolCursor <= pgdata->chiSymbolBufLen' failed.

This is due to buggy code of cursor manipulation introduced by EasySymbolInput. cc original author of EasySymbolInput, @PCMan

kcwu avatar Nov 23 '16 02:11 kcwu

@PCMan could you please take a look? The code is messy and hard to understand for others.

kcwu avatar Nov 23 '16 02:11 kcwu

One key function call is chewing_set_maxChiSymbolLen(0). I'm not sure what does MIN_CHI_SYMBOL_LEN=0 mean.

kcwu avatar Nov 23 '16 11:11 kcwu

MIN_CHI_SYMBOL_LEN means the minimal valid input for function chewing_set_maxChiSymbolLen. I think it shall be 1 instead of 0.

czchen avatar Nov 23 '16 16:11 czchen