lorawan-stack
lorawan-stack copied to clipboard
SIGSEGV ttn-lw-cli on device template create with field masks
Summary
CLI client segfaults then creating device template from a device with explicit field masks. When performing the same sequence without field masks - works as expected.
Steps to Reproduce
- ttn-lw-cli end-devices get
--lorawan-version --lorawan-phy-version --mac-settings | ttn-lw-cli end-devices templates create
Current Result
SIGSEGV
Expected Result
device template created with specified fieldmasks
Relevant Logs
~/ivan
➜ ttn-lw-cli end-devices get test-10 device-1 | ttn-lw-cli end-devices templates create > template.json
~/ivan
➜ ttn-lw-cli end-devices get test-10 device-1 --lorawan-version --lorawan-phy-version --mac-settings | ttn-lw-cli end-devices templates create > template.json
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x120 pc=0x189c8dc]
goroutine 1 [running]:
go.thethings.network/lorawan-stack/v3/pkg/ttnpb.(*EndDevice).SetFields(0x0, 0xc000abefc0, {0xc0003fe000?, 0xc000ae4160?, 0x1?})
/home/runner/work/lorawan-stack/lorawan-stack/pkg/ttnpb/end_device.pb.setters.fm.go:2168 +0xedc
go.thethings.network/lorawan-stack/v3/cmd/ttn-lw-cli/commands.glob..func71(0x0?, {0x0?, 0x0?, 0x15a6440?})
/home/runner/work/lorawan-stack/lorawan-stack/cmd/ttn-lw-cli/commands/end_device_templates.go:155 +0x6e6
go.thethings.network/lorawan-stack/v3/cmd/ttn-lw-cli/commands.asBulk.func1(0x37b9460?, {0x382fac0, 0x0, 0x0})
/home/runner/work/lorawan-stack/lorawan-stack/cmd/ttn-lw-cli/commands/bulk.go:33 +0x73
github.com/spf13/cobra.(*Command).execute(0x37b9460, {0x382fac0, 0x0, 0x0})
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0x37bafe0)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3b4
main.main()
/home/runner/work/lorawan-stack/lorawan-stack/cmd/ttn-lw-cli/main.go:27 +0x25
URL
No response
Deployment
The Things Stack Community Edition
The Things Stack Version
3.20.1
Client Name and Version
The Things Network Command-line Interface: ttn-lw-cli
Version: 3.20.1
Build date: 2022-06-29T11:00:57Z
Git commit: 801432b93
Go version: go1.18.3
OS/Arch: darwin/amd64
Other Information
@adriansmares putting you as we discussed it, please assign a person accordingly
Proposed Fix
No response
Contributing
- [ ] I can help by doing more research.
- [ ] I can help by implementing a fix after the proposal above is approved.
- [X] I can help by testing the fix before it's released.
Code of Conduct
- [X] I agree to follow TTN's Community Code of Conduct.