Memory leak in uClinux 2.4.24
"Petersen, Joel (GE Healthcare)" <[email protected]> Mon, 21 Jun 2010 09:50:21 -0400
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers.coldfire |
|---|---|
| Message-ID | <9347757D0DCF4A439ECD105389B81B1C024F06BD@CINMLVEM21.e2k.ad.ge.com> |
This is a multi-part message in MIME format.
------_=_NextPart_001_01CB1148.B0D219FF
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hello
=20
I have a system using uClinux 2.4.24 on Coldfire 5282, slaved to a host
PC. I was investigating a problem when I found that the way I was
setting the system date and time from the host PC with my application
generated a memory leak. The application memory space grows by 96 bytes
on every call. I can't tell if the memory leak is the problem I'm
chasing, but I want to fix the leak.
=20
The call I use is:
sprintf(msg, "busybox date %s", dateTimeStr);
system(msg);
=20
For testing, I changed the call to:
system("busybox echo test");
and I still saw the memory leak.
=20
It looks like calling busybox is the problem. Upgrading uClinux (e.g. to
2.6.x) is not an option. I took a look at moving the busybox date source
to my application, but found that the stime( ) call wouldn't run in user
space.
=20
1. Is this a known bug in busybox?
2. Am I invoking busybox wrong?
3. Is there an alternative way to set the date and time?
4. I have my own drivers. Can I set date and time from a driver?
=20
Thanks in advance.
Joel Petersen
GE Healthcare
=20
=20
------_=_NextPart_001_01CB1148.B0D219FF
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.6000.17023" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D458041413-21062010>Hello</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D458041413-21062010></SPAN></FONT> </DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial size=3D2>I have =
a system=20
using uClinux 2.4.24 on Coldfire 5282, slaved to a host PC. I was =
investigating=20
a problem when I found that the way I was setting the system date and =
time from=20
the host PC with my application generated a memory leak. The =
application=20
memory space grows by 96 bytes on every call. I can't tell if the memory =
leak is=20
the problem I'm chasing, but I want to fix the leak.</FONT></SPAN></DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial size=3D2>The =
call I use=20
is:</FONT></SPAN></DIV>
<DIV><SPAN class=3D458041413-21062010> <FONT =
face=3DArial=20
size=3D2>sprintf(msg, "busybox date %s", =
dateTimeStr);</FONT></SPAN></DIV>
<DIV><SPAN class=3D458041413-21062010> <FONT =
face=3DArial=20
size=3D2>system(msg);</FONT></SPAN></DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial size=3D2>For =
testing, I=20
changed the call to:</FONT></SPAN></DIV>
<DIV><SPAN class=3D458041413-21062010> <FONT =
face=3DArial=20
size=3D2>system("busybox echo test");</FONT></SPAN></DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial size=3D2>and I =
still saw=20
the memory leak.</FONT></SPAN></DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial size=3D2>It =
looks like=20
calling busybox is the problem. Upgrading uClinux (e.g. to 2.6.x) is not =
an=20
option. I took a look at moving the busybox date source to my=20
application, but found that the stime( ) call wouldn't run in user=20
space.</FONT></SPAN></DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D458041413-21062010>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial size=3D2>1. =
Is this a=20
known bug in busybox?</FONT></SPAN></DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial size=3D2>2. Am =
I invoking=20
busybox wrong?</FONT></SPAN></DIV><FONT face=3DArial><FONT =
size=3D2><SPAN=20
class=3D458041413-21062010>3</SPAN>. Is there an alternative way to set =
the date=20
and time?</FONT></FONT></SPAN></DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial size=3D2>4. I =
have my own=20
drivers. Can I set date and time from a driver?</FONT></SPAN></DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D458041413-21062010><FONT face=3DArial size=3D2>Thanks =
in=20
advance.</FONT></SPAN></DIV>
<P><FONT face=3DArial size=3D2>Joel</FONT> <SPAN =
class=3D458041413-21062010><FONT=20
face=3DArial size=3D2>Petersen</FONT></SPAN></P>
<P><SPAN class=3D458041413-21062010><FONT face=3DArial size=3D2>GE=20
Healthcare</FONT></SPAN></P>
<P><SPAN class=3D458041413-21062010><FONT face=3DArial=20
size=3D2></FONT></SPAN> </P>
<DIV> </DIV></BODY></HTML>
[email protected]=09Send a post to the list.
[email protected]=09Join the list.
[email protected]=09Join the list in digest mode.
[email protected]=09Leave the list.
------_=_NextPart_001_01CB1148.B0D219FF--