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

assert fail in SetChoiceInfo() #240

Closed
kcwu opened this issue Nov 23, 2016 · 1 comment
Closed

assert fail in SetChoiceInfo() #240

kcwu opened this issue Nov 23, 2016 · 1 comment
Labels
Milestone

Comments

@kcwu
Copy link
Member

kcwu commented Nov 23, 2016

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=118

input

$ xxd -r > assert-SetChoiceInfo-nTotalChoice
00000000: c201 cb01 7171 7171 7171 1630 3000 7171  ....qqqqqq.00.qq
00000010: 1371                                     .q

how to reproduce:

$ ./test/stress -stdin -loop 1 -extra -file assert-SetChoiceInfo-nTotalChoice -verbose
stress: choice.c:307: void SetChoiceInfo(ChewingData *): Assertion `pci->nTotalChoice > 0' failed.

What did it do:

  1. switch to Hsu keyboard
  2. keyin "jjjjjj" (至至至)
  3. press Ctrl-3 (save user phrase size=3)
  4. keyin "$$" (two $ symbol)
  5. press [Left]
  6. keyin "jj" (至)
  7. press Ctrl-0 (symbol input) (Ctrl-1 is okay if you cannot press Ctrl-0)
  8. keyin "j"

How to reproduce using standard keyboard layout:

  1. keyin "545454" (至至至)
  2. press Ctrl-3
  3. keyin "$$"
  4. press [Left]
  5. keyin "54" (至)
  6. press Ctrl-0 or Ctrl-1
  7. keyin "j"

You can also reproduce with ./test/genkeystroke

@kcwu
Copy link
Member Author

kcwu commented Nov 23, 2016

@czchen could you take a look?
I found you add this assertion. assert( pci->nTotalChoice > 0 );
98afedf

I'm wondering did you really mean assert( pci->nTotalChoice > 0 ); or you actually want to assert(pci->nChoicePerPage > 0); since the next line is CEIL_DIV(pci->nTotalChoice, pci->nChoicePerPage)

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

No branches or pull requests

2 participants