ansible / receptor

Project Receptor is a flexible multi-service relayer with remote execution and orchestration capabilities linking controllers with executors across a mesh of nodes.
Other
156 stars 77 forks source link

"panic: runtime error: invalid memory address or nil pointer dereference" #1058

Open aheath1992 opened 1 month ago

aheath1992 commented 1 month ago

When trying to build an RPM of the receptor, receptorctl, & python3-receptor-python-worker we keep running in to a build error during the testing phase with the error. Not sure if their is a small bug in the actual code or in the tests.

--- FAIL: TestRemoteWorkUnredactedStatus (0.00s)
    --- FAIL: TestRemoteWorkUnredactedStatus/test2 (0.00s)
    controller.go:137: missing call(s) to *mock_workceptor.MockBaseWorkUnitForWorkUnit.GetStatusWithoutExtraData() /builddir/build/BUILD/receptor-1.4.8/_build/src/github.com/ansible/receptor/pkg/workceptor/remote_work_test.go:49
    controller.go:137: missing call(s) to *mock_workceptor.MockBaseWorkUnitForWorkUnit.GetStatusCopy() /builddir/build/BUILD/receptor-1.4.8/_build/src/github.com/ansible/receptor/pkg/workceptor/remote_work_test.go:50
    controller.go:137: aborting test due to missing call(s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1065ca72c]

Full build log: Build Log

sharkcz commented 1 month ago

for the record, the crash occurred on ppc64le and this is a larger snipped from the build.log (as it will be garbage collected)

...
ERROR 2024/06/04 19:40:29 Error reading /tmp/NodeID/test/status: open /tmp/NodeID/test/status.lock: no such file or directory
ERROR 2024/06/04 19:40:29 Error reading /tmp/NodeID/test/status: open /tmp/NodeID/test/status.lock: no such file or directory
--- FAIL: TestRemoteWorkUnredactedStatus (0.00s)
    --- FAIL: TestRemoteWorkUnredactedStatus/test2 (0.00s)
    controller.go:137: missing call(s) to *mock_workceptor.MockBaseWorkUnitForWorkUnit.GetStatusWithoutExtraData() /builddir/build/BUILD/receptor-1.4.8/_build/src/github.com/ansible/receptor/pkg/workceptor/remote_work_test.go:49
    controller.go:137: missing call(s) to *mock_workceptor.MockBaseWorkUnitForWorkUnit.GetStatusCopy() /builddir/build/BUILD/receptor-1.4.8/_build/src/github.com/ansible/receptor/pkg/workceptor/remote_work_test.go:50
    controller.go:137: aborting test due to missing call(s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1065ca72c]
goroutine 405 [running]:
testing.tRunner.func1.2({0x106d80da0, 0x107e05190})
    /usr/lib/golang/src/testing/testing.go:1631 +0x20c
testing.tRunner.func1()
    /usr/lib/golang/src/testing/testing.go:1634 +0x360
panic({0x106d80da0?, 0x107e05190?})
    /usr/lib/golang/src/runtime/panic.go:770 +0x168
sync.(*RWMutex).RLock(...)
    /usr/lib/golang/src/sync/rwmutex.go:68
github.com/ansible/receptor/pkg/workceptor.(*remoteUnit).UnredactedStatus(0xc000118fc0)
    /builddir/build/BUILD/receptor-1.4.8/_build/src/github.com/ansible/receptor/pkg/workceptor/remote_work.go:533 +0x6c
github.com/ansible/receptor/pkg/workceptor_test.TestRemoteWorkUnredactedStatus.func1(0xc00027dd40?)
    /builddir/build/BUILD/receptor-1.4.8/_build/src/github.com/ansible/receptor/pkg/workceptor/remote_work_test.go:53 +0x21c
testing.tRunner(0xc00027dd40, 0xc000169e30)
    /usr/lib/golang/src/testing/testing.go:1689 +0x134
created by testing.(*T).Run in goroutine 200
    /usr/lib/golang/src/testing/testing.go:1742 +0x3a4
exit status 2
FAIL    github.com/ansible/receptor/pkg/workceptor  8.880s
error: 
sharkcz commented 2 weeks ago

also koji shows failures across all arches (except aarch64)