lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Minimal application segmentation fault


From: Christiaan Simons
Subject: Re: [lwip-users] Minimal application segmentation fault
Date: Tue, 4 Jul 2006 09:13:22 +0200

Hi Dennis,

> However, when I try to
> connect to port 7 of 192.168.0.2 using an echo client, LWIP seg faults.

Yikes...

> It
> faults even if I ping to 192.168.0.2 address. In fact, I see the same
> behavior when I ping/echoclient to any other address in the 192.168.0
subnet
> other than 192.168.0.1. By inserting some printfs, I find that seg fault
> occurs in low_level_output function. First, an ARP_REQUEST packet is
> received by mintapif_input, to which etharp_arp_input sends an ARP reply
by
> calling low_level_output, which causes the seg fault while consolidating
the
> pbuf chain into a buffer for write. I don't want to go further with the
> debugging because, I have a feeling that I am missing something basic.
Also,
> I had to make the following changes to the code in order to compile the
> minimal application.

On which revision were these changes made?
Are these recent sources from CVS? Or do they come from an ancient .tar.gz?

I had similar crash problems a long while ago with the minimal example,
but I've fixed most of these the current source. Please use these first
to ensure we're in sync.

I've tested the current source on both an old 2.4.x, a not-so recent 2.6.x
Linux kernel and on a recent OpenBSD so I'm confident it works fine.
I've tested it with 'nc' (netcat) and a few large files, and I did some
flood pings while echoing to put a bit of strain on the stack.

> 1. Remove "#define ETHARP_ALWAYS_INSERT 0" from lwipopts.h file

This line is most certainly not in the current
contrib/ports/unix/proj/minimal/lwipopts.h file!

> 2. Change the signatures of ip/arp input functions as follows in
> lwip-1.1.1/src/netif/etharp.c and lwip-1.1.1/src/include/netif/etharp.h
> files:
>
> void etharp_ip_input(struct netif *netif, struct pbuf *p);  ------------>

> struct pbuf *  etharp_ip_input(struct netif *netif, struct pbuf *p);
>
> void etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr,
struct
> pbuf *p); --------------> struct pbuf *  etharp_arp_input(struct netif
> *netif, struct eth_addr *ethaddr, struct pbuf *p);

Huh? Why these changes, no pbufs are retuned from these funcs.

Bye,

Christiaan Simons

Hardware Designer
Axon Digital Design

http://www.axon.tv





reply via email to

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