lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lpc_enetif_input HardFault


From: Nathan Hartman
Subject: Re: [lwip-users] lpc_enetif_input HardFault
Date: Mon, 6 Nov 2017 11:57:50 -0800

On Nov 6, 2017, at 6:57 AM, Elmar Wieser <address@hidden> wrote:

Hello,

 

we have unreproduceable hardfaults in function lpc_enetif_input which occur randomly from 1 to 5 days.

 

void lpc_enetif_input(struct netif *netif)

{

                struct eth_hdr *ethhdr;

 

                struct pbuf *p;

 

                /* move received packet into a new pbuf */

                p = lpc_low_level_input(netif);

                if (p == NULL) {

                               return;

                }

 

The p pointer seems to be valid (0x20003c60) but has an invalid next pointer (0x8e8e1e60).

 

Heap and Stack seems to be okay (half filled while debugging the hardfault).

We are thinking about problems with the DMA controller / configuration, but cannot find the problem yet. Can anybody give us a hint?

 

System Configuration:

NO_SYS  = 1, LPC1778, DMA, no external RAM, IRAM1 0x10000000 Size 0x10000, IRAM2 0x20000000 Size 0x8000, lwip 2.0.3, Stack Size:  0x1E00,Heap Size: 0x6000

 

Lwipopts.h (https://pastebin.com/1vihHC31)

 


In situations like these, it's usually something totally unrelated to the function where the failure occurs. It appears something is corrupting this pointer and possibly other data. Could be the stack and heap are clobbering each other. Check that you have configured your build to provide enough stack. Barring that, look for buffer overruns, use after free, and unsafe strong functions (like strncpy which can leave a string unterminated).

reply via email to

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