golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.99k stars 17.67k forks source link

affected/package: fyne.io #59628

Closed KatheravanArumugam closed 1 year ago

KatheravanArumugam commented 1 year ago

What version of Go are you using (go version)?

$ go version

go version go1.19.5 darwin/arm64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/****/Library/Caches/go-build"
GOENV="/Users/****/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/****/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/***/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.19.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/****/Documents/go/Go Samples/GUI/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/6z/p3_vh2r11bvghfxjy06km1640000gn/T/go-build3911352271=/tmp/go-build -gno-record-gcc-switches -fno-common"

### What did you do?

Creating a widget and trying to create a text box and entering the data in the text box.
will add my source code as
`package main

import (
    "fyne.io/fyne/v2/app"
    "fyne.io/fyne/v2/container"
    "fyne.io/fyne/v2/dialog"
    "fyne.io/fyne/v2/widget"
)

func main() {
    // Create a new Fyne app
    a := app.New()
    w := a.NewWindow("Hello World")

    // Create a label widget
    label := widget.NewLabel("Welcome to Golang GUI!")

    // Create a text input widget
    entry := widget.NewEntry()

    // Create a button widget
    button := widget.NewButton("Click me!", func() {
        // Get the text entered in the text input
        text := entry.Text

        // Call the displayText function to show the entered text in a dialog box
        displayText(text)
    })

    // Create a container to hold the label, text input, and button widgets
    content := container.NewVBox(
        label,
        entry,
        button,
    )

    // Set the content of the window to the container
    w.SetContent(content)

    // Show the window
    w.ShowAndRun()
}

// Function to display text in a dialog box
func displayText(text string) {
    d := dialog.NewInformation("Entered Text", text, nil)
    d.Show()
}
`

### What did you expect to see?

The given data in the field should be printed

### What did you see instead?

I am observing GO PANIC recovery , memory block problem

`go run Try_GUI.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x18 pc=0x100ffa05c]

goroutine 8 [running]:
fyne.io/fyne/v2/dialog.(*dialog).create(0x14000ae0880, {0x101253fe0?, 0x14000666370})
        /Users/katheravan/go/pkg/mod/fyne.io/fyne/v2@v2.3.3/dialog/base.go:172 +0x28c
fyne.io/fyne/v2/dialog.createTextDialog({0x10102c62d?, 0x4?}, {0x14000470bd0?, 0x1400000f440?}, {0x10124f620?, 0x1400007a760?}, {0x0?, 0x0?})
        /Users/katheravan/go/pkg/mod/fyne.io/fyne/v2@v2.3.3/dialog/information.go:15 +0x114
fyne.io/fyne/v2/dialog.NewInformation({0x10102c62d, 0xc}, {0x14000470bd0, 0xa}, {0x0, 0x0})
        /Users/katheravan/go/pkg/mod/fyne.io/fyne/v2@v2.3.3/dialog/information.go:24 +0x64
main.displayText({0x14000470bd0?, 0x140000a4fc0?})
        /Users/katheravan/Documents/go/Go Samples/GUI/Try_GUI.go:46 +0x3c
main.main.func1()
        /Users/katheravan/Documents/go/Go Samples/GUI/Try_GUI.go:27 +0x28
fyne.io/fyne/v2/widget.(*Button).Tapped(0x140003906e0, 0x140003b409c)
        /Users/katheravan/go/pkg/mod/fyne.io/fyne/v2@v2.3.3/widget/button.go:202 +0x4c
fyne.io/fyne/v2/internal/driver/glfw.(*window).mouseClickedHandleTapDoubleTap.func1()
        /Users/katheravan/go/pkg/mod/fyne.io/fyne/v2@v2.3.3/internal/driver/glfw/window.go:634 +0x2c
fyne.io/fyne/v2/internal/driver/common.(*Window).RunEventQueue(0x0?)
        /Users/katheravan/go/pkg/mod/fyne.io/fyne/v2@v2.3.3/internal/driver/common/window.go:35 +0x3c
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1
        /Users/katheravan/go/pkg/mod/fyne.io/fyne/v2@v2.3.3/internal/driver/glfw/window.go:946 +0x144
exit status 2`            
mvdan commented 1 year ago

Empty issue.