sirupsen / logrus

Structured, pluggable logging for Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incompatible with version go1.17.1, cause runtime·systemstack_switch when init text_formatter isTerminal

cysnb opened this issue · comments

commented

when call log.Info(****) with version go1.17.1 and logrus v1.8.1 , the pragram stop execute at line

TEXT runtime·systemstack_switch(SB), NOSPLIT, $0-0
RET

the stacktrace is

goroutine 1 [syscall, locked to thread]:
syscall.syscall(0x4131b20, 0x2, 0x40487413, 0xc0000bd0b0)
/usr/local/Cellar/go/1.17.1/libexec/src/runtime/sys_darwin.go:22 +0x3b fp=0xc0000bd020 sp=0xc0000bd000 pc=0x40623bb
syscall.syscall(0x0, 0x2000000000000, 0x0, 0x0)
:1 +0x26 fp=0xc0000bd068 sp=0xc0000bd020 pc=0x40680c6
golang.org/x/sys/unix.ioctl(0x38, 0x8, 0x38)
/Users//go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/zsyscall_darwin_amd64.go:746 +0x39 fp=0xc0000bd098 sp=0xc0000bd068 pc=0x41317b9
golang.org/x/sys/unix.IoctlGetTermios(...)
/Users/
/go/pkg/mod/golang.org/x/sys@v0.0.0-20200116001909-b77594299b42/unix/ioctl.go:63
github.com/sirupsen/logrus.isTerminal(0x0)
/Users//go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/terminal_check_bsd.go:11 +0x50 fp=0xc0000bd108 sp=0xc0000bd098 pc=0x413cb70
github.com/sirupsen/logrus.checkIfTerminal({0x470c560, 0xc000010020})
/Users/
/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/terminal_check_notappengine.go:13 +0x75 fp=0xc0000bd120 sp=0xc0000bd108 pc=0x413cc15
github.com/sirupsen/logrus.(TextFormatter).init(0xc000094240, 0x4f09328)
/Users/
/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/text_formatter.go:106 +0x34 fp=0xc0000bd1a0 sp=0xc0000bd120 pc=0x413ccf4
github.com/sirupsen/logrus.(TextFormatter).Format.func1()
/Users/
/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/text_formatter.go:196 +0x25 fp=0xc0000bd1c0 sp=0xc0000bd1a0 pc=0x413e3a5
sync.(Once).doSlow(0x4715c70, 0xc00000e030)
/usr/local/Cellar/go/1.17.1/libexec/src/sync/once.go:68 +0xd2 fp=0xc0000bd228 sp=0xc0000bd1c0 pc=0x406eb52
sync.(Once).Do(...)
/usr/local/Cellar/go/1.17.1/libexec/src/sync/once.go:59
github.com/sirupsen/logrus.(TextFormatter).Format(0xc000094240, 0xc0000b2150)
/Users/
/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/text_formatter.go:196 +0xebe fp=0xc0000bd798 sp=0xc0000bd228 pc=0x413dd5e
github.com/sirupsen/logrus.(Entry).write(0xc0000b2150)
/Users/
/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/entry.go:279 +0x56 fp=0xc0000bd828 sp=0xc0000bd798 pc=0x4138036
github.com/sirupsen/logrus.(Entry).log(0xc000073948, 0x4, {0xc00002a100, 0x9})
/Users/
/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/entry.go:251 +0x219 fp=0xc0000bd898 sp=0xc0000bd828 pc=0x4137c39
github.com/sirupsen/logrus.(Entry).Log(0xc0000b20e0, 0x4, {0xc000073948, 0x413c520, 0xc0000b20a0})
/Users/
/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/entry.go:293 +0x4f fp=0xc0000bd8c8 sp=0xc0000bd898 pc=0x413828f
github.com/sirupsen/logrus.(Logger).Log(0xc0000b2070, 0x4, {0xc000073948, 0x1, 0x1})
/Users/
/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/logger.go:198 +0x65 fp=0xc0000bd908 sp=0xc0000bd8c8 pc=0x413aea5
github.com/sirupsen/logrus.(Logger).Info(...)
/Users/
**/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/logger.go:220
…………

This issue is stale because it has been open for 30 days with no activity.

go1.17, I meet it too when run the main.go.
func main() { logrus.Info("--------") command.Execute() }
`fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0xb01dfacedebac1e pc=0x7fff6d56170a]

runtime stack:
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff6d56170a
stack: frame={sp:0x7ffeefbff688, fp:0x7ffeefbff6d8} stack=[0x7ffeefb80728,0x7ffeefbff790)
0x00007ffeefbff588: 0x01007ffeefbff5a8 0x0000000000000004
0x00007ffeefbff598: 0x000000000000001f 0x00007fff6d56170a
0x00007ffeefbff5a8: 0x0b01dfacedebac1e 0x0000000000000001
0x00007ffeefbff5b8: 0x0000000004034471 <runtime.throw+0x0000000000000071> 0x00007ffeefbff658
0x00007ffeefbff5c8: 0x00000000046fb2ab 0x00007ffeefbff610
0x00007ffeefbff5d8: 0x0000000004034728 <runtime.fatalthrow.func1+0x0000000000000048> 0x0000000004c65f20
0x00007ffeefbff5e8: 0x0000000000000001 0x0000000000000001
0x00007ffeefbff5f8: 0x00007ffeefbff658 0x0000000004034471 <runtime.throw+0x0000000000000071>
0x00007ffeefbff608: 0x0000000004c65f20 0x00007ffeefbff648
0x00007ffeefbff618: 0x00000000040346b0 <runtime.fatalthrow+0x0000000000000050> 0x00007ffeefbff628
0x00007ffeefbff628: 0x00000000040346e0 <runtime.fatalthrow.func1+0x0000000000000000> 0x0000000004c65f20
0x00007ffeefbff638: 0x0000000004034471 <runtime.throw+0x0000000000000071> 0x00007ffeefbff658
0x00007ffeefbff648: 0x00007ffeefbff678 0x0000000004034471 <runtime.throw+0x0000000000000071>
0x00007ffeefbff658: 0x00007ffeefbff660 0x00000000040344a0 <runtime.throw.func1+0x0000000000000000>
0x00007ffeefbff668: 0x00000000047088db 0x000000000000002a
0x00007ffeefbff678: 0x00007ffeefbff6c8 0x0000000004049a76 <runtime.sigpanic+0x0000000000000396>
0x00007ffeefbff688: <0x00000000047088db 0x0000000004c65f20
0x00007ffeefbff698: 0x00007ffeefbff708 0x0000000004027386 <runtime.(*mheap).allocSpan+0x0000000000000546>
0x00007ffeefbff6a8: 0x000000c00015e000 0x000000000000e000
0x00007ffeefbff6b8: 0x000000c000000008 0x0000000000000000
0x00007ffeefbff6c8: 0x00007ffeefbff710 !0x00007fff6d56170a
0x00007ffeefbff6d8: >0x00007ffeefbff710 0x0000000004bec000
0x00007ffeefbff6e8: 0x0000000000000735 0x0000000004296565 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005>
0x00007ffeefbff6f8: 0x0000000004065d3f <runtime.syscall+0x000000000000001f> 0x000000c00022d650
0x00007ffeefbff708: 0x00000000040656ac <runtime.nanotime_trampoline+0x000000000000000c> 0x000000c00022d620
0x00007ffeefbff718: 0x0000000004063bb0 <runtime.asmcgocall+0x0000000000000070> 0x00007ffeefbff750
0x00007ffeefbff728: 0x000000000400e6ce <runtime.persistentalloc.func1+0x000000000000002e> 0x0000000000001018
0x00007ffeefbff738: 0x0000000000000001 0x0000000004c9a0d8
0x00007ffeefbff748: 0x0000000000000a08 0x000000c000000340
0x00007ffeefbff758: 0x0000000004061cc9 <runtime.systemstack+0x0000000000000049> 0x0000000000000004
0x00007ffeefbff768: 0x00000000047cac80 0x0000000004c65f20
0x00007ffeefbff778: 0x00007ffeefbff7c0 0x0000000004061bc5 <runtime.mstart+0x0000000000000005>
0x00007ffeefbff788: 0x0000000004061b7d <runtime.rt0_go+0x000000000000013d>
runtime.throw({0x47088db, 0x4c65f20})
/usr/local/Cellar/go/1.17.2/libexec/src/runtime/panic.go:1198 +0x71
runtime: unexpected return pc for runtime.sigpanic called from 0x7fff6d56170a
stack: frame={sp:0x7ffeefbff688, fp:0x7ffeefbff6d8} stack=[0x7ffeefb80728,0x7ffeefbff790)
0x00007ffeefbff588: 0x01007ffeefbff5a8 0x0000000000000004
0x00007ffeefbff598: 0x000000000000001f 0x00007fff6d56170a
0x00007ffeefbff5a8: 0x0b01dfacedebac1e 0x0000000000000001
0x00007ffeefbff5b8: 0x0000000004034471 <runtime.throw+0x0000000000000071> 0x00007ffeefbff658
0x00007ffeefbff5c8: 0x00000000046fb2ab 0x00007ffeefbff610
0x00007ffeefbff5d8: 0x0000000004034728 <runtime.fatalthrow.func1+0x0000000000000048> 0x0000000004c65f20
0x00007ffeefbff5e8: 0x0000000000000001 0x0000000000000001
0x00007ffeefbff5f8: 0x00007ffeefbff658 0x0000000004034471 <runtime.throw+0x0000000000000071>
0x00007ffeefbff608: 0x0000000004c65f20 0x00007ffeefbff648
0x00007ffeefbff618: 0x00000000040346b0 <runtime.fatalthrow+0x0000000000000050> 0x00007ffeefbff628
0x00007ffeefbff628: 0x00000000040346e0 <runtime.fatalthrow.func1+0x0000000000000000> 0x0000000004c65f20
0x00007ffeefbff638: 0x0000000004034471 <runtime.throw+0x0000000000000071> 0x00007ffeefbff658
0x00007ffeefbff648: 0x00007ffeefbff678 0x0000000004034471 <runtime.throw+0x0000000000000071>
0x00007ffeefbff658: 0x00007ffeefbff660 0x00000000040344a0 <runtime.throw.func1+0x0000000000000000>
0x00007ffeefbff668: 0x00000000047088db 0x000000000000002a
0x00007ffeefbff678: 0x00007ffeefbff6c8 0x0000000004049a76 <runtime.sigpanic+0x0000000000000396>
0x00007ffeefbff688: <0x00000000047088db 0x0000000004c65f20
0x00007ffeefbff698: 0x00007ffeefbff708 0x0000000004027386 <runtime.(*mheap).allocSpan+0x0000000000000546>
0x00007ffeefbff6a8: 0x000000c00015e000 0x000000000000e000
0x00007ffeefbff6b8: 0x000000c000000008 0x0000000000000000
0x00007ffeefbff6c8: 0x00007ffeefbff710 !0x00007fff6d56170a
0x00007ffeefbff6d8: >0x00007ffeefbff710 0x0000000004bec000
0x00007ffeefbff6e8: 0x0000000000000735 0x0000000004296565 <golang.org/x/sys/unix.libc_ioctl_trampoline+0x0000000000000005>
0x00007ffeefbff6f8: 0x0000000004065d3f <runtime.syscall+0x000000000000001f> 0x000000c00022d650
0x00007ffeefbff708: 0x00000000040656ac <runtime.nanotime_trampoline+0x000000000000000c> 0x000000c00022d620
0x00007ffeefbff718: 0x0000000004063bb0 <runtime.asmcgocall+0x0000000000000070> 0x00007ffeefbff750
0x00007ffeefbff728: 0x000000000400e6ce <runtime.persistentalloc.func1+0x000000000000002e> 0x0000000000001018
0x00007ffeefbff738: 0x0000000000000001 0x0000000004c9a0d8
0x00007ffeefbff748: 0x0000000000000a08 0x000000c000000340
0x00007ffeefbff758: 0x0000000004061cc9 <runtime.systemstack+0x0000000000000049> 0x0000000000000004
0x00007ffeefbff768: 0x00000000047cac80 0x0000000004c65f20
0x00007ffeefbff778: 0x00007ffeefbff7c0 0x0000000004061bc5 <runtime.mstart+0x0000000000000005>
0x00007ffeefbff788: 0x0000000004061b7d <runtime.rt0_go+0x000000000000013d>
runtime.sigpanic()
/usr/local/Cellar/go/1.17.2/libexec/src/runtime/signal_unix.go:719 +0x396

goroutine 1 [syscall]:
syscall.syscall(0x4296560, 0x1, 0x40487413, 0xc00022d6e0)
/usr/local/Cellar/go/1.17.2/libexec/src/runtime/sys_darwin.go:22 +0x3b fp=0xc00022d650 sp=0xc00022d630 pc=0x406095b
syscall.syscall(0x34, 0x46b3080, 0xffd5553ff5554f, 0x4468e62)
:1 +0x26 fp=0xc00022d698 sp=0xc00022d650 pc=0x4066506
golang.org/x/sys/unix.ioctl(0xd0, 0x203000, 0x203000)
/Users/ci/go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/zsyscall_darwin_amd64.go:731 +0x39 fp=0xc00022d6c8 sp=0xc00022d698 pc=0x42961f9
golang.org/x/sys/unix.IoctlGetTermios(...)
/Users/ci/go/pkg/mod/golang.org/x/sys@v0.0.0-20200930185726-fdedc70b468f/unix/ioctl.go:72
github.com/sirupsen/logrus.isTerminal(0x4014954)
/Users/ci/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/terminal_check_bsd.go:11 +0x50 fp=0xc00022d738 sp=0xc00022d6c8 pc=0x429ccf0
github.com/sirupsen/logrus.checkIfTerminal({0x47d3600, 0xc0000d6008})
/Users/ci/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/terminal_check_notappengine.go:13 +0x75 fp=0xc00022d750 sp=0xc00022d738 pc=0x429cd95
github.com/sirupsen/logrus.(*TextFormatter).init(0xc0000d8300, 0x4ec0998)
/Users/ci/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/text_formatter.go:106 +0x34 fp=0xc00022d7d0 sp=0xc00022d750 pc=0x429ce74
github.com/sirupsen/logrus.(*TextFormatter).Format.func1()
/Users/ci/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/text_formatter.go:196 +0x25 fp=0xc00022d7f0 sp=0xc00022d7d0 pc=0x429e525
sync.(*Once).doSlow(0x47e0c50, 0xc0000c6270)
/usr/local/Cellar/go/1.17.2/libexec/src/sync/once.go:68 +0xd2 fp=0xc00022d858 sp=0xc00022d7f0 pc=0x4078df2
sync.(*Once).Do(...)
/usr/local/Cellar/go/1.17.2/libexec/src/sync/once.go:59
github.com/sirupsen/logrus.(*TextFormatter).Format(0xc0000d8300, 0xc00048a0e0)
/Users/ci/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/text_formatter.go:196 +0xebe fp=0xc00022ddc8 sp=0xc00022d858 pc=0x429dede
github.com/sirupsen/logrus.(*Entry).write(0xc00048a0e0)
/Users/ci/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/entry.go:279 +0x56 fp=0xc00022de58 sp=0xc00022ddc8 pc=0x4298136
github.com/sirupsen/logrus.(*Entry).log(0xc00022df60, 0x4, {0xc00041c9e0, 0x8})
/Users/ci/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/entry.go:251 +0x219 fp=0xc00022dec8 sp=0xc00022de58 pc=0x4297d39
github.com/sirupsen/logrus.(*Entry).Log(0xc00048a000, 0x4, {0xc00022df60, 0x405f4fb, 0xc000000340})
/Users/ci/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/entry.go:293 +0x4f fp=0xc00022def8 sp=0xc00022dec8 pc=0x429838f
github.com/sirupsen/logrus.(*Logger).Log(0xc00019a000, 0x4, {0xc00022df60, 0x1, 0x1})
/Users/ci/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/logger.go:198 +0x65 fp=0xc00022df38 sp=0xc00022def8 pc=0x429b025
github.com/sirupsen/logrus.(*Logger).Info(...)
/Users/ci/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/logger.go:220
github.com/sirupsen/logrus.Info(...)
/Users/ci/go/pkg/mod/github.com/sirupsen/logrus@v1.8.1/exported.go:109
main.main()
/Users/ci/go/src/ssigncode/signcode/main.go:30 +0x50 fp=0xc00022df80 sp=0xc00022df38 pc=0x45a4150
runtime.main()
/usr/local/Cellar/go/1.17.2/libexec/src/runtime/proc.go:255 +0x227 fp=0xc00022dfe0 sp=0xc00022df80 pc=0x4036b07
runtime.goexit()
/usr/local/Cellar/go/1.17.2/libexec/src/runtime/asm_amd64.s:1581 +0x1 fp=0xc00022dfe8 sp=0xc00022dfe0 pc=0x4063ea1`

This issue is stale because it has been open for 30 days with no activity.

This issue was closed because it has been inactive for 14 days since being marked as stale.