Query for dereference zero pointer

26 views
Skip to first unread message

Fan Wu

unread,
Aug 24, 2025, 9:08:50 AMAug 24
to ns-3-users
Hi, I have tried to make a simple simulation for UAM. There are n*n (e.g., 5*5) ground stations, and from each ground station, there are 20 eVTOLs which will take off one by one . I used wifi model 802.11ax. It seems that the ip configuration, the lines of eVTOL and the app installation are normal. 

However, the dereference zero pointer problem cannot be solved by me. The code file is in the attachment. Please tell me what the problem is and what I should test next. Thanks a lot.

                 Fan 
UAM202508.cc

Tom Henderson

unread,
Aug 24, 2025, 3:20:22 PMAug 24
to ns-3-...@googlegroups.com
To debug your program, I built your program using debug build
configuration and used gdb to look at the assert. The problem was not
detectable (on my system) using the default build configuration.

I configured as:

./ns3 configure -d debug

I ran the program as:

./ns3 run --gdb UAM202508

Then I ran at the gdb prompt.

The debug build and the gdb backtrace revealed that the code was
asserting because a YansWifiChannel object did not have a propagation
loss model installed.

This led me to look at how you are configuring the channels. The
problem is there. First of all, for the gNB PHYs, you are creating a
separate channel object for each gNB. Then for the STA, you are
creating a channel without a propagation loss model. The error is
triggered by an assert on this STA channel.

However, the fundamental problem is that you should instantiate only one
channel object (outside of the for loop) and then call SetChannel()
using this single channel object. If you create a separate channel for
every PHY, the program cannot work because the sender and receiver have
to be on the same channel.
> --
> Posting to this group should follow these guidelines https://
> www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting <https://
> www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting>
> ---
> You received this message because you are subscribed to the Google
> Groups "ns-3-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ns-3-users+...@googlegroups.com <mailto:ns-3-
> users+un...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/ns-3-
> users/50cb0273-95ab-4702-9ff3-314132f0ed1an%40googlegroups.com <https://
> groups.google.com/d/msgid/ns-3-
> users/50cb0273-95ab-4702-9ff3-314132f0ed1an%40googlegroups.com?
> utm_medium=email&utm_source=footer>.


Fan Wu

unread,
Aug 26, 2025, 8:56:01 AMAug 26
to ns-3-users

Thanks a lot. I have modified the channel problem. Now the ip assign and application installation are completed. However, the port problem still exists. I asked chatgpt, gemini and claude. None of them can solve the question. Please tell me how to modify the code. 
Only one GS can broadcast the identity, and then the error occurs:
0.100s | GS 0: Broadcasting Identity.
NS_ASSERT failed, cond="interface", msg="Try to send on link-local multicast address, and no interface index is given!", +0.100000000s 0 file=/home/fanwu/work/ns3/ns-3.45/src/internet/model/ipv6-static-routing.cc, line=382
NS_FATAL, terminating
terminate called without an active exception
Command 'build/scratch/ns3.45-UAM202508-default --gridSize=5 --verbose=true' died with <Signals.SIGABRT: 6>.

I have not found how to set the interface for gs for multicast model. AIs all give the wrong solutions. 
Thanks a lot again.
UAM202508.cc
Reply all
Reply to author
Forward
0 new messages