agent: "buildkite-agent upload" crashes with SIGSEGV: segmentation violation

Just noticed this on our Mac machines where I upgrade to Buildkite Agent 3.8.0:

buildkite-agent artifact upload src/test/shell/bazel/jdeps_test/test.log
--
  | 2019-01-10 14:58:29 INFO   Found 1 files that match "src/test/shell/bazel/jdeps_test/test.log"
  | panic: runtime error: invalid memory address or nil pointer dereference
  | [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x12e0572]
  |  
  | goroutine 1 [running]:
  | github.com/buildkite/agent/logger.(*Logger).Info(0x0, 0x1ad0c44, 0x1d, 0xc00021cb60, 0x3, 0x3)
  | /code/logger/log.go:94 +0x22
  | github.com/buildkite/agent/agent.(*ArtifactBatchCreator).Create(0xc0000d0ff0, 0xc0000d0ff0, 0xc000280000, 0x86, 0x0, 0x0)
  | /code/agent/artifact_batch_creator.go:49 +0x30b
  | github.com/buildkite/agent/agent.(*ArtifactUploader).upload(0xc00001d840, 0xc00000c1f0, 0x1, 0x1, 0x2, 0x2)
  | /code/agent/artifact_uploader.go:211 +0x32b
  | github.com/buildkite/agent/agent.(*ArtifactUploader).Upload(0xc00001d840, 0xc00002e059, 0x1e)
  | /code/agent/artifact_uploader.go:55 +0x1ec
  | github.com/buildkite/agent/clicommand.glob..func5(0xc00010cdc0)
  | /code/clicommand/artifact_upload.go:95 +0x2dc
  | github.com/urfave/cli.HandleAction(0x18ba680, 0x1af3ff8, 0xc00010cdc0, 0x0, 0xc0000a73e0)
  | /go/pkg/mod/github.com/urfave/cli@v0.0.0-20180226030253-8e01ec4cd3e2/app.go:503 +0x7c
  | github.com/urfave/cli.Command.Run(0x1aba774, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1ad6f77, 0x23, 0x0, ...)
  | /go/pkg/mod/github.com/urfave/cli@v0.0.0-20180226030253-8e01ec4cd3e2/command.go:165 +0x459
  | github.com/urfave/cli.(*App).RunAsSubcommand(0xc0001f2380, 0xc00010cb00, 0x0, 0x0)
  | /go/pkg/mod/github.com/urfave/cli@v0.0.0-20180226030253-8e01ec4cd3e2/app.go:383 +0x827
  | github.com/urfave/cli.Command.startApp(0x1abc02d, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1adee80, 0x2d, 0x0, ...)
  | /go/pkg/mod/github.com/urfave/cli@v0.0.0-20180226030253-8e01ec4cd3e2/command.go:330 +0x808
  | github.com/urfave/cli.Command.Run(0x1abc02d, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1adee80, 0x2d, 0x0, ...)
  | /go/pkg/mod/github.com/urfave/cli@v0.0.0-20180226030253-8e01ec4cd3e2/command.go:103 +0x80f
  | github.com/urfave/cli.(*App).Run(0xc0001f21c0, 0xc00001c100, 0x4, 0x4, 0x0, 0x0)
  | /go/pkg/mod/github.com/urfave/cli@v0.0.0-20180226030253-8e01ec4cd3e2/app.go:259 +0x6bb
  | main.main()
  | /code/main.go:109 +0x4ff
  | Traceback (most recent call last):
  | File "bazelci.py", line 1762, in <module>
  | sys.exit(main())
  | File "bazelci.py", line 1746, in main
  | incompatible_flags=args.incompatible_flag,
  | File "bazelci.py", line 551, in execute_commands
  | upload_test_logs(test_bep_file, tmpdir)
  | File "bazelci.py", line 968, in upload_test_logs
  | execute_command(["buildkite-agent", "artifact", "upload", ";".join(test_logs)])
  | File "bazelci.py", line 1034, in execute_command
  | return subprocess.run(args, shell=shell, check=fail_if_nonzero, env=os.environ).returncode
  | File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 487, in run
  | output=stdout, stderr=stderr)
  | subprocess.CalledProcessError: Command '['buildkite-agent', 'artifact', 'upload', 'src/test/shell/bazel/jdeps_test/test.log']' returned non-zero exit status 2.
  | 🚨 Error: The command exited with status 1

Does that stack trace tell you enough, or should I do more debugging? 😃

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 18 (8 by maintainers)

Most upvoted comments

That one is fixed in 3.8.2 @neto-marc, our sincere apologies, we’re figuring out how these made it past our beta and test suites.

Rolling back to 3.7.0 seems to work for us.

Apologies folks, will get a fix out in a few hours.