Strange problem with ping

Discussion to talk about software related topics only.
Post Reply
jaypdx
Posts: 29
Joined: Wed Oct 15, 2014 6:06 pm

Strange problem with ping

Post by jaypdx »

I copied the ProcessPing routine over from one of the examples and use it with my little console command interpreter. It works ok most of the time, but for some addresses I get this strange crash. abc.com resolves to 99.84.233.15, so it's not the ping itself causing the crash but probably something to do with the name lookup of abc.com. What's the best way to troubleshoot this?

Code: Select all

ping 8.8.8.8

Pinging : 8.8.8.8
 Response Took 0 ticks
ping nbc.com

Pinging : 0:7a0c:7a00:7a00::
 Response Took -2 ticks
ping 99.84.233.15

Pinging : 99.84.233.15
 Response Took 1 ticks
ping abc.com

Leading=BA5EBA11
SwapOutA7=00000000
SwapOutTCB=00000000
SwapInA7=00000000
SwapInTCB=00000000
nPrioOfCurTask=00000032
nPrioOfHighReady =00000032
Trailing=BA5EBA11

-------------------Trap information-----------------------------
Stack is corrupt A7=
SwapOutA7=00000000
SwapOutTCB=00000000
SwapInA7=00000000
SwapInTCB=00000000

A0=00000000 A1=00000000 A2=00000000 A3=80003CF0
A4=4000ADE0 A5=4001C780 A6=40102008 A7=62003CD8
UsedA7=400F72BA
D0=80003CF0 D1=00000000 D2=400E01EC D3=80003D40
D4=80003D63 D5=000000D5 D6=000000D6 D7=000000D7 The OSTCBCur current task control block = 800004A0
This looks like a valid TCB
The current running task is: Main#32
-------------------Task information-----------------------------
Task    | State    |Wait| Call Stack
Idle#3F|Ready     |    |400424BA,400411C0,0
Main#32|Running   |    |00000000,0
Enet#26|Fifo      |0004|40042276,4001CC74,4003AA26,400411C0,0
Config Server#2C|Semaphore |011C|40042276,4001C9FA,4000C024,4004653C,400169BA,
HTTP#2D|Semaphore |0004|40042276,4001C9FA,4000C024,4000C084,40027D0E,
User Input#31|Semaphore |F757|40042276,4001C9FA,4000C024,4000C084,4003F214,

-------------------End of Corrupt ----------------------
62003CD8
Trap Vector        =
SwapOutA7=00000000
SwapOutTCB=00000000
SwapInA7=00000000
SwapInTCB=00000000
OSISRLevel32 =00002000


Stack Frame seems corrupt unable to do RTOS dump

-------------------End of Trap Diagnostics----------------------▒Waiting 2sec to start 'A' to abort
User avatar
pbreed
Posts: 1081
Joined: Thu Apr 24, 2008 3:58 pm

Re: Strange problem with ping

Post by pbreed »

How are you converting nbc.com to an IPADDR?
You need to use a DNS lookup AsciiToIp is not going to work for a name...
jaypdx
Posts: 29
Joined: Wed Oct 15, 2014 6:06 pm

Re: Strange problem with ping

Post by jaypdx »

I hadn't really really looked at the ProcessPing() function... I assumed it was doing a DNS lookup since things like 'google.com' seemed to be doing something, but I see that's not the case. I guess AsciiToIp works with some strings but not others.
User avatar
pbreed
Posts: 1081
Joined: Thu Apr 24, 2008 3:58 pm

Re: Strange problem with ping

Post by pbreed »

Should not crash in any case.....
User avatar
TomNB
Posts: 541
Joined: Tue May 10, 2016 8:22 am

Re: Strange problem with ping

Post by TomNB »

AsciiToIp requires a string representation of an IP address to work, such as "10.1.1.1". If you passed it a name like "google.com" and somehow got a ping back, it would not be from google.com, but the string "google.com" must somehow come back as an IP address of some sort.
Post Reply