Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertion fail in ChoiceEndChoice() #239

Closed
kcwu opened this issue Nov 23, 2016 · 3 comments · May be fixed by #264
Closed

assertion fail in ChoiceEndChoice() #239

kcwu opened this issue Nov 23, 2016 · 3 comments · May be fixed by #264
Labels
Milestone

Comments

@kcwu
Copy link
Member

kcwu commented Nov 23, 2016

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 kcwu added the bug label Nov 23, 2016
@kcwu
Copy link
Member Author

kcwu commented Nov 23, 2016

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

@kcwu
Copy link
Member Author

kcwu commented Nov 23, 2016

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

@czchen
Copy link
Member

czchen commented Nov 23, 2016

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

Billy4195 added a commit to Billy4195/libchewing that referenced this issue May 23, 2017
Fix chewing#239
This issue is because of the chiSymbolCursor be reset to incorrect
oldChiSymbolCursor.
This commit can prevent the chiSymbolCursor be reset to incorrect
oldChiSymbolCursor value happened in chewing#239, because the
oldChiSymbolCursor will be reset as the current chiSymbolCursor
after chewing_handle_Default().
@kanru kanru added this to the v0.8.0 milestone May 8, 2024
@kanru kanru closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants