Another DEPLOY_SA5G_SLICING.md example issue: gnbsim just segfaults on startup
The DEPLOY_SA5G_SLICING.md example starts 3 different RAN simulators, in docker-compose/docker-compose-slicing-ransim.yam.
Two of them refer to DockerHub containers rohankharade/gnbsim:latest and rohankharade/ueransim:latest, which are a bit outdated now (ca. 3 years old).
While ueransim is working, gnbsim simply segfauls:
gnbsim | Now setting these variables '@DEREG_AFTER@ @DNN@ @GNBID@ @GTPuIFname@ @GTPuLocalAddr@ @IMEISV@ @KEY@ @MCC@ @MNC@ @MSIN@ @NGAPPeerAddr@ @OPc@ @PagingDRX@ @ProtectionScheme@ @RANUENGAPID@ @RoutingIndicator@ @SD@ @SST@ @TAC@ @URL@'
gnbsim | Done setting the configuration
gnbsim | Running gnbsim
gnbsim | [gnbsim]2025/09/11 14:44:54.923773 example.go:46: Dail LocalAddr: 127.0.0.1/192.168.200.156/192.168.202.156:41760; RemoteAddr: 192.168.200.138:38412
gnbsim | [gnbsim]2025/09/11 14:44:54.923858 example.go:66: write: len 44, info: &{Stream:0 SSN:0 Flags:0 _:0 PPID:1006632960 Context:0 TTL:0 TSN:0 CumTSN:0 AssocID:0}
gnbsim | [gnbsim]2025/09/11 14:44:54.924275 example.go:87: read: len 76, info: &{Stream:0 SSN:0 Flags:0 _:0 PPID:1006632960 Context:0 TTL:0 TSN:2070284820 CumTSN:0 AssocID:69}
gnbsim | dump: 201500480000040001000903004f41492d414d460060000f010042f2880100410000f110010041005640011e0050001c0042f28800040008804000000116f000007b14000000801410000082
gnbsim | Procedure Code: id-NGSetup (21)
gnbsim | PDU Length: 72
gnbsim | Protocol IEs: 4 items
gnbsim | Item 0
gnbsim | Protocol IE: id-AMFName (1)
gnbsim | IE length: 9
gnbsim | decoding id(1) not supported yet.
gnbsim | dump: 03004f41492d414d46
gnbsim | Item 1
gnbsim | Protocol IE: id-ServedGUAMIList (96)
gnbsim | IE length: 15
gnbsim | decoding id(96) not supported yet.
gnbsim | dump: 010042f2880100410000f110010041
gnbsim | [gnbsim]2025/09/11 14:44:54.924384 example.go:66: write: len 72, info: &{Stream:0 SSN:0 Flags:0 _:0 PPID:1006632960 Context:0 TTL:0 TSN:2070284820 CumTSN:0 AssocID:69}
gnbsim | Item 2
gnbsim | Protocol IE: id-RelativeAMFCapacity (86)
gnbsim | IE length: 1
gnbsim | decoding id(86) not supported yet.
gnbsim | dump: 1e
gnbsim | Item 3
gnbsim | Protocol IE: id-PLMNSupportList (80)
gnbsim | IE length: 28
gnbsim | decoding id(80) not supported yet.
gnbsim | dump: 0042f28800040008804000000116f000007b14000000801410000082
gnbsim | [gnbsim]2025/09/11 14:44:54.928880 example.go:87: read: len 28, info: &{Stream:0 SSN:1 Flags:0 _:0 PPID:1006632960 Context:0 TTL:0 TSN:2070284821 CumTSN:0 AssocID:69}
gnbsim | dump: 00044018000003000a0002000a00550002000000260005047e004403
gnbsim | Procedure Code: id-DownlinkNASTransport (4)
gnbsim | PDU Length: 24
gnbsim | Protocol IEs: 3 items
gnbsim | [gnbsim]2025/09/11 14:44:54.928976 example.go:66: write: len 64, info: &{Stream:0 SSN:1 Flags:0 _:0 PPID:1006632960 Context:0 TTL:0 TSN:2070284821 CumTSN:0 AssocID:69}
gnbsim | Item 0
gnbsim | Protocol IE: id-AMF-UE-NGAP-ID (10)
gnbsim | IE length: 2
gnbsim | Item 1
gnbsim | Protocol IE: id-RAN-UE-NGAP-ID (85)
gnbsim | IE length: 2
gnbsim | Item 2
gnbsim | Protocol IE: id-NAS-PDU (38)
gnbsim | IE length: 5
gnbsim | EPD: 5G Mobility Management (0x7e)
gnbsim | Security Header: 0x0
gnbsim | Message Type: (0x44)
gnbsim | dump: 00044017000003000a0002000a00550002000000260004037e0058
gnbsim | Procedure Code: id-DownlinkNASTransport (4)
gnbsim | PDU Length: 23
gnbsim | Protocol IEs: 3 items
gnbsim | [gnbsim]2025/09/11 14:44:54.929275 example.go:87: read: len 27, info: &{Stream:0 SSN:2 Flags:0 _:0 PPID:1006632960 Context:0 TTL:0 TSN:2070284822 CumTSN:0 AssocID:69}
gnbsim | Item 0
gnbsim | Protocol IE: id-AMF-UE-NGAP-ID (10)
gnbsim | IE length: 2
gnbsim | Item 1
gnbsim | Protocol IE: id-RAN-UE-NGAP-ID (85)
gnbsim | IE length: 2
gnbsim | Item 2
gnbsim | Protocol IE: id-NAS-PDU (38)
gnbsim | IE length: 4
gnbsim | EPD: 5G Mobility Management (0x7e)
gnbsim | Security Header: 0x0
gnbsim | Message Type: (0x58)
gnbsim | panic: runtime error: invalid memory address or nil pointer dereference
gnbsim | [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x536e79]
gnbsim |
gnbsim | goroutine 1 [running]:
gnbsim | github.com/aead/cmac.NewWithTagSize(0x0, 0x0, 0x10, 0x9f07a0, 0x8, 0x10, 0x0)
gnbsim | /goproject/pkg/mod/github.com/aead/cmac@v0.0.0-20160719120800-7af84192f0b1/cmac.go:73 +0x29
gnbsim | github.com/aead/cmac.Sum(0xc0000fcb30, 0xc, 0x10, 0x0, 0x0, 0x10, 0x9f07a0, 0x10, 0x1, 0xc0000fcb18, ...)
gnbsim | /goproject/pkg/mod/github.com/aead/cmac@v0.0.0-20160719120800-7af84192f0b1/cmac.go:46 +0x46
gnbsim | github.com/hhorai/gnbsim/encoding/nas.(*UE).ComputeMAC(0xc0000c0580, 0xc0000fcb00, 0xc0000ebe50, 0x1, 0x4, 0xc0000fcb18)
gnbsim | /gnbsim/encoding/nas/nas.go:2156 +0x18e
gnbsim | github.com/hhorai/gnbsim/encoding/nas.(*UE).enc5GSecurityProtectedMessageHeader(0xc0000c0580, 0x4, 0xc0000ebe50, 0x0, 0x1, 0xc0000fcb00)
gnbsim | /gnbsim/encoding/nas/nas.go:808 +0x15d
gnbsim | github.com/hhorai/gnbsim/encoding/nas.(*UE).MakeSecurityModeComplete(0xc0000c0580, 0xc0000fcb18, 0x4, 0x8)
gnbsim | /gnbsim/encoding/nas/nas.go:712 +0x192
gnbsim | main.(*testSession).registrateUE(0xc00000e240, 0xc0000c0580)
gnbsim | /example/example.go:170 +0x1ed
gnbsim | main.(*testSession).registrteAll(0xc00000e240)
gnbsim | /example/example.go:149 +0x5d
gnbsim | main.main()
gnbsim | /example/example.go:582 +0x8f