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
After executed the system call, exitsyscall hung is happened, high cpu #40114
Comments
Thank you for raising this issue. Can you please provide some way for someone who does not have access to your codebase or environment to reproduce the problem. Ideally if you can provide a short, self contained, program that demonstrates the issue that will lead to the fastest diagnosis. Thank you |
Also, you said you are using go 1.11. This release is several years old and no longer supported. Please upgrade to Go 1.15 and confirm is the issue still exists. |
@davecheney thankyou for your anwser,but do you understand the problem i described? i'm not sure i make this question clear? |
@yanqingliu i'm sorry I do not understand the problem as you have described it. |
@davecheney ok,now i repeat describe this problem again : The business scenario: System commands are frequently invoked,eg: os.Chmod go version: 1.11.6 The stack is: os.Chmod--->syscall.Syscall---->runtime.exitsyscall---->runtime.casgstatus Please look at the below code of for loop: the above code in go source code, the file is proc.go |
Thank you for reiterating. Can we step back a little bit. You said your program frequently makes syscalls. Can you show the code you are using? You suggested that there is a problem when the code appears to enter an infinite loop. How did you determine this? Can you show a complete stacktrace that you may have used to determine that the code you highlighted was the root cause. Thank you for your patience. The more information you can provide to explain you’re issue the more beneficial it is to resolving the issue. |
thankyou so much.
0 0xxxxxx in runtime.casgstatus |
Thank you for the explanation. You've stated that your program untars a file. This operation involves making several calls to os.Chmod. You've indicated that at some point in this process your program stops responding? Is that correct? If so, can you please send |
Thank you for your patience. Please look at the below code of for loop: |
Thank you for your reply. You've stated
Several times now. I am not able to understand the issue you are describing. Can you please try to answer the questions I asked earlier. Alternatively, For asking questions, see:
|
@davecheney Look at the description above: Detailed description: |
Thank you very much for your help. |
@daive123-cloud thank you for clarifying. Can you please address the other questions I raised here: #40114 (comment) |
In response to your question:
0 0xxxxxx in runtime.casgstatus |
@daive123-cloud thank you for providing the delve stack trace. To investigate further it would be useful to have the complete stack dump from the Go process Can you please send SIGQUIT to the process, or hit cntl-\ if the program is running on the console. This will cause the complete stack trace to be recorded. Please copy and paste the entire stack trace into this issue. Thank you. |
@davecheney I encountered a similar situation in Go 1.13, a goroutine seems stuck in Here is some information you may need What happenedThe whole process is hung, From dlv's dump, it seems like the runtime is in
All threads are blocked on
This goroutine is waiting for states to change to |
@bobotu Go 1.13 is no longer supported. Would you please
|
This problem appears in our customer's production environment and cannot be tested for Go 1.15 in the short term. In addition, this problem has not been reproduced so far, and we have never encountered such a problem with other customers before (Go 1.13 and the same source code). We will upgrade the Go toolchain to the latest version for the next release, but we just want to know the root cause of this problem, and has it been resolved? @davecheney So should I open a new issue with the information I have posted above? |
Yes, but please understand that Go 1.13 is unsupported and you will be asked to confirm the problem continues to occur in Go 1.15. |
Closing old issues that still have the WaitingForInfo label where enough details to investigate weren't provided. Feel free to leave a comment with more details and we can reopen. |
background:
Surface phenomenon: process hung, CPU high
Problematic Code: multiple system calls,os.Chmod
go version: 1.11.6
bt: os.Chmod--->syscall.Syscall---->runtime.exitsyscall---->runtime.casgstatus
See this below code: !atomic.Cas(&gp.atomicstatus, oldval, newval) exec result has always been true,cannot exit for loop, reason: gp.atomicstatus not equal to any fo these states:_Gsyscall, _Grunning, _Gwaiting, Why ??
the below code in go source code, the file is proc.go
for i := 0; !atomic.Cas(&gp.atomicstatus, oldval, newval); i++ {
......
......
}
The text was updated successfully, but these errors were encountered: