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

Runtime panic because out of touchID #2407

Closed
changkun opened this issue Aug 27, 2021 · 6 comments · Fixed by fyne-io/mobile#10
Closed

Runtime panic because out of touchID #2407

changkun opened this issue Aug 27, 2021 · 6 comments · Fixed by fyne-io/mobile#10
Labels
bug Something isn't working

Comments

@changkun
Copy link
Member

Describe the bug:

While debugging #2406 , a runtime panic crashes the app. Here is a stack trace:

panic: out of touchIDs

goroutine 1 [running, locked to thread]:
github.com/fyne-io/mobile/app.sendTouch(0x130127b98, 0x10404a2a0, 0x30127b98, 0x1)
	/Users/changkun/go/pkg/mod/github.com/fyne-io/mobile@v0.1.3-0.20210811181917-d62fb16c28ec/app/darwin_ios.go:182 +0x184
github.com/fyne-io/mobile/app._Cfunc_runApp()
	_cgo_gotypes.go:201 +0x38
github.com/fyne-io/mobile/app.main(0x130114760)
	/Users/changkun/go/pkg/mod/github.com/fyne-io/mobile@v0.1.3-0.20210811181917-d62fb16c28ec/app/darwin_ios.go:75 +0x58
github.com/fyne-io/mobile/app.Main(...)
	/Users/changkun/go/pkg/mod/github.com/fyne-io/mobile@v0.1.3-0.20210811181917-d62fb16c28ec/app/app.go:21
fyne.io/fyne/v2/internal/driver/gomobile.(*mobileDriver).Run(0x13011b450)
	/Users/changkun/dev/changkun.de/fyne/internal/driver/gomobile/driver.go:138 +0x64
fyne.io/fyne/v2/internal/driver/gomobile.(*window).ShowAndRun(0x104329ae0)
	/Users/changkun/dev/changkun.de/fyne/internal/driver/gomobile/window.go:187 +0x3c
main.main()
	/Users/changkun/dev/changkun.de/fyne/iosrend/main.go:46 +0x2a0

It looks like sendTouch may happen concurrently. Adding an RWMutex would be a quick fix.

To Reproduce:

  1. run the reproducer in Use unbounded channel for event processing #2406
  2. keep clicking the button
  3. if lucky, the problem occurs

Device (please complete the following information):

  • OS: iOS 15
  • Version: beta 6
  • Go version: gotip based on CL 344969
  • Fyne version: develop 83ca35d
@changkun changkun added the unverified A bug that has been reported but not verified label Aug 27, 2021
changkun added a commit to changkun/gomobile that referenced this issue Aug 27, 2021
From practical observation, out of touchIDs may occur. This conflicts the maximum number of handled touchs in iOS devices. Therefore the only reason that may cause out of touchIDs is that the touchIDs are intrinsically non-concurrent safe. This change adds a read-write lock to the touchIDs array.

Fixes fyne-io/fyne#2407.
changkun added a commit to changkun/gomobile that referenced this issue Aug 27, 2021
From practical observation, out of touchIDs may occur. This conflicts with the maximum number of handled touches in iOS devices. Therefore the only reason that may cause out of touchIDs is that the touchIDs are intrinsically non-concurrent safe. This change adds a read-write lock to the touchIDs array.

Fixes fyne-io/fyne#2407.
changkun added a commit to changkun/gomobile that referenced this issue Aug 27, 2021
From practical observation, out of touchIDs may occur. This conflicts with the maximum number of handled touches in iOS devices. Therefore the only reason that may cause out of touchIDs is that the touchIDs are intrinsically non-concurrent safe. This change adds a read-write lock to the touchIDs array.

Fixes fyne-io/fyne#2407.
changkun added a commit to changkun/gomobile that referenced this issue Aug 27, 2021
From practical observation, out of touchIDs may occur. This conflicts with the maximum number of handled touches in iOS devices. Therefore the only reason that may cause out of touchIDs is that the touchIDs are intrinsically non-concurrent safe. This change adds a read-write lock to the touchIDs array.

Fixes fyne-io/fyne#2407.
andydotxyz pushed a commit to fyne-io/mobile that referenced this issue Aug 27, 2021
From practical observation, out of touchIDs may occur. This conflicts with the maximum number of handled touches in iOS devices. Therefore the only reason that may cause out of touchIDs is that the touchIDs are intrinsically non-concurrent safe. This change adds a read-write lock to the touchIDs array.

Fixes fyne-io/fyne#2407.
@andydotxyz
Copy link
Member

Thanks, merged a change to go.mod to bring in the change from mobile project.

@changkun
Copy link
Member Author

@andydotxyz I just encountered the problem again. It looks like the issue is not yet fixed. Let's reopen it again...

@andydotxyz andydotxyz added bug Something isn't working and removed unverified A bug that has been reported but not verified labels Sep 15, 2021
@andydotxyz andydotxyz reopened this Sep 15, 2021
@andydotxyz andydotxyz added this to the Fixes (v2.1.x) milestone Sep 15, 2021
@andydotxyz
Copy link
Member

Make sure to double check it was built with v2.1.0-rc1 :)

@changkun
Copy link
Member Author

What just happened?

@andydotxyz
Copy link
Member

It got auto-closed because the issue we thought resolved it hit master. I’ve unresolved it

@andydotxyz
Copy link
Member

This will be rolling out in v2.1.1 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants