-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Hangs on repeated calls to SetSelected in table. #3684
Comments
It looks like you're not updating the options on the Select before you can SetSelected, maybe try fixing that and see if it's still an issue? |
I'm not sure why you would need to update the options but I did this and I still have the hang.
|
I can't replicate. |
I can't get it to scroll without hanging no matter where I scroll from. Here is a short video that shows scrolling with the mouse positioned over the buttons. What can I do to improve and get the entry widgets, what do you mean about swollowing scroll events ? |
I have simplified the example down to just having a select and an entry widget in my container.
|
If I call just the selected method, it does not hang but doesn't show the correct option.
if I add a refresh to that it shows the correct option but again hangs when I scroll. in the same way as a SetSelected method
|
I've ruled out any interaction with the entry widget as I have replaced with a label and still hangs. |
If I simply and remove the repeated calls to Hide() it takes a little longer to hang but still hangs.
|
simplified again, this takes a longer to hang but still hangs
|
I cannot seem to replicate at all. Perhaps it is somehow sensitive to the version of macOS or the hardware? |
Fails on my Imac 21" and Macbook air both on Catalina 10.15.7 |
Interestingly I tried different versions of Fyne.io until I got back to version v2.1.1 which doesn't seem to hang. (athough scroll is slower) |
Further testsing I find that //fyne.io/fyne/v2 v2.3.0-rc2 is OK but //fyne.io/fyne/v2 v2.3.0-rc3 FAILS so the problem is some change made between these two tags. |
I got to my Linux box and cannot replicate i there either. Could be macOS Intel specific somehow? |
Perhaps this change , seems to be related ???? |
It seems that removing the I reinstated the defer and removed the explict unlocks and I no longer have the hang on scroll ( athough I think it looks slower) |
I think the issue is because you continue to update objects and cells after releasing the lock. Which causes the hang on mac. So I think the fix is to move the final unlock to the very bottom, before you return.
|
Athough having the defer at the begining of the function would probably be more idiomatic Go code. widget/table.go
|
SOLVED - So i have confirmed that reverting back to the defer at the top of the refresh function in |
@dhowlett99 Please open a PR instead of sharing code changes in comments. It makes things a lot easier to review and test :) |
@andydotxyz These seems to be another possibly related issue here as well. Tested With or without the patch described above in place or NOT. If you click on a select widget and you can see the options, without selecting anything click away at that point Cant make any sense of whats happening. |
I have found a way to replicate it. Just scrolling on its own never seems to happen for me - even on an intel Mac. Scroll, open select, scroll then try to dismiss it. Seems to hang most times using that. Is it no possible that is the culprit for the overall bug - or have you for certain seem it with only scrolling a list? |
@andydotxyz, Hello. I see a hang on two different scenarios with the simple example above #3684 (comment). Looks like your seeing scenario 2. My MacOs is catalina 10.5.7. intel
I'm unable to understand how all the locking works on all these various methods. So I can't go any further without some help from some one who understands Fyne internals. Let me know how I can help. |
The remaining item of this is now fixed on develop ready for v2.4.0 |
Checklist
Describe the bug
Using the latest version fyne.io/fyne/v2 v2.3.1 on Mac Catalina 10.15.7, go version go1.20 darwin/amd64
I'm building a table which has multiple widget types (wrapped in a container) in each field of the table.
Hide and Show are called to build a table with multiple widget types see screenshot.
I use SetSelected to set the correct option from an array of options in the select widgets of the table.
If you replace the SetSelected calls with just Selected the problem goes away, but the UI shows 'Set Selected' instead of the correct option.
How to reproduce
On a MAC Build the example code and simply scroll up and down and within a few minutes the program will hang and never return.
Screenshots
Example code
Fyne version
v2.3.1
Go compiler version
go1.20
Operating system and version
macOS Catalina
Additional Information
Date/Time: 2023-02-26 19:45:27 +0000
End time: 2023-02-26 19:45:47 +0000
OS Version: Mac OS X 10.15.7 (Build 19H2026)
Architecture: x86_64h
Report Version: 29
Data Source: Stackshots
Shared Cache: 0x3471000 B17C1CBE-BC73-34BB-A9C4-DE7487BA1631
Command: table
Path: /Users/USER/*/table
Version: ??? (???)
Parent: bash [6482] [unique pid 106254]
Responsible: Terminal [90652]
PID: 9275
Event: hang
Duration: 19.70s
Duration Sampled: 4.90s (process was unresponsive for 15 seconds before sampling)
Steps: 49 (100ms sampling interval)
Hardware model: MacBookAir7,2
Active cpus: 4
Time Awake Since Boot: 790000s
Time Since Wake: 33000s
Fan speed: 1192 rpm
Timeline format: stacks are sorted chronologically
Use -i and -heavy to re-report with count sorting
Heaviest stack for the main thread of the target process:
49 runtime.mcall + 67 (table + 421731) [0x100066f63]
49 runtime.park_m + 301 (table + 263053) [0x10004038d]
49 runtime.schedule + 61 (table + 261629) [0x10003fdfd]
49 runtime.stoplockedm + 101 (table + 254021) [0x10003e045]
49 runtime.mPark + 37 (table + 246629) [0x10003c365]
49 runtime.notesleep + 133 (table + 59749) [0x10000e965]
49 runtime.semasleep + 173 (table + 211565) [0x100033a6d]
49 runtime.pthread_cond_wait.abi0 + 52 (table + 353268) [0x1000563f4]
49 runtime.asmcgocall.abi0 + 161 (table + 429793) [0x100068ee1]
49 runtime.pthread_cond_wait_trampoline.abi0 + 16 (table + 438416) [0x10006b090]
49 __psynch_cvwait + 10 (libsystem_kernel.dylib + 14450) [0x7fff6a383872]
*49 psynch_cvcontinue + 0 (pthread + 18722) [0xffffff7f82d15922]
Process: table [9275] [unique pid 109046]
UUID: A1A20DF9-B4D3-3378-B665-1053C178D0E2
Path: /Users/USER/*/table
Architecture: x86_64
Parent: bash [6482] [unique pid 106254]
Responsible: Terminal [90652]
UID: 501
Footprint: 73.28 MB
Start time: 2023-02-26 19:45:42 +0000
End time: 2023-02-26 19:45:47 +0000
Num samples: 49 (1-49)
CPU Time: 0.055s (54.3M cycles, 12.7M instructions, 4.26c/i)
Note: Unresponsive for 15 seconds before sampling
Note: 1 idle work queue thread omitted
The text was updated successfully, but these errors were encountered: