[Top][All Lists]

[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 16:17:00 +0200

On Tue, Aug 25, 2015 at 3:59 PM, Gisle Vanem <address@hidden> wrote:
Erik Ekman wrote:

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?

By a home-brew GNU-makefile. And igmp_init() is called
from lwip_init() in test\unit\lwip_unittests.c.
Are we speaking of the same tests? 

Yes. I was just confused by the order of the prints.

Do you include any file you made yourself? The tests are meant to run
by themselves, and they will init any netifs they need.

No, I've not included any private .c-files to the test. Only files
from git. You mean call netif_add()? There are 2 'netif structures'
under test\unit with a total of 5 calls to netif_add():

   netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input);
   netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input);
   netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input);
   netif_add(&net_test, &addr, &netmask, &gw, &net_test, testif_init, ethernet_input);

 netif_set_default(netif_add(&test_netif, &test_ipaddr, &test_netmask, ...

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

Seems to crash during 'Running suite(s): UDP'.

The line "TCP" after that line means it moved on to the next test suite, TCP.
The call-stack from WinDbg:

lwip_unittests!ip4_route(struct ip4_addr * dest = 0x00a61a44)+0x30
lwip_unittests!ip4_output(struct pbuf * p = 0x00a42c60, struct ip4_addr * src = "" struct ip4_addr * dest = 0x00a61a44, unsigned char ttl = 0xff '', unsigned char tos = 0x00 '', unsigned char proto = 0x06 '')+0x41
lwip_unittests!tcp_rst(unsigned long seqno = 0x196e, unsigned long ackno = 4, struct ip4_addr * local_ip = 0x00a61a40, struct ip4_addr * remote_ip = 0x00a61a44, unsigned short local_port = 0x101, unsigned short remote_port = 0x100)+0xd6
lwip_unittests!tcp_abandon(struct tcp_pcb * pcb = <Value unavailable error>, int reset = 0n1)+0x13b
lwip_unittests!tcp_abort(struct tcp_pcb * pcb = 0x00a61a40)+0xb
lwip_unittests!srunner_run_teardown(struct List * fixture_list = 0x00a58ec8, fork_status fork_usage = CK_NOFORK (0n2))+0x56
lwip_unittests!tcase_run_tfun_nofork(struct SRunner * sr = 0x00a586a0, struct TCase * tc = 0x00a57f80, struct TF * tfun = 0x00a58f08, int i = 0n0)+0xb1
lwip_unittests!srunner_iterate_tcase_tfuns(struct SRunner * sr = 0x00a586a0, struct TCase * tc = 0x00a57f80)+0xdf
lwip_unittests!srunner_iterate_suites(struct SRunner * sr = 0x00a58f08, char * sname = 0x00000000 "", char * tcname = 0x00000000 "", print_output print_mode = CK_NORMAL (0n2))+0x1c2
lwip_unittests!srunner_run_all(struct SRunner * sr = 0x00a586a0, print_output print_mode = CK_NORMAL (0n2))+0x6f

But if it's UDP test-suite, why is tcp_abort() called?

tcp_teardown is a function in test_tcp.c which is called after each test (referenced when adding the suite).
So it fails while cleaning up after running a TCP test.

I tried running both with and without forking and it works for me. (on Linux)
Maybe the netif_list parameter contains bad data after running the dhcp or etharp tests.
Try running only the TCP tests and see if it still fails. If that works it may help you to
clear netif_list and netif_default in tcp_setup() [the function called before each test] and not only in tcp_teardown().


reply via email to

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