jzck / 42sh

:four::two: bash-like shell (school project)
7 stars 2 forks source link

leaks fds #210

Closed Gwojda closed 7 years ago

Gwojda commented 7 years ago
➜  42sh git:(master) ✗ qqqqqqqqq
./42sh: command not found: qqqqqqqqq
==13385== 
==13385== HEAP SUMMARY:
==13385==     in use at exit: 21,635 bytes in 176 blocks
==13385==   total heap usage: 980 allocs, 804 frees, 473,411 bytes allocated
==13385== 
==13385== 290 (240 direct, 50 indirect) bytes in 10 blocks are definitely lost in loss record 53 of 61
==13385==    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
==13385==    by 0x41C2B0: ft_malloc (in /home/gwojda/42sh/42sh)
==13385==    by 0x41BED3: ft_lstnew (in /home/gwojda/42sh/42sh)
==13385==    by 0x41C0B9: push (in /home/gwojda/42sh/42sh)
==13385==    by 0x40737F: exec_pushfds (in /home/gwojda/42sh/42sh)
==13385==    by 0x407078: exec_init (in /home/gwojda/42sh/42sh)
==13385==    by 0x4169BF: data_init (in /home/gwojda/42sh/42sh)
==13385==    by 0x417450: shell_init (in /home/gwojda/42sh/42sh)
==13385==    by 0x417051: main (in /home/gwojda/42sh/42sh)
m600x commented 7 years ago

screen shot 2017-03-27 at 10 31 21

Gwojda commented 7 years ago

quelle commande ?

m600x commented 7 years ago

Une commande erronée. (ex: a)

Avant le leak correspondait a 2 blocks de fork, maintenant c'est 12 blocks.

Gwojda commented 7 years ago

l'erreur est identique, c'est juste valgrind sur mac qui fait de la merde du coup Et jte rassure sur linux on a qu'une erreur, fork ne leak pas ^^