Go сбой при запуске из Дженкинс - PullRequest
0 голосов
/ 30 апреля 2020

Я запускаю go version от jenkins и его сбой со следующим

fatal error: runtime: mcall called on m->g0 stack

runtime stack:
io/ioutil.ReadFile(0xc0001481e0, 0x29, 0x0, 0x0, 0xcb, 0x0, 0xc00016ad00)
    c:/go/src/io/ioutil/ioutil.go:52
cmd/go/internal/cfg.initEnvCache()
    c:/go/src/cmd/go/internal/cfg/cfg.go:174 +0x69
sync.(*Once).doSlow(0xea9b00, 0xa76800)
    c:/go/src/sync/once.go:66 +0xf3
sync.(*Once).Do(...)
    c:/go/src/sync/once.go:57
cmd/go/internal/cfg.Getenv(0xa2ac05, 0x4, 0xc0001480f0, 0x2b)
    c:/go/src/cmd/go/internal/cfg/cfg.go:223 +0x15e
cmd/go/internal/cfg.envOr(...)
    c:/go/src/cmd/go/internal/cfg/cfg.go:280
cmd/go/internal/cfg.defaultContext(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    c:/go/src/cmd/go/internal/cfg/cfg.go:74 +0x1ad
cmd/go/internal/cfg.init()
    c:/go/src/cmd/go/internal/cfg/cfg.go:28 +0x3e

goroutine 1 [runnable, locked to thread]:
io/ioutil.ReadFile(0xc0001481e0, 0x29, 0x0, 0x0, 0xcb, 0x0, 0xc00016ad00)
    c:/go/src/io/ioutil/ioutil.go:52 +0x1c3
cmd/go/internal/cfg.initEnvCache()
    c:/go/src/cmd/go/internal/cfg/cfg.go:174 +0x69
sync.(*Once).doSlow(0xea9b00, 0xa76800)
    c:/go/src/sync/once.go:66 +0xf3
sync.(*Once).Do(...)
    c:/go/src/sync/once.go:57
cmd/go/internal/cfg.Getenv(0xa2ac05, 0x4, 0xc0001480f0, 0x2b)
    c:/go/src/cmd/go/internal/cfg/cfg.go:223 +0x15e
cmd/go/internal/cfg.envOr(...)
    c:/go/src/cmd/go/internal/cfg/cfg.go:280
cmd/go/internal/cfg.defaultContext(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
    c:/go/src/cmd/go/internal/cfg/cfg.go:74 +0x1ad
cmd/go/internal/cfg.init()
    c:/go/src/cmd/go/internal/cfg/cfg.go:28 +0x3e

Перед запуском go version задействован довольно запутанный путь, мастер jenkins подключен к * Сервер 1019 * 2019 через s sh, sshd на сервере работает агент jenkins, который запускает нашу сборку, которая представляет собой скрипт python, который запускает команду go version. Если я sh на сервер и вручную запускаю сценарий python, он работает.

Go равен windows 1.14.2, python равен 2.7.17, мастер Jenkins 2.204.5, работающий на Centos

У нас есть еще один сервер, работающий Go 1.13.3, который работает нормально, поэтому попробуем понизить версию и посмотреть, сохраняется ли проблема.

После выполнения go version выполнено несколько go build команд, и они создают sh со следующими

Build output was runtime: gp: gp=0xc000085e00, goid=505, gp->atomicstatus=3
runtime:  g:  g=0xc000484000, goid=0,  g->atomicstatus=0
fatal error: bad g status

runtime stack:
runtime.throw(0xa2f689, 0xc)
    c:/go/src/runtime/panic.go:1116 +0x79
runtime.goschedImpl(0xc000085e00)
    c:/go/src/runtime/proc.go:2697 +0x264
runtime.gopreempt_m(0xc000085e00)
    c:/go/src/runtime/proc.go:2733 +0x3b
runtime.mcall(0x0)
    c:/go/src/runtime/asm_amd64.s:318 +0x5e

goroutine 505 [syscall, locked to thread]:
runtime.cgocall(0x465180, 0xc0004802c8, 0x0)
    c:/go/src/runtime/cgocall.go:133 +0x55 fp=0xc0005e7108 sp=0xc0005e70d0 pc=0x404165
syscall.Syscall(0x7ffea4112080, 0x1, 0x40c, 0x0, 0x0, 0x0, 0x0, 0x0)
    c:/go/src/runtime/syscall_windows.go:188 +0xe9 fp=0xc0005e7148 sp=0xc0005e7108 pc=0x452589
syscall.CloseHandle(0x40c, 0xc000480000, 0xc0005e7208)
    c:/go/src/syscall/zsyscall_windows.go:354 +0x61 fp=0xc0005e7198 sp=0xc0005e7148 pc=0x4b1231
internal/poll.(*FD).destroy(0xc000248000, 0x1, 0x0)
    c:/go/src/internal/poll/fd_windows.go:454 +0xc1 fp=0xc0005e71d0 sp=0xc0005e7198 pc=0x4d4621
internal/poll.(*FD).decref(0xc000248000, 0xc00022e001, 0xc0005e72a0)
    c:/go/src/internal/poll/fd_mutex.go:213 +0x49 fp=0xc0005e71f8 sp=0xc0005e71d0 pc=0x4d1ef9
internal/poll.(*FD).Close(0xc000248000, 0x8000, 0xc00042e000)
    c:/go/src/internal/poll/fd_windows.go:472 +0x66 fp=0xc0005e7238 sp=0xc0005e71f8 pc=0x4d4706
os.(*file).close(0xc000248000, 0xc000454000, 0x0)
    c:/go/src/os/file_windows.go:205 +0x58 fp=0xc0005e7288 sp=0xc0005e7238 pc=0x4e1038
os.(*File).Close(0xc00060e2c0, 0x17, 0xc00060e2c0)
    c:/go/src/os/file_windows.go:193 +0x3a fp=0xc0005e72b0 sp=0xc0005e7288 pc=0x4e0f8a
cmd/internal/buildid.ReadFile(0xc00009e140, 0x17, 0xc00042e000, 0x53, 0x0, 0x0)
    c:/go/src/cmd/internal/buildid/buildid.go:47 +0x243 fp=0xc0005e7368 sp=0xc0005e72b0 pc=0x82db13
cmd/go/internal/work.(*Builder).useCache(0xc00009b680, 0xc00009ca00, 0xc79b40d6b3a32276, 0x37623314d08a90e8, 0x93951802e993f1f4, 0xaf60a096d647cbd4, 0xc00009e140, 0x17, 0x52414f47245f6863)
    c:/go/src/cmd/go/internal/work/buildid.go:448 +0xf4c fp=0xc0005e7590 sp=0xc0005e7368 pc=0x83db8c
cmd/go/internal/work.(*Builder).build(0xc00009b680, 0xc00009ca00, 0x0, 0x0)
    c:/go/src/cmd/go/internal/work/exec.go:405 +0x5163 fp=0xc0005e7e70 sp=0xc0005e7590 pc=0x8473f3
cmd/go/internal/work.(*Builder).Do.func2(0xc00009ca00)
    c:/go/src/cmd/go/internal/work/exec.go:118 +0x35f fp=0xc0005e7f10 sp=0xc0005e7e70 pc=0x87501f
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:178 +0x7d fp=0xc0005e7fc8 sp=0xc0005e7f10 pc=0x87514d
runtime.goexit()
    c:/go/src/runtime/asm_amd64.s:1373 +0x1 fp=0xc0005e7fd0 sp=0xc0005e7fc8 pc=0x463701
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc000212d38)
    c:/go/src/runtime/sema.go:56 +0x49
sync.(*WaitGroup).Wait(0xc000212d30)
    c:/go/src/sync/waitgroup.go:130 +0x6b
cmd/go/internal/work.(*Builder).Do(0xc00009b680, 0xc00009c280)
    c:/go/src/cmd/go/internal/work/exec.go:187 +0x3b5
cmd/go/internal/work.runBuild(0xea0a20, 0xc0000d0030, 0x0, 0x0)
    c:/go/src/cmd/go/internal/work/build.go:420 +0x6a1
main.main()
    c:/go/src/cmd/go/main.go:189 +0x586

goroutine 508 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 507 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 511 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 509 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 510 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 506 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 512 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 513 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 530 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 531 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 532 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 533 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 534 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 535 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

goroutine 536 [select]:
cmd/go/internal/work.(*Builder).Do.func3(0xc000212d30, 0xc00009b680, 0xc000097da0)
    c:/go/src/cmd/go/internal/work/exec.go:168 +0xf4
created by cmd/go/internal/work.(*Builder).Do
    c:/go/src/cmd/go/internal/work/exec.go:165 +0x391

Любые идеи о том, что означают дампы cra sh и что может их вызывать, были бы очень полезны.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...