Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException when using DNS to get the IP of an existing domain which has no A record #3143

Open
dotada opened this issue Feb 4, 2025 · 4 comments
Labels

Comments

@dotada
Copy link

dotada commented Feb 4, 2025

Area of Cosmos - What area of Cosmos are we dealing with?

Networking

Expected Behaviour - What do you think that should happen?

Returned null

Actual Behaviour - What unexpectedly happens?

Crashes with NullReferenceException

Reproduction - How did you get this error to appear?

Minimal reproduction sample below

using (var e = new DHCPClient())
{
    e.SendDiscoverPacket(); // since this is a minimal sample we'll just assume this successfully fetches an IP
}
using (var e = new DnsClient())
{
    e.Connect(new Address(1, 1, 1, 1));
    e.SendAsk("googler.com"); // fine until here - this is one of the domains where if I nslookup it from powershell it doesn't return a non existent domain but it also doesn't return an IP
    Address destination = e.Receive(5000); // crashes here with a CPU exception
}

And if anyone is wondering it isn't the timeout causing the crash as it crashes in way less than 5 seconds

Version - Were you using the User Kit or Dev Kit? And what User Kit version or Dev Kit commit (Cosmos, IL2CPU, X#)?

DevKit commit 20b0880

@dotada dotada added the Bug label Feb 4, 2025
@Samma2009
Copy link

can you try google.com instead of googler.com?

@dotada
Copy link
Author

dotada commented Feb 6, 2025

Yeah, google.com works fine but I was testing if, say, I made a typo in the command and happened to hit that because in my actual code the domain is user inputted

@ADev531
Copy link

ADev531 commented Feb 15, 2025

you can add try catch statement, as it crashes with C# exception and not the cpu exception

@dotada
Copy link
Author

dotada commented Feb 15, 2025

you can add try catch statement, as it crashes with C# exception and not the cpu exception

My bad, I forgot to specify that it does crash with the CPU exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants