[Klone-users] Memory Leak in uClinux

Steven Dorigotti dorigotti at koanlogic.com
Fri Aug 14 06:09:49 EDT 2009


Hello Moises,

   what you are seeing is a one-time leak upon initialisation of the  
embedded file system.

   So it is not connected to the problems you are having upon refresh.  
Either:

- some info is missing (did you run your full previous test case, with  
refreshes, under valgrind?);
- or the problems you are having might be caused by something external  
(e.g. uclibc problem which causes kloned process to grow).

   Do you have a reference linux distribution with that version of  
uclinux, so we can find an iso (or is it custom)? Any other info?

cheers,
sd


On 12/ago/09, at 19:54, moises acuna wrote:

> Hi Steven,
> thanks for the response.
> first i tried with a reduced version of the project, but it's still  
> growing with every refresh. So i tried it with Valgrind and it seems  
> that the leak is in some KLone files.
> this is the report:
>
> --3673-- supp:     21 dl-hack3-1
> ==3673== malloc/free: in use at exit: 1,996 bytes in 99 blocks.
> ==3673== malloc/free: 8,305 allocs, 8,206 frees, 5,136,560 bytes  
> allocated.
> ==3673==
> ==3673== searching for pointers to 99 not-freed blocks.
> ==3673== checked 331,292 bytes.
> ==3673==
> ==3673== 1,988 (1,808 direct, 180 indirect) bytes in 89 blocks are  
> definitely lost in loss record 3 of 3
> ==3673==    at 0x4021BDE: calloc (vg_replace_malloc.c:397)
> ==3673==    by 0x80953D9: u_zalloc (memory.c:63)
> ==3673==    by 0x80910CC: u_hmap_o_new (hmap.c:1072)
> ==3673==    by 0x8075D9E: emb_register (emb.c:69)
> ==3673==    by 0x807F926:  
> module_init_2c8d30e5acaba22237ea983216ef3130  
> (pg_2c8d30e5acaba22237ea983216ef3130.c:50)
> ==3673==    by 0x807AA41: do_register (register.c:22)
> ==3673==    by 0x807AA29: register_pages (register.c:9)
> ==3673==    by 0x8075BA1: emb_init (emb.c:32)
> ==3673==    by 0x8050C3D: app_init (main.c:96)
> ==3673==    by 0x805130C: main (entry.c:397)
> ==3673==
> ==3673== LEAK SUMMARY:
> ==3673==    definitely lost: 1,808 bytes in 89 blocks.
> ==3673==    indirectly lost: 180 bytes in 9 blocks.
> ==3673==      possibly lost: 0 bytes in 0 blocks.
> ==3673==    still reachable: 8 bytes in 1 blocks.
> ==3673==         suppressed: 0 bytes in 0 blocks.
>
>
>
>
> by 0x807F926: module_init_2c8d30e5acaba22237ea983216ef3130  
> (pg_2c8d30e5acaba22237ea983216ef3130.c:50)
>
> this one is generated in the site. It says that the leak is in this  
> function:
>
> void module_init_2c8d30e5acaba22237ea983216ef3130(void)
> {
>     res_ctor();
>     emb_register((embres_t*)&e);
> }
>
> i don't know if this is some kind of a bug or something.
>
> The problem here is that the kloned process in the uCLinux is growin  
> and growing with every refresh and after 3 days running the server  
> will have an stack overflow or something. This doesn't happen in  
> Ubuntu.
>
> Thanks for any help with this.
>
>
>
> 2009/8/11 Steven Van Ingelgem <steven at vaningelgem.be>
> You can try running it through valgrind:
>
> valgrind -v --leak-check=full ./kloned
>
>
> After you have done running the pages, you can see if it is truly a  
> leak or not.
>
>
> --
> Steven
> www.salvania.be
>
> 2009/8/12 moises acuna <moises.acuna at gmail.com>
> Hello everyone,
> i'm having trouble with the Klone server over uClinux. The kloned  
> process memory allocation is getting bigger and bigger every refresh  
> of a page (i have an option in a page to turn on or off an every-5- 
> seconds-autorefresh), but this happens only in uClinux , with  
> Linux( Ubuntu 8.04) this doesn't happens. The process stays stable  
> there. I've been trying to manage the memory for arrays and  
> everything the best way possible and not leaving any pointer  
> hanging. Have you ever had a problem like this. Am I missing  
> something. Thanks for any help.
>
> pd. the uclinux version is  v3.2.0.ANI0803
>
>
>
> -- 
> Moisés AAC
>
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>
>
>
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users
>
>
>
>
> -- 
> Moisés AAC
> _______________________________________________
> Klone-users mailing list
> Klone-users at koanlogic.com
> http://koanlogic.com/cgi-bin/mailman/listinfo/klone-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://koanlogic.com/pipermail/klone-users/attachments/20090814/dd2ce0f9/attachment.htm


More information about the Klone-users mailing list