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

A strange exception occurs when inputting specific characters. #775

Closed
vhkj opened this issue Mar 20, 2024 · 11 comments
Closed

A strange exception occurs when inputting specific characters. #775

vhkj opened this issue Mar 20, 2024 · 11 comments
Labels
🐛bug 💥crash / hang ime upstream scintilla Changes depends on upstream Scintilla 🛠workaround Workaround available
Milestone

Comments

@vhkj
Copy link

vhkj commented Mar 20, 2024

Exception details shows in the gif picture below..
When I use Chinese Larry Input method(双拼输入法) and type "#" then type "i" or "u" ( in Chinese larry Input method, "ch" replace "i" ,"sh" replace "u") , it happends. This bug will also be reproduced in the Release version

I can't find the position to fix it.

thsbug

@vhkj
Copy link
Author

vhkj commented Mar 20, 2024

@zufuliu zufuliu added 🐛bug ime 💪help wanted upstream scintilla Changes depends on upstream Scintilla labels Mar 20, 2024
@zufuliu
Copy link
Owner

zufuliu commented Mar 20, 2024

Reproduceable with SciTE (set ime.interaction=0), temporary workaround is using inline mode IME.
image

Adding a breakpoint after case WM_IME_COMPOSITION: seems hide the bug.

@zufuliu
Copy link
Owner

zufuliu commented Mar 20, 2024

The crash is due to ImeOnDocumentFeed(), no crashes after comment out if (wParam == IMR_DOCUMENTFEED) block:
https://github.com/zufuliu/notepad2/blob/9399a27265622ae8409761f549e29f6b9dde073a/scintilla/win32/ScintillaWin.cxx#L1925-L1933

@vhkj
Copy link
Author

vhkj commented Mar 20, 2024

The crash is due to ImeOnDocumentFeed(), no crashes after comment out if (wParam == IMR_DOCUMENTFEED) block:

https://github.com/zufuliu/notepad2/blob/9399a27265622ae8409761f549e29f6b9dde073a/scintilla/win32/ScintillaWin.cxx#L1925-L1933

Nice. It seems to have little impact on normal use.
By the way, I wanna know how you located the bug location, could you please give me some advice?

@vhkj vhkj closed this as completed Mar 20, 2024
@zufuliu zufuliu added the 🛠workaround Workaround available label Mar 20, 2024
@zufuliu
Copy link
Owner

zufuliu commented Mar 20, 2024

Reported as https://sourceforge.net/p/scintilla/bugs/2433/, please use inline mode IME for now.

@zufuliu zufuliu reopened this Mar 20, 2024
@zufuliu
Copy link
Owner

zufuliu commented Mar 20, 2024

By the way, I wanna know how you located the bug location, could you please give me some advice?

First, I guess its stack buffer overrun, then added some printf() inside IME codes, and run release version form command line (change following to #if 1 ).
https://github.com/zufuliu/notepad2/blob/65ccf25dba933ce233793f0612910d0d7a56b0ca/src/Notepad2.c#L522-L530

@vhkj
Copy link
Author

vhkj commented Mar 20, 2024

By the way, I wanna know how you located the bug location, could you please give me some advice?

First, I guess its stack buffer overrun, then added some printf() inside IME codes, and run release version form command line (change following to #if 1 ).

https://github.com/zufuliu/notepad2/blob/65ccf25dba933ce233793f0612910d0d7a56b0ca/src/Notepad2.c#L522-L530

Ok, thanks for u. I'll try it.

@zufuliu
Copy link
Owner

zufuliu commented Mar 21, 2024

Fixed by 339e3fa.

@zufuliu
Copy link
Owner

zufuliu commented Mar 21, 2024

Hi @maboroshin, can you check whether window mode IMR_DOCUMENTFEED (issue #127) still works after 339e3fa?

@maboroshin
Copy link
Contributor

Thanks. It has been functional since 339e3fa.

Test method used: #127 (comment)

results:

  • Notepad3 RC3_6.24.309.1: failure, Returns all case 0.

  • Notepad2 #2307 065c63a: Successful, As previous above test case, text 1 and 3 were successful.
  • Notepad2 #2305 339e3fa: Successful, As previous above test case, text 1 and 3 were successful.
  • Notepad2 #2304 65ccf25: failure, Returns all case 0.
  • Notepad2 v4.24.03r5146 : failure, Returns all case 0.

  • Notepad2 v4.23.08r4950 : failure
  • Notepad2 v4.23.06r4862 : failure , released Jun 18, 2023.
  • Previous IMR_DOCUMENTFEED success appears to be May 2023.

@zufuliu
Copy link
Owner

zufuliu commented Mar 26, 2024

Good to know it works. Just a bit strange as git blame -L:ImeOnDocumentFeed ScintillaWin.cxx says IMR_DOCUMENTFEED was added in 72ef5d6 (v4.23.06r4862), and no changes to the function until 65ccf25 and 339e3fa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug 💥crash / hang ime upstream scintilla Changes depends on upstream Scintilla 🛠workaround Workaround available
Projects
None yet
Development

No branches or pull requests

3 participants