[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #26405] Prematurely released semaphore causes lwip_sel
From: |
Konstantin |
Subject: |
[lwip-devel] [bug #26405] Prematurely released semaphore causes lwip_select() to crash |
Date: |
Tue, 05 May 2009 07:21:01 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 |
Follow-up Comment #3, bug #26405 (project lwip):
Simon,
I don't think my port is a problem. It does indeed understand the initial
state, here is the sys_sem_new() I am using (modelled after a sample provided
with FreeRTOS):
sys_sem_t sys_sem_new(u8_t count)
{
xSemaphoreHandle xSemaphore;
portENTER_CRITICAL();
vSemaphoreCreateBinary( xSemaphore );
if (count == 0)
{
xSemaphoreTake( xSemaphore, 1 );
}
portEXIT_CRITICAL();
return xSemaphore;
}
However, I think the problem may be that sys_sem_wait_timeout() may time out
(hence the name). (In my case, the timeout was quite short.)
I am positive that in my case, a condition occured when by the time
tcpip_thread signals selectsem, the application thread was already waiting in
sys_sem_wait(selectsem), and as soon as the semaphore was released, the OS
woke up the application thread which destroyed select_cb.sem.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?26405>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/