|
From: | Bastiaan van Kesteren |
Subject: | Re: [lwip-users] netconn_new() hangs when link is down |
Date: | Wed, 18 Feb 2015 17:00:39 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
address@hidden schreef op 17-2-2015 om 21:32:
Bastiaan van Kesteren wrote:Once the link has been up and goes down, the very next call to one of these 'client' applications causes it to hang; [..] The sys_arch_sem_wait() never returns, the semaphore is never signalled. Plugging the network cable back in doesn't resolve the issue, a restart is required. I'd much rather have some kind of ERR_CONN return value somewhere.... Anyone with idea's about whats going on?No, but try to have a look at lwip_stats, maybe you're out of memory in one of the pools?If that fails, try enabling tracing.
Found it; user error, it seems....I have a logging-function on my system, which is also used to log link up/down changes. This log-function keeps the last n messages in ram, and, if configured to do so, sends the message to a syslog server.
I got a sys_timeout() running which periodically polls the network-interface link. When it goes down, i call this logging-function, which in turn does it's syslog trick, using the netconn api.
So, effectively, when the network link goes down, I'm using the netconn api from the tcpip thread. That might explain why that semaphore never gets signalled; I'm waiting on it from the same thread that should signal it.... Oops. And the best thing; I got this construction for almost a year now, never noticed this bug before....
Regards, -Bastiaan
[Prev in Thread] | Current Thread | [Next in Thread] |