[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Crash in new 1.4.1
From: |
Thomas Johansen |
Subject: |
Re: [lwip-users] Crash in new 1.4.1 |
Date: |
Fri, 8 Feb 2013 12:30:07 +0100 |
Hi
I tried increasing the PBUF_POOL_SIZE (to 256) and MEM_SIZE (to 1024*1024) and
moved the memp and mem to the SDRAM (in the scatter file)
This prevent the stack from crashing. So it has defiantly something to-do with
buffer space. (I decreased the values again and the crash came again)
The scary part is, why the stack crashes and don't give a not enough memory or
something? It seems to me that the code just write beyond the memory set in the
lwipopts.h file?
The crash is gone, but that just lead to another problem.
It seems to get stuck in the netconn_recevie functioncal at some point (when I
stress it)
I have debugged it to tcpip_apimsg function in the tcpip.c.
The wait "sys_arch_sem_wait(&apimsg->msg.conn->op_completed, 0)" never
happens!!!
The semaphore is signaled from the TCP_ip thread. But the thread is still
running. ?
I have changed the code so the wait function can return.
if( SYS_ARCH_TIMEOUT == sys_arch_sem_wait(&apimsg->msg.conn->op_completed, 2))
{
return ERR_VAL;
}
It seems to me that there is a lot task synchronization/deadlock issues in the
lwip stack?
And it seems that the proble always come after the packet 6230 is send from the
server??
Thomas
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Thomas Johansen
Sent: 7. februar 2013 15:34
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Crash in new 1.4.1
Hi Nick
This is the call stack with expanded elements:
-HardFault_Handler
-lpc_low_level_input
+ netif <not in scope>
+ lpc_enetif 0x20007D90 &lpc_enetdata
+ p 0x00000000
+ q <not in scope>
- idx <not in scope>
- length 0x00000048
+ src <not in scope>
+lpc_enetif_input
It seems that 'p' is 0x00000000 (NULL)?
If I jump to callee code from the call stack window it seems to be line number
92.
I'm not sure the line is correct.!!!!
Disassembly when using callee:
0x00027FB0 F8C08064 STR r8,[r0,#0x64]
415: lpc_enetif->rx_free_descs++;
416:
417: LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
418: ("lpc_low_level_input: Packet received:
%p, size %d (index=%d)\n",
419: p, length, idx));
420:
421: /* Save size */
0x00027FB4 6F60 LDR r0,[r4,#0x74]
0x00027FB6 1C40 ADDS r0,r0,#1 <----- Jumps here
0x00027FB8 6760 STR r0,[r4,#0x74]
422: p->tot_len = (u16_t) length;
423: LINK_STATS_INC(link.recv);
424:
425: /* Queue new buffer(s) */
0x00027FBA 8129 STRH r1,[r5,#0x08]
426: lpc_rx_queue(lpc_enetif->netif);
427: }
The lpc_low_level_input at pastebin: http://pastebin.com/WV7HYHTK
When running the a TCP_ECHO demo, that came with the lwip port, it can run
"forever".
It uses netconn_listen() and then neconn_accept(..).
It just does a netconn_recv and then a netconn_write in a endless loop.
But if I rewrite the same demo, to do a netconn_connect to a remote server
sample, I have the same problem.
The server just send the received packet back to the client.
If the server has no delay between the receive and write function it is just a
matter of time before the lwip crashes.
If the server waits a couple of milliseconds before it resend (>30 ms), it
seems to work.!
Thomas
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Dipswitch
Sent: 7. februar 2013 14:12
To: Mailing list for lwIP users
Subject: Re: [lwip-users] Crash in new 1.4.1
Hi Thomas,
Can you create a pastebin with the code of lpc_low_level_input and what line it
crashed?
What variable is incorrect? etc. etc.
Only a posting a callstack isn't use full in any way...
Nick
On 2013-02-06 14:57, ThomasJ wrote:
> Hi again
>
> I also can add, that it seems not to crash if I'm on a closed LAN.
>
> Thomas
>
>
>
> --
> View this message in context:
> http://lwip.100.n7.nabble.com/Crash-in-new-1-4-1-tp21096p21098.html
> Sent from the lwip-users mailing list archive at Nabble.com.
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
****************************************************************************
This e-mail has been scanned by http://www.comendo.com and does not contain
virus.
****************************************************************************
______________________ Appended by AGRAMKOW Fluid Systems A/S
_______________________
This e-mail and any attachments may contain information which is confidential,
proprietary, privileged or otherwise protected by law. The information is
solely intended for the named addressee (or a person responsible for delivering
it to the addressee). If you are not the intended recipient of this message,
you are not authorized to read, print, retain, copy or disseminate this message
or any part of it. If you have received this e-mail in error, please notify the
sender Immediately by return e-mail and delete it from your computer.
****************************************************************************
This e-mail has been scanned by http://www.comendo.com and does not contain
virus.
****************************************************************************
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
****************************************************************************
This e-mail has been scanned by http://www.comendo.com and does not contain
virus.
****************************************************************************
______________________ Appended by AGRAMKOW Fluid Systems A/S
_______________________
This e-mail and any attachments may contain information which is confidential,
proprietary, privileged or otherwise protected by law. The information is
solely intended for the named addressee (or a person responsible for delivering
it to the addressee). If you are not the intended recipient of this message,
you are not authorized to read, print, retain, copy or disseminate this message
or any part of it. If you have received this e-mail in error, please notify the
sender Immediately by return e-mail and delete it from your computer.
****************************************************************************
This e-mail has been scanned by http://www.comendo.com and does not contain
virus.
****************************************************************************