[En-Nut-Discussion] PPP/memory problem

Ernst Stippl ernst at stippl.org
Wed Oct 17 21:50:54 CEST 2007


Hi Daniel!

I searched thru the archive and found this. I do not know if the fix made it
into 4.4.0.0. Please have a look.

Regards
ernst 

-------------------------------------------------------------

Brett Abbott wrote:
> Hi all.
>
> We're just upgrading to the latest nutos release and see that the ppp 
> memory leak suggested last year may have not made it into the release.
> Is anyone able to advise if it was implemented in another way?  
> Details below (original post included for reference).
>
> static int NutPppClose(NUTFILE * fp)
> {
>    PPPDCB *dcb = fp->nf_dev->dev_dcb;
>
>    IpcpClose(fp->nf_dev);
>    if (dcb->dcb_user)
>        NutHeapFree(dcb->dcb_user);
>    if (dcb->dcb_pass)
>        NutHeapFree(dcb->dcb_pass);
>
>    // Add _close of uart?
>    if(dcb->dcb_fd)
>        _close(dcb->dcb_fd); // Added This line to close uart device?
>    // End of change
>
>   NutHeapFree(fp);
>
>    return 0;
> }
>
>
> Many thanks in advance from down under.
> Brett
>
> -------- Original Message --------
> Subject: 	[En-Nut-Discussion] PPP - Should NutPPPClose() also close
the 
> uart device?
> Date: 	Tue, 24 Oct 2006 22:52:02 +1300
> From: 	Brett Abbott <Brett.Abbott at digital-telemetry.com>
> Reply-To: 	Ethernut User Chat (English) <en-nut-discussion at egnite.de>
> To: 	Ethernut User Chat (English) <en-nut-discussion at egnite.de>
>
>
>
> Hi
>
> NutPPPOpen starts by opening the uart device using _open() however
> NutPPPClose() does not close the uart device, leaving the uart file 
> lost in memory (unless Im meant to delete it elsewhere - oops).
>
> Does anyone have an opinion on how best to address this? Perhaps by 
> adding a friendly close prior to the NutHeapFree(fp) in NutPppClose?
>
> Many Thanks in advance
> Brett
>
> static int NutPppClose(NUTFILE * fp)
> {
>    PPPDCB *dcb = fp->nf_dev->dev_dcb;
>
>    IpcpClose(fp->nf_dev);
>    if (dcb->dcb_user)
>        NutHeapFree(dcb->dcb_user);
>    if (dcb->dcb_pass)
>        NutHeapFree(dcb->dcb_pass);
>
>    // Add _close of uart?
>    if(dcb->dcb_fd)
>        _close(dcb->dcb_fd); // Added This line to close uart device?
>    // End of change
>
>   NutHeapFree(fp);
>
>    return 0;
> }
>
>   

--
-----------------------------------------------------------------
Brett Abbott, Managing Director, Digital Telemetry Limited
Email: Brett.Abbott at digital-telemetry.com
PO Box 24 036 Manners Street, Wellington, New Zealand Phone +64 (4) 462-3439
Mobile +64 (21) 656-144
------------------- Commercial in confidence --------------------


_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion




-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von p3stk4
Gesendet: Dienstag, 16. Oktober 2007 16:58
An: en-nut-discussion at egnite.de
Betreff: [En-Nut-Discussion] PPP/memory problem

Welcome,

I'm writting a program for device which has to connect via GPRS modem
send (MC35i) and some information to the server. Everything was good
until program become bigger. Than I've noticed a problem with PPP
driver. Without any reason it cannot establish connection (modem says
ERROR/OK) or device hangup or restart.
It seams to be a memory - like problem, because sometimes the
configuration structure in the memory is overwritten with some data. 

How can I solve this problem?

The device is:
ATmega128 + 64 KB sram memory (3 wait states, one block)
One RS232
and nothing more.

Configuration file used to build Nut/OS:

PLATFORM = "ETHERNUT1"
AVR_GCC = ""
MCU_ATMEGA128 = ""
NUTMEM_START = "0x100"
NUTMEM_RESERVED = "64"
NUTXMEM_SIZE = "0xEE00"
NUTXMEM_START = "0x1100"
NUT_CPU_FREQ = "16000000"

Software:
avr-gcc 4.2.1-1
avr-libc 1.4.5-2
binutils-avr 2.17
Nut/OS 4.4.0.0
Ubuntu Gutsy Gibbon RC




The main below.
Regards,
Daniel Lewandowski





More information about the En-Nut-Discussion mailing list