-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
sometime caller is nil #904
Comments
wouldn't be your getLastN function which somehow returns nil ? |
Can you provide a code sample in a pr, gist or your own repository with an associated test which exhibits the issue ? |
hi, I did some more tests recently. |
Hello @harry890829, go routine id is something which is not officially supported by the language even if they are various implementations out there. |
@harry890829 I cannot reproduce the panic on my machine with your gist.
Can you please update your dependency package |
@huandu to reproduce the issue you need to change the activation flag in the formatter to true at line 67 |
@dgsb I did change the flag. What's your go version? |
@dgsb OK. I just understand what's the "activation flag" correctly. It's the |
If For more details, see func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max int, callback func(*stkframe, unsafe.Pointer) bool, v unsafe.Pointer, flags uint) int {
// ...
for n < max {
f = frame.fn
if f.pcsp == 0 { // Package `tls` set `f.pcsp` of the hacked `goexit` to 0.
// The most bottom call stack frame is skipped by this break.
break
}
// ...
}
// ...
} |
@harry890829 That's OK. Package gls is another relatively safe approach to get goid. |
@harry890829 can we close this issue then ? |
@dgsb yes, thanks |
I found panic, but I don't know why:
I write my own
Formatter
, and rewriteFormat
. But sometime caller will benil
My
Format
is like this:When I do
go run
, console will print these message:then it panic.
I will use
entry.HasCaller()
to check entry, but why it is nilI do another shot.
I do not use
Formatter
of mine. I do not calllogrus.SetFormatter
.It play very good.
There are
func
andfile
in log file.Now I think there is something wrong in my code, but I don't know where and why.
Sorry that my English is not good, I hope I make oneself clear.
Help~~~
If I miss something, please let me know
The text was updated successfully, but these errors were encountered: