well i remembered once salem advice me , instead of memset and directly memcpy , use strncpy ( i did that advice with the code) but i tired that stncpy (on other part of the code ) and the result was...
Type: Posts; User: jimycn
well i remembered once salem advice me , instead of memset and directly memcpy , use strncpy ( i did that advice with the code) but i tired that stncpy (on other part of the code ) and the result was...
Hi
got segfault on memset , i could bt the segfault , but when i try to show the value of variables , gdb says no symbol for them , so i read memset document , but i myself can't see anything...
@Salem
just as my lasy comment on this thread. i just want to keep on with on old original read_from_pipe , write_to_pipe code (due the segfault) , i just want to move cs_malloc from write_to_pipe...
Well , with old read_from_pipe , write_to_pipe code , Though it was quite none-sence but it worked ,and this segfault not happened but the CRONS about that it had a obvious memory leak . with the...
@Salem
i think , now i know why this segfault is happened but don't know how could solve this one ( if i want to debug myself , i could say , This segfault happens whenever function name...
@Salem
Regard the change read_from_pipe u said in this thread , it works fien when start running the app , but after 10-15 mins gets segfault (in below except backtrace , i write which line of that...
@salem
bingo , u are brilliant (and very inteligent) , now it works perfectly as it should, and that wrong (none-sence) memory allocation in write_to_pipe is fixed by u.
another important issue...
@Dear Salem
I did as u suggested , now the good news is the program did not get segfault (maybe the reason is i had changed read_from_pipe and add those 3 line of read and also add malloc (data)...
right , but i knew this ( i and the author of the code had considered those free after every caller to read_from_pipe) , but my question (in first post of this thread) refers to how correct...
@Dear Salem
I am not authour of the source code , but i know (u are right) , the code had been written very complicated and buggy.
Well , i am not sure if i got your last post meaning...
in codes bellow , since allocated some memory for d (and never was free) , i want to add free (d) inorder to fix usages of resources in that application. , i had tried servral parts of the code ,...
@Salem
Thanks for your great tips and Comments.
Just for being sure , may i conclude from your last explanation , that in this case , i could safely remove those 3 memset?
Regards
Hi guys , with some analysis tools , i got some error performance with this source code , but i don't know What it means (The problem)
And here is related source codes :
@Salem
Is there any way (with common debug tools) figure out , where this bad passing to garbage_collector occur? (which indicate which line cause it)
ie Does adding a breakpoint with Gdb helps...
@Salem
I see , Does Those Valgrind or mtrace log have the capability to show or make us know to find Where (which line) cause passing a block to add-garbage.c in a bad way? I mean , Should i...
@Salem
I am not sure if i got your meaning completely , so , Do u mean , I should investigate codes , and if anywhere after add_garbage() , There would be , calling free() too , this would be...
Hi guys
mtrace log says :
- 0x0052cfc0 Free 21794 was never alloc'd /home/mtrace/oscam-garbage.c:100
- 0x2aa02220 Free 21919 was never alloc'd /home/mtrace/oscam-garbage.c:106
this is wrong believe , if i knew how could i fix that memory leak (with those valgrind log) i already had fixed it myself (and i didn't spend my time for creating thread , searching and uploading...
guys , the good news for me is , i had found some other users post valgrind log , i had seen those logs, but since it's first time i see a valgrind log , i didn't achieve to get any fix myself....
@Salem
how could i investiage what add_garbage() does?
as said in first post , valgrind is not supported by sh4 , so i can't use it
but i could use gdb , mtrace, is there any other tools or method...
@Salem
1 . could u please write ll_delete source code (u were meaning)
2. as the link in first post of this thread says , i think, the app has some functions like ll_remove_data() , which seems...
my app is use in stlinux (sh4) and unfortunately valgrind does not support sh4 cpu .
since i saw memory leak with my app , i had used mtrace , and it confirmed that some memory is not free . the...
Where i should add the free , in which module (oscam-simples.c or after all the lines i had called cs_malloc in all modules?! or in oscam.c , function: main() ? ) , if i would write it in any other...
Well , i think nowhere , i knew , this might be the case , but the problem is i really don't know where i have to free(tmp) , in the first thread , i made a link of entire trunk source code for this...
Hi guys
had written cs_malloc to encapsulates malloc , the result would be automatically filled with the new memory position or NULL on failure . but seems there is some bug in my cs_malloc function...