fenconsultants opened a new issue #136: Hard fault in networking stack. URL: https://github.com/apache/incubator-nuttx/issues/136 Running the uIP based web server on an STM32F4 with Ethernet connection, I get errors and eventually a hard fault provoked by loading multiple pages (opening multiple connections on port 80) in quick succession, e.g. by loading a web page that includes a couple of css files, a couple of js files and a couple of images. The errors are: `tcp_datahandler: ERROR: Failed to create new I/O buffer chain` This is from iob_tryalloc failing to allocate a buffer. It is repeated multiple times per page load. More rarely I see: `tcp_datahandler: ERROR: Failed to add data to the I/O buffer chain: -12` Initially this resulted in most of the connections failing and httpd processes hanging, but after setting CONFIG_NET_TCPBACKLOG_CONNS to 8 the page almost always fully loads (connections succeed) despite the errors. However within a minute or two of repeatedly reloading pages, I get a hard fault. ``` up_hardfault: PANIC!!! Hard fault: 40000000 up_assert: Assertion failed at file:armv7-m/up_hardfault.c line: 148 task: <pthread> up_registerdump: R0: 00000000 200153e0 20010820 00000000 00000000 20012a60 00000000 ffffffff up_registerdump: R8: ffffffff 00000000 2001bd62 00000002 000012c0 200163d8 080197eb 08012860 up_registerdump: xPSR: 00000000 PRIMASK: 00000001 CONTROL: 00000000 up_registerdump: EXC_RETURN: fffffff9 up_dumpstate: sp: 200014a8 up_dumpstate: IRQ stack: up_dumpstate: base: 20001500 up_dumpstate: size: 00000800 up_stackdump: 200014a0: 20001500 08000cd7 00000001 00000000 00000002 000012c0 200163d8 080197eb up_stackdump: 200014c0: 08012860 08021178 00000003 0800110d 080010cd 2000d8c0 2001638c 080014fd up_stackdump: 200014e0: 00000001 080011f5 00000001 2001638c 20012a60 00000000 ffffffff 08000dc3 up_dumpstate: sp: 200163d8 up_dumpstate: User stack: up_dumpstate: base: 20016478 up_dumpstate: size: 00000ffc up_stackdump: 200163c0: 20010820 00000000 000012c0 080197eb 08012860 00000000 2000bba8 20012ab8 up_stackdump: 200163e0: 20012ab8 0800f275 20012ab8 20012a60 2001add6 2001ac70 08028030 0800e399 up_stackdump: 20016400: 2000bba8 20012ab8 2001add6 0800e4e7 2001bda4 08014087 2001bda4 08007ff9 up_stackdump: 20016420: 20015360 08019255 00000000 0000000b 2001be34 2001adb8 00000000 20015360 up_stackdump: 20016440: 20015460 20012880 2001288c 00000000 00000000 00000000 00000000 08018aa9 up_stackdump: 20016460: 00000000 00000000 00000000 00000000 00000000 00000000 000101aa 00000001 ``` R15 is inside _net_timedwait and R14 is inside nxsem_wait. I've attached the map. [System.map.txt](https://github.com/apache/incubator-nuttx/files/4090296/System.map.txt) Also my config: [defconfig.txt](https://github.com/apache/incubator-nuttx/files/4090300/defconfig.txt)
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services