Skip to content

Ctrl+c out of job leads to invalid memory address #4915

@markkuhn

Description

@markkuhn

Bug Description

Briefly describe the unexpected behavior or performance regression. What happened that wasn’t supposed to?

When running a daemon job I want to exit out of the Checking job status... view in my CLI. When doing so I get the following error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x1058c76b8]

goroutine 12 [running]:
github.com/bacalhau-project/bacalhau/cmd/util/printer.(*JobProgressPrinter).printJobDetailsInstructions(0x1400012eac8?, 0x140008c4008, 0x140006bc270)
	github.com/bacalhau-project/bacalhau/cmd/util/printer/progress_printer.go:269 +0x2a8
github.com/bacalhau-project/bacalhau/cmd/util/printer.(*JobProgressPrinter).PrintJobProgress(0x1400012eac8, {0x10661dba8, 0x140008eb320}, 0x140006bc270, 0x140008c4008)
	github.com/bacalhau-project/bacalhau/cmd/util/printer/progress_printer.go:64 +0x11c
github.com/bacalhau-project/bacalhau/cmd/cli/job.(*RunOptions).run(0x140008a8f90, 0x140008c4008, {0x140008e4330?, 0x0?, 0x0?}, {0x10661dd68, 0x1400005e550})
	github.com/bacalhau-project/bacalhau/cmd/cli/job/run.go:156 +0x418
github.com/bacalhau-project/bacalhau/cmd/cli/job.NewRunCmd.func1(0x140008c4008, {0x140008e4330, 0x1, 0x3})
	github.com/bacalhau-project/bacalhau/cmd/cli/job/run.go:77 +0x218
github.com/spf13/cobra.(*Command).execute(0x140008c4008, {0x140008e42d0, 0x3, 0x3})
	github.com/spf13/[email protected]/command.go:985 +0x834
github.com/spf13/cobra.(*Command).ExecuteC(0x1400089c008)
	github.com/spf13/[email protected]/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:1041
github.com/bacalhau-project/bacalhau/cmd/cli.Execute({0x10661dd30, 0x14000660400})
	github.com/bacalhau-project/bacalhau/cmd/cli/root.go:137 +0xcc
main.main.func2()
	github.com/bacalhau-project/bacalhau/main.go:90 +0x34
created by main.main in goroutine 1
	github.com/bacalhau-project/bacalhau/main.go:89 +0x1a8

Expected Behavior

Detail what you expected to happen instead of the bug.

No error message

Steps to Reproduce

  1. Follow instructions in wasm-sensors demo
  2. Once you run bacalhau job run -V proxy=http://bacalhau-edge-web-services-1:8080 jobs/sqs-publisher.yaml, Ctrl+c out of the job and the error message should appear

Bacalhau Versions

  • Agent Version: Run bacalhau agent version to get this.
Bacalhau v1.7.0
BuildDate 2025-03-24 13:44:26 +0000 UTC
GitCommit 9d9cbfa53d9a8ee0480e9e333e226248d465a856
  • CLI Client Version: Run bacalhau version for the client info.
v1.7.0

Host Environment

Provide details about the environment where the bug occurred:

  • Operating System: MacOS
  • CPU Architecture: M4 Pro
  • Any other relevant environment details:

Job Specification

See instructions

Logs

Agent Logs:

(Include here if applicable.)

Client Logs:

❯ bacalhau job run -V proxy=http://bacalhau-edge-web-services-1:8080 jobs/sqs-publisher.yaml
Job successfully submitted. Job ID: j-9661ff2c-d4dc-435a-b691-46d1ec4986a9
Checking job status... (Enter Ctrl+C to exit at any time, your job will continue running):

 TIME          EXEC. ID    TOPIC            EVENT
 19:43:49.141              Submission       Job submitted
 19:43:49.148  e-5587f095  Scheduling       Requested execution on 7fbebadd3b9f
 19:43:49.153  e-5587f095  Execution        Running

Warning: Progress tracking canceled. The job is still running.
Warning: Failed to get updated job details: request cancelled

To get more details about the run, execute:
	bacalhau job describe j-9661ff2c-d4dc-435a-b691-46d1ec4986a9

To get more details about the run executions, execute:
	bacalhau job executions j-9661ff2c-d4dc-435a-b691-46d1ec4986a9
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x1058c76b8]

goroutine 12 [running]:
github.com/bacalhau-project/bacalhau/cmd/util/printer.(*JobProgressPrinter).printJobDetailsInstructions(0x1400012eac8?, 0x140008c4008, 0x140006bc270)
	github.com/bacalhau-project/bacalhau/cmd/util/printer/progress_printer.go:269 +0x2a8
github.com/bacalhau-project/bacalhau/cmd/util/printer.(*JobProgressPrinter).PrintJobProgress(0x1400012eac8, {0x10661dba8, 0x140008eb320}, 0x140006bc270, 0x140008c4008)
	github.com/bacalhau-project/bacalhau/cmd/util/printer/progress_printer.go:64 +0x11c
github.com/bacalhau-project/bacalhau/cmd/cli/job.(*RunOptions).run(0x140008a8f90, 0x140008c4008, {0x140008e4330?, 0x0?, 0x0?}, {0x10661dd68, 0x1400005e550})
	github.com/bacalhau-project/bacalhau/cmd/cli/job/run.go:156 +0x418
github.com/bacalhau-project/bacalhau/cmd/cli/job.NewRunCmd.func1(0x140008c4008, {0x140008e4330, 0x1, 0x3})
	github.com/bacalhau-project/bacalhau/cmd/cli/job/run.go:77 +0x218
github.com/spf13/cobra.(*Command).execute(0x140008c4008, {0x140008e42d0, 0x3, 0x3})
	github.com/spf13/[email protected]/command.go:985 +0x834
github.com/spf13/cobra.(*Command).ExecuteC(0x1400089c008)
	github.com/spf13/[email protected]/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/[email protected]/command.go:1041
github.com/bacalhau-project/bacalhau/cmd/cli.Execute({0x10661dd30, 0x14000660400})
	github.com/bacalhau-project/bacalhau/cmd/cli/root.go:137 +0xcc
main.main.func2()
	github.com/bacalhau-project/bacalhau/main.go:90 +0x34
created by main.main in goroutine 1
	github.com/bacalhau-project/bacalhau/main.go:89 +0x1a8

Metadata

Metadata

Assignees

No one assigned

    Labels

    request/newRequest: Indicates a new request that has been submitted and awaits initial triagetype/bugType: Something is not working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions