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

garble builded exe automatically exit after run #898

Open
Nyx2022 opened this issue Dec 7, 2024 · 4 comments
Open

garble builded exe automatically exit after run #898

Nyx2022 opened this issue Dec 7, 2024 · 4 comments
Labels
bug Something isn't working needs info Requires extra information to be solved

Comments

@Nyx2022
Copy link

Nyx2022 commented Dec 7, 2024

What version of Garble and Go are you using?

$ garble version
mvdan.cc/garble v0.13.0

$ go version
go version go1.23.3 windows/amd64

What environment are you running Garble on?

go env Output
$ go env
set GO111MODULE=on
                  set GOARCH=amd64
set GOBIN=
set GOCACHE=……
set GOENV=……
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=……
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=……
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
go: stripping unprintable or unescapable characters from %"GOROOT"%
set GOROOT=……
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
go: stripping unprintable or unescapable characters from %"GOTOOLDIR"%
set GOTOOLDIR=……windows-amd64\go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.23.3
set GODEBUG=
set GOTELEMETRY=local
set GOTELEMETRYDIR=……
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=……
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=……

What did you do?

i use garble to build a net server app to exe or elf,it build normally to a exe or elf,but when i run the exe or elf,it will automatically exit after a few seconds ,but the go builed exe will run normally

What did you expect to see?

run as go buileded exe

What did you see instead?

it will automatically exit after a few seconds

@lu4p
Copy link
Member

lu4p commented Dec 7, 2024

This is not helpful we need code to be able to reproduce the issue.

Also please try if your issue is already fixed on master go install mvdan.cc/garble@master

@lu4p lu4p added bug Something isn't working needs info Requires extra information to be solved labels Dec 7, 2024
@Nyx2022
Copy link
Author

Nyx2022 commented Dec 7, 2024

i've tried mvdan.cc/garble@master ,but the problem is still exist.by alot of tests,I found it's because the problem of lib: github.com/bytedance/sonic , can you fix it?

@lu4p
Copy link
Member

lu4p commented Dec 7, 2024

I need some code to reproduce this.

@Nyx2022
Copy link
Author

Nyx2022 commented Dec 8, 2024

you can reproduce it by only importr it and build with garble: garble -tiny -literals -debug -seed=random build -v -trimpath -a -ldflags "-s -w" -o ……

package main

import (
	"fmt"
	_ "github.com/bytedance/sonic"
)

func main() {
	fmt.Println("enter main")

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs info Requires extra information to be solved
Development

No branches or pull requests

2 participants