RE: Memory leak in uClinux 2.4.24

"Ken Kerr" <[email protected]> Mon, 21 Jun 2010 10:05:54 -0400
Newsgroups gmane.comp.hardware.motorola.microcontrollers.coldfire
Message-ID <967744224C44F641AEC562017979FDA1010C6D0E@DOMAINSERVER.engineering.synchrony.com>
This is a multi-part message in MIME format.

------_=_NextPart_001_01CB114A.DD75F19C
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

We set the date as follows (no busybox) :

=20

    sprintf(msg, "date %s", dateTimeStr);  where dateTimeStr =3D
MMDDHHMMYYYY

    system(msg);

=20

Ken Kerr

Synchrony, Inc

(540) 444-4226

=20

This email may contain information that is proprietary, privileged,
and/or confidential and is intended exclusively for the person(s) to
whom it is addressed. Any use, copying, retention, or disclosure by any
person other than the intended recipient or the intended recipient's
designees is strictly prohibited. If you are not the intended recipient
or their designee, please notify the sender immediately by return email
and delete all copies of this email.

=20

=20

From: [email protected] [mailto:[email protected]]
On Behalf Of Petersen, Joel (GE Healthcare)
Sent: Monday, June 21, 2010 9:50 AM
To: Ken Kerr
Subject: [ColdFire] Memory leak in uClinux 2.4.24

=20

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

[email protected] Send a post to the list.
[email protected] Join the list. [email protected]
Join the list in digest mode. [email protected] Leave the
list.


------_=_NextPart_001_01CB114A.DD75F19C
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:"Comic Sans MS";
	panose-1:3 15 7 2 3 3 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DWordSection1>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>We set the date as follows (no busybox) =
:<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=3DMsoNormal>&nbsp;&nbsp;&nbsp; <span =
style=3D'font-size:10.0pt;font-family:
"Arial","sans-serif"'>sprintf(msg, &quot;date %s&quot;, =
dateTimeStr);&nbsp; where
dateTimeStr =3D MMDDHHMMYYYY</span><o:p></o:p></p>

<p class=3DMsoNormal>&nbsp;&nbsp;&nbsp; <span =
style=3D'font-size:10.0pt;font-family:
"Arial","sans-serif"'>system(msg);</span><o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Comic =
Sans MS";
color:#1F497D'>Ken Kerr</span><span =
style=3D'color:#1F497D'><o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>Synchrony, Inc</span><span =
style=3D'font-size:11.0pt;font-family:
"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif";
color:#1F497D'>(540) 444-4226</span><span =
style=3D'font-size:11.0pt;font-family:
"Calibri","sans-serif";color:#1F497D'><o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;<o:p></o:p></span></p>

<p class=3DMsoNormal><i><span =
style=3D'font-size:7.5pt;font-family:"Courier New";
color:#1F497D'>This email may contain information that is proprietary,
privileged, and/or confidential and is intended exclusively for the =
person(s)
to whom it is addressed. Any use, copying, retention, or disclosure by =
any
person other than the intended recipient or the intended recipient's =
designees
is strictly prohibited. If you are not the intended recipient or their
designee, please notify the sender immediately by return email and =
delete all
copies of this email.<o:p></o:p></span></i></p>

<p class=3DMsoNormal><span =
style=3D'color:#1F497D'><o:p>&nbsp;</o:p></span></p>

</div>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt =
0in 0in 0in'>

<p class=3DMsoNormal><b><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span>=
</b><span
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
[email protected] [mailto:[email protected]] <b>On =
Behalf
Of </b>Petersen, Joel (GE Healthcare)<br>
<b>Sent:</b> Monday, June 21, 2010 9:50 AM<br>
<b>To:</b> Ken Kerr<br>
<b>Subject:</b> [ColdFire] Memory leak in uClinux =
2.4.24<o:p></o:p></span></p>

</div>

</div>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Hello</span><=
o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>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&nbsp;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.</span><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>The
call I use is:</span><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal>&nbsp;&nbsp;&nbsp; <span =
style=3D'font-size:10.0pt;font-family:
"Arial","sans-serif"'>sprintf(msg, &quot;busybox date %s&quot;, =
dateTimeStr);</span><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal>&nbsp;&nbsp;&nbsp; <span =
style=3D'font-size:10.0pt;font-family:
"Arial","sans-serif"'>system(msg);</span><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>For
testing, I changed the call to:</span><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal>&nbsp;&nbsp;&nbsp; <span =
style=3D'font-size:10.0pt;font-family:
"Arial","sans-serif"'>system(&quot;busybox echo =
test&quot;);</span><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>and
I still&nbsp;saw the memory leak.</span><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>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&nbsp;the busybox date&nbsp;source =
to my
application, but found that the stime( ) call wouldn't run in user =
space.</span><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>1.
Is&nbsp;this a known bug in&nbsp;busybox?</span><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>2.
Am I invoking busybox wrong?</span><o:p></o:p></p>

</div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>3.
Is there an alternative way to set the date and =
time?</span><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>4.
I have my own drivers. Can I set date and time from a =
driver?</span><o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Thanks
in advance.</span><o:p></o:p></p>

</div>

<p><span =
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Joel</span>&n=
bsp;<span
style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Petersen</spa=
n><o:p></o:p></p>

<p><span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>GE
Healthcare</span><o:p></o:p></p>

<p>&nbsp;<o:p></o:p></p>

<div>

<p class=3DMsoNormal>&nbsp;<o:p></o:p></p>

</div>

<p class=3DMsoNormal>[email protected] Send a post to the list.
[email protected] Join the list. [email protected] =
Join the
list in digest mode. [email protected] Leave the =
list.<o:p></o:p></p>

</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_01CB114A.DD75F19C--