out of memory issue

23 views
Skip to first unread message

Frans Meulenbroeks

unread,
Feb 1, 2009, 3:17:26 PM2/1/09
to opkg-devel
Hi,

While doing an opkg upgrade gnome-icon-theme on beagle board I get an
out of memory problem. RAM in the system is 256 MB; I already killed
all unneeded apps.

I've been asked to pst an strace of the request. This one is at:
http://filebin.ca/nynzpr/strace.opkg.log
(it is 3.5 MB)

I also did a quick peek at the code and mainly at libbb/unarchive.c
I've not completely gone through the code, but I feel that not all
alloced data is always freed.

e.g. around line 199 I see:
if (mknod(full_name, file_entry->mode,
file_entry->device) == -1) {
if ((function &
extract_quiet) != extract_quiet) {
perror_msg("Cannot
create node %s", file_entry->name);
}
return NULL;

no freeing of full_name, although it is dynamically allocated at line
101:
full_name = xmalloc(strlen(prefix) + strlen(path) + 1);
or at line 110:
full_name = strdup(file_entry->name);
depending on the if statement a few lines before it.

Guess there are other places where this leak shows up.
Maybe an idea to run the tool with a memory leakage detection tool?

Anyway, hope this helps. If you need more info do not hesitate to
contact me directly (I'm not subscribed to this list).

FM.

Tick

unread,
Feb 5, 2009, 1:17:10 AM2/5/09
to opkg-devel
Hi FM,
Yes you are right. There indeed have some memory leaks.
I am considering removing the xmalloc stuff and take some time
reviewing the memory leak.
For opkg-cl it's okay, however, if you want to use libopkg, these
memory leak should be handle carefully.

Any patch reducing memory leak is very welcomed. :)

Cheers,
Tick

On 2月2日, 上午4時17分, Frans Meulenbroeks <fransmeulenbro...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages