lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] lwip_unittests crash


From: Erik Ekman
Subject: Re: [lwip-devel] lwip_unittests crash
Date: Tue, 25 Aug 2015 15:54:47 +0200

On Tue, Aug 25, 2015 at 2:12 PM, Gisle Vanem <address@hidden> wrote:
Hi list.

I've built lwIP on Windows 8.1 (using MSVC + MingW). The lwip.dll
and my test-app seems to work fine (LWIP_DHCP=1).

But the lwip_unittest program crashes inside in ip4_route()
(src/core/ipv4/ip4.c, line 145):

  /* iterate through netifs */
  for (netif = netif_list; netif != NULL; netif = netif->next) {

The value of 'netif' is 0x00000100 !! Hence the
'netif->next' also contains rubbish.

Someone who can shed some light on this?

After enabling full debug in lwip_unittest, I get:

  lwip_debug_flags: 0xff
  netif: netmask of interface  <0><0>  set to 255.0.0.0
  netif: GW address of interface  <0><0>  set to 127.0.0.1
  netif_set_ipaddr: netif address being changed
  netif: IP address of interface  <0><0>  set to 127.0.0.1
  netif: added interface lo IP addr 127.0.0.1 netmask 255.0.0.0 gw 127.0.0.1
  udp_bind(ipaddr = 0.0.0.0, port = 161)
  udp_bind: bound to 0.0.0.0, port 161)
  igmp_init: initializing

The debug messages above look strange, I didnt think there were any
loopback or igmp in the tests. How do you compile the unit tests?
Do you include any file you made yourself? The tests are meant to run
by themselves, and they will init any netifs they need.
 
  Running suite(s): UDP
   TCP
  inet_chksum_pseudo(): checksumming pbuf 00D81AF8 (has next 00000000)
  inet_chksum_pseudo(): pbuf chain lwip_chksum()=445f
  inet_chksum_pseudo(): checksumming pbuf 00D81AF8 (has next 00000000)
  inet_chksum_pseudo(): pbuf chain lwip_chksum()=ffff
  inet_chksum_pseudo(): checksumming pbuf 00D62C60 (has next 00000000)
  inet_chksum_pseudo(): pbuf chain lwip_chksum()=4a5b
  ip_output_if: ↑☻0     << ! where does this rubbish come from?
  IP header:
  +-------------------------------+
  | 4 | 5 |  0x00 |        40     | (v, hl, tos, len)
  +-------------------------------+
  |        0      |000|       0   | (id, flags, offset)
  +-------------------------------+
  |  255  |    6  |    0x387c     | (ttl, proto, chksum)
  +-------------------------------+
  |  192  |  168  |    1  |    1  | (src)
  +-------------------------------+
  |  192  |  168  |    1  |    2  | (dest)
  +-------------------------------+
  netif_loop_output()inet_chksum_pseudo(): checksumming pbuf 00D62C60 (has next 00000000)
  inet_chksum_pseudo(): pbuf chain lwip_chksum()=2425
  <crashes here> 

Can you get a backtrace from the crash? Exactly which test case is it?

Could the test_netif.name[] = <0><0> and the rubbish after
'ip_output_if' have anything to do with this crash?

test_etharp does not setup the name of its netif 'test_netif', so it
looks like it is expected to be zeros.

/Erik

reply via email to

[Prev in Thread] Current Thread [Next in Thread]