Files
42_INT_07_minishell/valgrind_invalid_read_to_fix.txt
LuckyLaszlo 106af37b58 words_expansions() complete
+ TODO : need refactoring and fix to valgrind invalid read size
+ redirections() WIP
+ Generic ft_dup_2d_arr(), ft_split_quotes(), ft_strdup_quotes()
+ shell_loop() continue on error
+ various small fix
2021-11-14 00:09:42 +01:00

158 lines
7.5 KiB
Plaintext

lucky@Tour-Lemdows10:/mnt/c/Users/Lucky/Desktop/code/minishell> 3[5;6;35
TOKENS LIST :
-----------
3[5;6;35
TOKENS LIST EXPANDED :
-----------
3[5;6;35
lucky@Tour-Lemdows10:/mnt/c/Users/Lucky/Desktop/code/minishell> [6;34'.6'
TOKENS LIST :
-----------
[6;34'.6'
==2095== Invalid read of size 1
==2095== at 0x403938: count_word (ft_split_quotes.c:63)
==2095== by 0x403806: ft_split_quotes (ft_split_quotes.c:35)
==2095== by 0x402FC0: words_expansions (words_expansions.c:56)
==2095== by 0x40275E: parsing (parsing.c:80)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095== Address 0x56d265a is 0 bytes after a block of size 10 alloc'd
==2095== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2095== by 0x4048A8: ft_strjoin (ft_strjoin.c:23)
==2095== by 0x40115C: ft_strjoinfree_s1 (generic.c:29)
==2095== by 0x40358F: rejoin_after_expand (rejoin_after_expand.c:29)
==2095== by 0x402F97: words_expansions (words_expansions.c:52)
==2095== by 0x40275E: parsing (parsing.c:80)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095==
==2095== Invalid read of size 1
==2095== at 0x4038D1: count_word (ft_split_quotes.c:57)
==2095== by 0x403806: ft_split_quotes (ft_split_quotes.c:35)
==2095== by 0x402FC0: words_expansions (words_expansions.c:56)
==2095== by 0x40275E: parsing (parsing.c:80)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095== Address 0x56d265a is 0 bytes after a block of size 10 alloc'd
==2095== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2095== by 0x4048A8: ft_strjoin (ft_strjoin.c:23)
==2095== by 0x40115C: ft_strjoinfree_s1 (generic.c:29)
==2095== by 0x40358F: rejoin_after_expand (rejoin_after_expand.c:29)
==2095== by 0x402F97: words_expansions (words_expansions.c:52)
==2095== by 0x40275E: parsing (parsing.c:80)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095==
==2095== Invalid read of size 1
==2095== at 0x403C0F: fill_arr (ft_split_quotes.c:151)
==2095== by 0x403888: ft_split_quotes (ft_split_quotes.c:44)
==2095== by 0x402FC0: words_expansions (words_expansions.c:56)
==2095== by 0x40275E: parsing (parsing.c:80)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095== Address 0x56d265a is 0 bytes after a block of size 10 alloc'd
==2095== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2095== by 0x4048A8: ft_strjoin (ft_strjoin.c:23)
==2095== by 0x40115C: ft_strjoinfree_s1 (generic.c:29)
==2095== by 0x40358F: rejoin_after_expand (rejoin_after_expand.c:29)
==2095== by 0x402F97: words_expansions (words_expansions.c:52)
==2095== by 0x40275E: parsing (parsing.c:80)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095==
==2095== Invalid write of size 1
==2095== at 0x403D30: fill_arr (ft_split_quotes.c:158)
==2095== by 0x403888: ft_split_quotes (ft_split_quotes.c:44)
==2095== by 0x402FC0: words_expansions (words_expansions.c:56)
==2095== by 0x40275E: parsing (parsing.c:80)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095== Address 0x56d26fa is 0 bytes after a block of size 10 alloc'd
==2095== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2095== by 0x404760: ft_calloc (ft_calloc.c:19)
==2095== by 0x403B3C: alloc_words (ft_split_quotes.c:95)
==2095== by 0x403852: ft_split_quotes (ft_split_quotes.c:39)
==2095== by 0x402FC0: words_expansions (words_expansions.c:56)
==2095== by 0x40275E: parsing (parsing.c:80)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095==
==2095== Invalid read of size 1
==2095== at 0x403EE2: ft_strdup_quotes (ft_strdup_quotes.c:36)
==2095== by 0x40149A: ft_dup_2d_arr (generic.c:124)
==2095== by 0x402FFA: words_expansions (words_expansions.c:61)
==2095== by 0x40275E: parsing (parsing.c:80)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095== Address 0x56d26fa is 0 bytes after a block of size 10 alloc'd
==2095== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2095== by 0x404760: ft_calloc (ft_calloc.c:19)
==2095== by 0x403B3C: alloc_words (ft_split_quotes.c:95)
==2095== by 0x403852: ft_split_quotes (ft_split_quotes.c:39)
==2095== by 0x402FC0: words_expansions (words_expansions.c:56)
==2095== by 0x40275E: parsing (parsing.c:80)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095==
TOKENS LIST EXPANDED :
-----------
[6;34.6
lucky@Tour-Lemdows10:/mnt/c/Users/Lucky/Desktop/code/minishell> ^D==2095==
==2095== FILE DESCRIPTORS: 3 open at exit.
==2095== Open file descriptor 2: /dev/tty1
==2095== <inherited from parent>
==2095==
==2095== Open file descriptor 1: /dev/tty1
==2095== <inherited from parent>
==2095==
==2095== Open file descriptor 0: /dev/tty1
==2095== <inherited from parent>
==2095==
==2095==
==2095== HEAP SUMMARY:
==2095== in use at exit: 134,842 bytes in 208 blocks
==2095== total heap usage: 557 allocs, 349 frees, 165,633 bytes allocated
==2095==
==2095== 16 bytes in 1 blocks are still reachable in loss record 7 of 46
==2095== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2095== by 0x404760: ft_calloc (ft_calloc.c:19)
==2095== by 0x40284F: alloc_cmd_array (alloc_cmd_array.c:34)
==2095== by 0x4027AB: parsing (parsing.c:87)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095==
==2095== 32 bytes in 1 blocks are still reachable in loss record 10 of 46
==2095== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2095== by 0x404760: ft_calloc (ft_calloc.c:19)
==2095== by 0x4028A3: alloc_cmd_array (alloc_cmd_array.c:40)
==2095== by 0x4027AB: parsing (parsing.c:87)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095==
==2095== 224 bytes in 7 blocks are indirectly lost in loss record 19 of 46
==2095== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2095== by 0x404760: ft_calloc (ft_calloc.c:19)
==2095== by 0x4028A3: alloc_cmd_array (alloc_cmd_array.c:40)
==2095== by 0x4027AB: parsing (parsing.c:87)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095==
==2095== 336 (112 direct, 224 indirect) bytes in 7 blocks are definitely lost in loss record 21 of 46
==2095== at 0x4C31B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2095== by 0x404760: ft_calloc (ft_calloc.c:19)
==2095== by 0x40284F: alloc_cmd_array (alloc_cmd_array.c:34)
==2095== by 0x4027AB: parsing (parsing.c:87)
==2095== by 0x401A6E: shell_loop (shell_loop.c:40)
==2095== by 0x400DA0: main (main.c:25)
==2095==
==2095== LEAK SUMMARY:
==2095== definitely lost: 112 bytes in 7 blocks
==2095== indirectly lost: 224 bytes in 7 blocks
==2095== possibly lost: 0 bytes in 0 blocks
==2095== still reachable: 48 bytes in 2 blocks
==2095== suppressed: 134,458 bytes in 192 blocks
==2095==
==2095== For counts of detected and suppressed errors, rerun with: -v
==2095== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)
➜ minishell git:(master) ✗