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

syscall: add prlimit #59712

Closed
YallaPayInc opened this issue Apr 19, 2023 · 13 comments
Closed

syscall: add prlimit #59712

YallaPayInc opened this issue Apr 19, 2023 · 13 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@YallaPayInc
Copy link

i have this issues when go run my project package

/usr/bin/ld: /root/.cache/go-build/b5/b57f729b94d703ef771f9fbc8d67eb3ffd7f44d5567a271fccd55d54c1a2cecf-d(go.o): in function `golang_0org_1x_1sys_1unix.Prlimit':

/root/go/pkg/mod/golang.org/x/sys@v0.7.0/unix/syscall_linux.go:1895: undefined reference to `syscall.prlimit'
collect2: error: ld returned 1 exit status

@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Apr 19, 2023
@ianlancetaylor
Copy link
Contributor

This is a problem that needs to be fixed in gccgo's Go library.

@ianlancetaylor ianlancetaylor changed the title after upgrade to v1.20.3 got error gccgo: syscall: define prlimit Apr 19, 2023
@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 19, 2023
@ianlancetaylor ianlancetaylor added this to the Gccgo milestone Apr 19, 2023
@YallaPayInc
Copy link
Author

how please ?

@gopherbot
Copy link

Change https://go.dev/cl/486576 mentions this issue: syscall: add prlimit

@ianlancetaylor
Copy link
Contributor

@YallaPayInc You'll have to patch and rebuild gccgo's libgo library. The fix is https://go.dev/cl/486576.

@YallaPayInc
Copy link
Author

i uploaded patch file on project directory but still error exist

@YallaPayInc YallaPayInc changed the title gccgo: syscall: define prlimit syscall: add prlimit Apr 19, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Apr 19, 2023
@ianlancetaylor
Copy link
Contributor

@YallaPayInc To be clear, you are using gccgo, which is not the usual Go compiler. In order to use the patch, you will have to build and install a new version of gccgo. If you have not done that before, that is a difficult job. But if you have done that before, are you sure that you want to be using gccgo? Perhaps you should be using the default Go compiler, which is known as gc.

@YallaPayInc
Copy link
Author

i'm using it already

g++ (Ubuntu 12.2.0-3ubuntu1) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@YallaPayInc
Copy link
Author

i have path for gcc under usr/lib so is this correct path to add patch file for fix issue ?

@ianlancetaylor
Copy link
Contributor

In order to apply the patch you must download the GCC sources, you must apply the patch to the GCC sources, and you must rebuild and reinstall GCC.

If you have not done this before I do not recommend doing it today. It is difficult.

@YallaPayInc
Copy link
Author

regarding to this error message when compile Go project
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: /root/.cache/go-build/b5/b57f729b94d703ef771f9fbc8d67eb3ffd7f44d5567a271fccd55d54c1a2cecf-d(go.o): in function golang_0org_1x_1sys_1unix.Prlimit': /root/go/pkg/mod/golang.org/x/sys@v0.7.0/unix/syscall_linux.go:1895: undefined reference to syscall.prlimit'
collect2: error: ld returned 1 exit status

so i upload this files if you can help

https://we.tl/t-2gzlx5cz5I

@YallaPayInc
Copy link
Author

/usr/bin/ld: warning: helper.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: /root/.cache/go-build/45/4547ce09f7fab95bee3d4125331c32b1a51866dc8fceb83edee7752d5aa0cebd-d(go.o): in function golang_0org_1x_1sys_1unix.Prlimit': /root/go/pkg/mod/golang.org/x/sys@v0.7.0/unix/syscall_linux.go:1895: undefined reference to syscall.prlimit'
collect2: error: ld returned 1 exit status

@mknyszek
Copy link
Contributor

mknyszek commented May 3, 2023

@ianlancetaylor I assigned this to you in triage, assuming that your CL is the fix and will close out the issue.

nstester pushed a commit to nstester/gcc that referenced this issue May 11, 2023
As of https://go.dev/cl/476695 golang.org/x/sys/unix can call
syscall.prlimit, so we need such a function in libgo.

For golang/go#46279
Fixes golang/go#59712

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/486576
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants