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

x/text/cmd/gotext: panic when do extract #62697

Open
okhowang opened this issue Sep 18, 2023 · 4 comments · May be fixed by golang/text#46
Open

x/text/cmd/gotext: panic when do extract #62697

okhowang opened this issue Sep 18, 2023 · 4 comments · May be fixed by golang/text#46
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@okhowang
Copy link

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

$ go version
go version go1.20.7 linux/amd64

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="amd64"
GOBIN=""
GOCACHE="/home/okhowang/.cache/go-build"
GOENV="/home/okhowang/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/okhowang/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/okhowang/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/lib/golang"
GOSUMDB=""
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.7"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2265391320=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ go install golang.org/x/text/cmd/gotext@latest
$ gotext extract
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7b8a56]

goroutine 1 [running]:
main.config()
        /home/okhowang/go/pkg/mod/golang.org/x/text@v0.13.0/cmd/gotext/main.go:55 +0xf6
main.main()
        /home/okhowang/go/pkg/mod/golang.org/x/text@v0.13.0/cmd/gotext/main.go:154 +0x2d3

What did you expect to see?

extract message correctly.

What did you see instead?

go install golang.org/x/text/cmd/gotext@v0.11.0
it seems like out was not init when doing extract command

@gopherbot gopherbot added this to the Unreleased milestone Sep 18, 2023
@mauri870
Copy link
Member

The same error happens when calling gotext rewrite.

@mauri870
Copy link
Member

@gopherbot add needsFix

@gopherbot gopherbot added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 18, 2023
mauri870 added a commit to mauri870/text that referenced this issue Sep 18, 2023
If extract or rewrite are called with no arguments it results in a
segmentation fault, since we dereference the out flag that was not
defined for these commands.

Fixes golang/go#62697
@gopherbot
Copy link

Change https://go.dev/cl/529255 mentions this issue: cmd/gotext: fix segfault in extract & rewrite commands

mauri870 added a commit to mauri870/text that referenced this issue Sep 19, 2023
If extract or rewrite are called with no arguments it results in a
segmentation fault, since we dereference the out flag that is not
defined for these commands.

Fixes golang/go#62697
@Succo
Copy link

Succo commented Feb 6, 2024

Looks like a duplicate of #60555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants