[Freeipmi-devel] [bug #14993] libfreeipmi sensor event messages mem-leaks (ipmi-sensor-event-messages.c)

2005-12-16 Thread Anand Babu

Update of bug #14993 (project freeipmi):

  Status:None => Fixed  
 Assigned to:None => balamurugan
 Open/Closed:Open => Closed 

___

Follow-up Comment #1:

All the internal functions which strdup in ipmi-sensor-event-messages.c are
declared static now. 2 high level APIs around them compose the allocated
dynamic strings into a list of strings (char **) and return them. User (fish:
scm-procedures.c) is already freeing them properly in scm-procedures.c.

So there are no known memory leaks in that file.

Bala and me had a lengthy discussion on approaches other than strdup, like
static string arrays, user-allocated buffers ..
But came to conclusion that the current approach is good.

--
Anand Babu



___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Freeipmi-devel mailing list
Freeipmi-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/freeipmi-devel


Re: [Freeipmi-devel] [bug #14993] libfreeipmi sensor event messages mem-leaks (ipmi-sensor-event-messages.c)

2005-12-13 Thread Albert Chu
Hey AB,

> We lost track of this bug. Can you please provide more info.

Here's the e-mail from a few months back:

-
,[ Albert Chu <[EMAIL PROTECTED]> ]
| 1) I have grave concerns with the strdup() of all of the event
| messages.  I apologize if I'm missing something, but I can't find
| where these strings are or will be freed.
|   
| When binary tools mem-leak all over the place and quickly exit, I
| feel its fine.  However, IMHO, libraries should never mem-leak,
| because you don't know how users will use the library.  For example,
| we have a host monitoring tool that loops forever doing sensor
| readings.  The current library would mem-leaks and eventually cause
| our host monitoring daemon to crash.
`
Memory leaks are serious problems. For libraries and daemons, it is
critical. Even for binaries like "fish" are interpreters. Remember if
perl or bash has memory leaks!!. Let us take this as an important
issue before 0.2 release. 

,[ Albert Chu <[EMAIL PROTECTED]> ]
| I see several solutions:
|
| 1) Return pointers to statically defined string locations.
|
| 2) Create buffers in the various structures and copy strings into
|   the buffers.
| 3) create a "destroy" or "cleanup" function.
|   
|   
| I think option #1 is the best, but that's just me.
`
There are some more ways.
4) alloca
   It is easier to make alloca portable than avoiding leaks.
   Alloca is also faster than malloc family of functions.
   Freeing is automatic. For string copying, we have strdupa, strndupa
   based on alloca. I personally preferred alloca.

I like the Al's first option (static buffers) too. It is fast and
requires no freeing. Even if we make most of allocations static, total
memory consumed will still be very very small.
-

Al

--
Albert Chu
[EMAIL PROTECTED]
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory


- Original Message -
From: Anand Babu <[EMAIL PROTECTED]>
Date: Tuesday, December 13, 2005 3:08 pm
Subject: Re: [Freeipmi-devel] [bug #14993] libfreeipmi sensor event
messages mem-leaks (ipmi-sensor-event-messages.c)

> ,[ Albert Chu <[EMAIL PROTECTED]> ]
> |  Summary: sensor event messages mem-leak => 
> libfreeipmi| sensor event messages mem-leaks (ipmi-sensor-event-
> messages.c)`
> Hi Al,
> We lost track of this bug. Can you please provide more info.
> -- 
> Anand Babu 
> GPG Key ID: 0x62E15A31
> Blog [http://ab.freeshell.org]  
> The GNU Operating System [http://www.gnu.org]  
> 



___
Freeipmi-devel mailing list
Freeipmi-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/freeipmi-devel


Re: [Freeipmi-devel] [bug #14993] libfreeipmi sensor event messages mem-leaks (ipmi-sensor-event-messages.c)

2005-12-13 Thread Anand Babu
,[ Albert Chu <[EMAIL PROTECTED]> ]
|  Summary: sensor event messages mem-leak => libfreeipmi
| sensor event messages mem-leaks (ipmi-sensor-event-messages.c)
`
Hi Al,
We lost track of this bug. Can you please provide more info.
-- 
Anand Babu 
GPG Key ID: 0x62E15A31
Blog [http://ab.freeshell.org]  
The GNU Operating System [http://www.gnu.org]  


___
Freeipmi-devel mailing list
Freeipmi-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/freeipmi-devel


[Freeipmi-devel] [bug #14993] libfreeipmi sensor event messages mem-leaks (ipmi-sensor-event-messages.c)

2005-11-16 Thread Albert Chu

Update of bug #14993 (project freeipmi):

Severity:  3 - Normal => 4 - Important  


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Freeipmi-devel mailing list
Freeipmi-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/freeipmi-devel


[Freeipmi-devel] [bug #14993] libfreeipmi sensor event messages mem-leaks (ipmi-sensor-event-messages.c)

2005-11-16 Thread Albert Chu

Update of bug #14993 (project freeipmi):

 Summary: sensor event messages mem-leak => libfreeipmi
sensor event messages mem-leaks (ipmi-sensor-event-messages.c)


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Freeipmi-devel mailing list
Freeipmi-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/freeipmi-devel