Am inteles.<br><br><div class="gmail_quote">On 13 March 2012 11:58, Razvan Deaconescu <span dir="ltr"><<a href="mailto:razvan.deaconescu@cs.pub.ro">razvan.deaconescu@cs.pub.ro</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">Mihail Costea <<a href="mailto:mihail.costea90@gmail.com">mihail.costea90@gmail.com</a>> writes:<br>
> Salut,<br>
><br>
> Primesc memory leaks de la valgrind in cazul in care utilizez "fork()" fara<br>
> a face si execvp (altfel spus cand folosesc &, | sau comanda invalida).<br>
> Mai jos e mesajul din valgrind. Nu stiu ce sa ii mai fac. Ii dau<br>
> "free_parse_memory()" inainte de fiecare "exit(code)" al fiecarui copil si<br>
> pentru cazul in care fork() ar esua. Am elliminat restul memory leak-urilor<br>
> care nu tine de parser. La acesta mai mult de un "free_parse_memory()"<br>
> inainte de fiecare exit nu pot face.<br>
><br>
> ==17445== HEAP SUMMARY:<br>
> ==17445== in use at exit: 8 bytes in 1 blocks<br>
> ==17445== total heap usage: 13 allocs, 12 frees, 362 bytes allocated<br>
> ==17445==<br>
> ==17445== 8 bytes in 1 blocks are still reachable in loss record 1 of 1<br>
> ==17445== at 0x4C28F9F: malloc (vg_replace_malloc.c:236)<br>
> ==17445== by 0x4052C8: yyalloc(unsigned long) (parser.yy.c:2006)<br>
> ==17445== by 0x404DB9: yyensure_buffer_stack() (parser.yy.c:1707)<br>
> ==17445== by 0x4047E8: yy_switch_to_buffer(yy_buffer_state*)<br>
> (parser.yy.c:1504)<br>
> ==17445== by 0x404FB3: yy_scan_buffer(char*, unsigned long)<br>
> (parser.yy.c:1767)<br>
> ==17445== by 0x4050A0: yy_scan_bytes(char const*, int) (parser.yy.c:1811)<br>
> ==17445== by 0x404FFC: yy_scan_string(char const*) (parser.yy.c:1783)<br>
> ==17445== by 0x405326: globalParseAnotherString (parser.l:243)<br>
> ==17445== by 0x407F4B: parse_line (parser.y:540)<br>
> ==17445== by 0x4016E5: main (Tema1.cpp:47)<br>
<br>
</div></div>Este eroare de parser (flex/bison). Tot ceea ce apare de acolo (adică<br>
ceea ce începe cu yy_...) nu se "contorizează" :-)<br>
<br>
Răzvan<br>
_______________________________________________<br>
<a href="http://elf.cs.pub.ro/so/wiki/resurse/lista-discutii" target="_blank">http://elf.cs.pub.ro/so/wiki/resurse/lista-discutii</a></blockquote></div><br>