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

Typing Chinese characters in widget.Entry and perform undo/redo crashes the app. #5001

Closed
2 tasks done
evanhyd opened this issue Jul 15, 2024 · 4 comments · Fixed by #5010
Closed
2 tasks done

Typing Chinese characters in widget.Entry and perform undo/redo crashes the app. #5001

evanhyd opened this issue Jul 15, 2024 · 4 comments · Fixed by #5010
Labels
unverified A bug that has been reported but not verified

Comments

@evanhyd
Copy link

evanhyd commented Jul 15, 2024

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

widget.Entry undo/redo is not compatiable with Chinese characters. Undo/Redo crashes the app when dealing with multiple Chinese characters.

How to reproduce

  1. Create a text entry
  2. Type random Chinese characters (for example, 测试) in the text entry
  3. Call Undo()/Redo() or use the corresponding hotkey
  4. Observe that the text entry transits into error states

//to crash the app

  1. Create a text entry
  2. Type random Chinese characters (for example, 测试) in the text entry
  3. Select all and delete
  4. Perform Undo() twice (ctrl + Z)
  5. Observe that fyne crashes

Screenshots

image
image
image

Example code

Create text entry widget, type in Chinese characters, press ctrl + z, ctrl + y to perform undo and redo.

Fyne version

2.5.0

Go compiler version

1.22

Operating system and version

Windows 10

Additional Information

At: home/Go/dependency/pkg/mod/fyne.io/fyne/v2@v2.5.0/internal/driver/glfw/driver_desktop.go:171
panic: runtime error: slice bounds out of range [4:2]

goroutine 11 [running]:
fyne.io/fyne/v2/widget.(*entryModifyAction).sub(...)
home/Go/dependency/pkg/mod/fyne.io/fyne/v2@v2.5.0/widget/entry.go:2316
fyne.io/fyne/v2/widget.(*entryModifyAction).Undo(0xc000f55ea0?, {0xc0053aadbe?, 0x7ff6a4a23872?})
home/Go/dependency/pkg/mod/fyne.io/fyne/v2@v2.5.0/widget/entry.go:2297 +0x90
fyne.io/fyne/v2/widget.(*entryUndoStack).Undo(0xc000d7fc08?, {0xc0053aadbe?, 0x7f0000c000f55ed8?})
home/Go/dependency/pkg/mod/fyne.io/fyne/v2@v2.5.0/widget/entry.go:2378 +0x4c
fyne.io/fyne/v2/widget.(*Entry).Undo(0xc000d7fc08)
home/Go/dependency/pkg/mod/fyne.io/fyne/v2@v2.5.0/widget/entry.go:787 +0x49
fyne.io/fyne/v2/widget.(*Entry).registerShortcut.func1({0xc000d7fc58?, 0x7ff6a5349920?})
home/Go/dependency/pkg/mod/fyne.io/fyne/v2@v2.5.0/widget/entry.go:1160 +0x17
fyne.io/fyne/v2.(*ShortcutHandler).TypedShortcut(0xc000d7fc58, {0x7ff6a55c8580, 0x7ff6a5b67b80})
home/Go/dependency/pkg/mod/fyne.io/fyne/v2@v2.5.0/shortcut.go:21 +0x6e
fyne.io/fyne/v2/widget.(*Entry).TypedShortcut(0xc0002eca20?, {0x7ff6a55c8580?, 0x7ff6a5b67b80?})
home/Go/dependency/pkg/mod/fyne.io/fyne/v2@v2.5.0/widget/entry.go:966 +0x25
fyne.io/fyne/v2/internal/driver/glfw.(*window).triggersShortcut.func1()
home/Go/dependency/pkg/mod/fyne.io/fyne/v2@v2.5.0/internal/driver/glfw/window.go:912 +0x24
fyne.io/fyne/v2/internal/driver/common.(*Window).RunEventQueue(...)
home/Go/dependency/pkg/mod/fyne.io/fyne/v2@v2.5.0/internal/driver/common/window.go:35
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1 in goroutine 1
home/Go/dependency/pkg/mod/fyne.io/fyne/v2@v2.5.0/internal/driver/glfw/window.go:997 +0x136
2024/07/18 00:06:27 exit status 2
exit status 1

@evanhyd evanhyd added the unverified A bug that has been reported but not verified label Jul 15, 2024
@andydotxyz
Copy link
Member

When reporting a crash can you please include the panic printed to the terminal?

@evanhyd
Copy link
Author

evanhyd commented Jul 18, 2024

added more info

@dweymouth
Copy link
Contributor

fixed for 2.5.1

@evanhyd
Copy link
Author

evanhyd commented Aug 21, 2024

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants