lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Crash when doing stresstest with ppp and sockets/UDP


From: zulu4711
Subject: Re: [lwip-users] Crash when doing stresstest with ppp and sockets/UDP
Date: Thu, 21 Dec 2017 10:57:55 -0700 (MST)

Thanks for input Sylvain!

I'm sure that I'm doing something wrong, I just need to find out what ;)
In the project this will eventually go into, I have around 300.000 lines of
C code and more than 50 separate threads running so a "non RTOS" operation
is not possible.

I was led to believe (not paying enough attention) that once you decide that
you want to run lwip in "RTOS mode", most will be protected and thread safe
and this is clearly not the case (my fault!)
(and I have actually been reading the documentation on lwip/ppp, but maybe
I'm just not getting all the hints in the various documents, I'm sure I'm
not alone in that)

The test I have running was/is organized as follows:

"sio thread":
  loops and:
    calls pppos_input() with data from serial port (only when ppp != null,
ie ppos_create() etc has been called)
    Note: PPP_INPROC_IRQ_SAFE is set to 1
    when re-connecting is needed (signalled using flags) it calls
ppp_close() (when DCD goes away) and then ppp_connect() (when DCD comes
again)

"UDP worker thread":
  call netconn_send() and netconn_receive in a loop forever
  
"TCP worker thread":
  call send() and receive in a loop forever
  
Both the "UDP worker" and the "TCP worker" threads are each started twice
(so 4 "worker" threads are running)


"main thread":
  at startup/initialization it:
  starts the "SIO thread"
  dials the modem and waits for DCD (connected)
  calls tcpip_init(), pppos_create(), ppp_connect()
  waits for first time connection, then starts the other threads
  
  after this nothing more is done in the "main thread"!
  
This crashed (after 2 to 5 reconnect sessions).
I then changed the ppp_close() and ppp_connect() in the "SIO thread" to
pppapi_close() and pppapi_open(). 
This seems to work, at least it has been running much longer than without
using pppapi_ functions.

Once again, thanks for a nice project and all the help :)

Carsten




--
Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html



reply via email to

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