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

Multiple select popups during background operations (crash) #4730

Closed
2 tasks done
stridebn opened this issue Mar 21, 2024 · 4 comments
Closed
2 tasks done

Multiple select popups during background operations (crash) #4730

stridebn opened this issue Mar 21, 2024 · 4 comments
Labels
unverified A bug that has been reported but not verified
Milestone

Comments

@stridebn
Copy link

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

When clicking multiple times on a select object while the program is performing background tasks, many Fyne reads each click and generates multiple popups below the select. This causes the program to crash.

How to reproduce

During any background operation where the window is unresponsive, click multiple times on any select. Once the window is responsive, click on the dropdown menus to select items. Multiple popups will have generated, and a click on any but the top will crash the program.

Screenshots

No response

Example code

The following can be put in an application to demonstrate the issue.

    selectOptions := []string{"Option 1", "Option 2"}
    testSelect := widget.NewSelect(selectOptions, func(selected string) {
        fmt.Println("selected: ", selected)
    })
    testSelect.PlaceHolder = "Click me multiple times after clicking the button"
    waitButton := widget.NewButton("Click me!", func() {
        start := time.Now()
        // Loop until the specified duration has passed
        for time.Since(start) < (5 * time.Second) {
            // This is the busy wait part, where the loop continuously checks the time
        }
    })

Fyne version

2.4.4

Go compiler version

1.19.2

Operating system and version

Mac 12.7.1

Additional Information

No response

@stridebn stridebn added the unverified A bug that has been reported but not verified label Mar 21, 2024
@andydotxyz
Copy link
Member

During any background operation where the window is unresponsive

The window should never be unresponsive - this points towards a potential issue outside what is reported above.

@andydotxyz
Copy link
Member

Multiple popups will have generated, and a click on any but the top will crash the program.

Can you please provide the crash log that is occurring in this situation?

@stridebn
Copy link
Author

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x10051ee99]

goroutine 41 [running]:
fyne.io/fyne/v2/widget.(*PopUpMenu).Hide(0x0)
/Users/brennans/go/src/fyne/widget/popup_menu.go:68 +0x19
fyne.io/fyne/v2/widget.(*Select).showPopUp.func2()
/Users/brennans/go/src/fyne/widget/select.go:256 +0x29
fyne.io/fyne/v2/widget.(*Menu).Dismiss(0xc003f56480?)
/Users/brennans/go/src/fyne/widget/menu.go:194 +0xaf
fyne.io/fyne/v2/widget.(*menuItem).trigger(0xc00429ca80)
/Users/brennans/go/src/fyne/widget/menu_item.go:205 +0x25
fyne.io/fyne/v2/widget.(*menuItem).Tapped(0xc001829fb0?, 0xc000038401?)
/Users/brennans/go/src/fyne/widget/menu_item.go:153 +0x58
fyne.io/fyne/v2/internal/driver/glfw.(*window).mouseClickedHandleTapDoubleTap.func1()
/Users/brennans/go/src/fyne/internal/driver/glfw/window.go:650 +0x26
fyne.io/fyne/v2/internal/driver/common.(*Window).RunEventQueue(0x0?)
/Users/brennans/go/src/fyne/internal/driver/common/window.go:35 +0x3e
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1
/Users/brennans/go/src/fyne/internal/driver/glfw/window.go:960 +0x136
exit status 2

@andydotxyz
Copy link
Member

This is landed on develop and the release branch, it will be on v2.4.5

@andydotxyz andydotxyz added this to the v2.4.5 milestone Apr 2, 2024
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

No branches or pull requests

2 participants