artemiscloud / activemq-artemis-operator

Apache License 2.0
66 stars 62 forks source link

SIGSEGV creating address with name only #1022

Closed brusdev closed 1 week ago

brusdev commented 1 week ago

Describe the bug An ActiveMQArtemisAddress with the address name only causes the following error:

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=0x1ad148a]

goroutine 417 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
        /home/dbruscin/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.3/pkg/internal/controller/controller.go:116 +0x1e5
panic({0x1e4ce80?, 0x35f6e60?})
        /home/dbruscin/sdk/go1.21.11/src/runtime/panic.go:914 +0x21f
github.com/artemiscloud/activemq-artemis-operator/controllers.createAddressResource(0xc000f07bf0?, 0xc00111d7f8, {{0x24f1578?, 0xc000254c00?}, 0xc0007a8f00?})
        /home/dbruscin/Workspace/brusdev/artemiscloud/activemq-artemis-operator/controllers/activemqartemisaddress_controller.go:236 +0x7ea
github.com/artemiscloud/activemq-artemis-operator/controllers.(*ActiveMQArtemisAddressReconciler).createQueue(0xc000f07bf0, 0xc00111d7f8, {{{0xc0007e45d8?, 0xc00001b950?}, {0xc0007a8f00?, 0x36703c0?}}}, {0x24f9be0, 0xc00001b950})
        /home/dbruscin/Workspace/brusdev/artemiscloud/activemq-artemis-operator/controllers/activemqartemisaddress_controller.go:213 +0x269
github.com/artemiscloud/activemq-artemis-operator/controllers.(*ActiveMQArtemisAddressReconciler).Reconcile(0xc000f07bf0, {0x0?, 0x0?}, {{{0xc0007e45d8, 0x4}, {0xc0007a8f00, 0x18}}})
        /home/dbruscin/Workspace/brusdev/artemiscloud/activemq-artemis-operator/controllers/activemqartemisaddress_controller.go:134 +0xb2f
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x24f22f8?, {0x24edbf0?, 0xc0014661b0?}, {{{0xc0007e45d8?, 0xb?}, {0xc0007a8f00?, 0x0?}}})
        /home/dbruscin/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.3/pkg/internal/controller/controller.go:119 +0xb7

[!TIP] Vote this issue reacting with :+1: or :-1:

brusdev commented 1 week ago

Resolved by https://github.com/artemiscloud/activemq-artemis-operator/commit/1de7be8fc73f9ff178f4901dc16bb09124cbc9e8