-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crash echo + pipe #24
Comments
dans le meme genre : Crash sur cd | pwd ➜ 42sh_test_completion git:(master) ✗ cd | pwd |
➜ 42sh_test_completion git:(master) ✗ valgrind --leak-check=full ./42sh 3>test ➜ 42sh_test_completion git:(master) ✗ echo | echo ➜ 42sh_test_completion ==75121== |
➜ 42sh_test_completion git:(master) ✗ echo "test" | grep "test"
==74809== Invalid read of size 8
==74809== at 0x100010FF4: job_addprocess (job_addprocess.c:29)
==74809== by 0x10000A94D: exec_command (exec_command.c:59)
==74809== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74809== by 0x10000AD2E: exec_pipe (exec_pipe.c:40)
==74809== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74809== by 0x100019713: interactive_shell (main.c:75)
==74809== by 0x100019802: main (main.c:92)
==74809== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==74809==
==74809==
==74809== Process terminating with default action of signal 11 (SIGSEGV)
==74809== Access not within mapped region at address 0x0
==74809== at 0x100010FF4: job_addprocess (job_addprocess.c:29)
==74809== by 0x10000A94D: exec_command (exec_command.c:59)
==74809== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74809== by 0x10000AD2E: exec_pipe (exec_pipe.c:40)
==74809== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74809== by 0x100019713: interactive_shell (main.c:75)
==74809== by 0x100019802: main (main.c:92)
==74809== If you believe this happened as a result of a stack
==74809== overflow in your program's main thread (unlikely but
==74809== possible), you can try to increase the size of the
==74809== main thread stack using the --main-stacksize= flag.
==74809== The main thread stack size used in this run was 8388608.
==74809==
==74809== HEAP SUMMARY:
==74809== in use at exit: 139,383 bytes in 821 blocks
==74809== total heap usage: 1,943 allocs, 1,122 frees, 212,695 bytes allocated
==74809==
==74809== 34 (24 direct, 10 indirect) bytes in 1 blocks are definitely lost in loss record 57 of 129
==74809== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74809== by 0x100004494: ft_memalloc (ft_memalloc.c:20)
==74809== by 0x100004A88: ft_sstradd (ft_sstradd.c:26)
==74809== by 0x10000AA77: token_to_argv (exec_command.c:34)
==74809== by 0x10000A918: exec_command (exec_command.c:55)
==74809== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74809== by 0x10000ACCD: exec_pipe (exec_pipe.c:31)
==74809== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74809== by 0x100019713: interactive_shell (main.c:75)
==74809== by 0x100019802: main (main.c:92)
==74809==
==74809== 40 bytes in 1 blocks are definitely lost in loss record 58 of 129
==74809== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74809== by 0x100014883: token_init (token_init.c:19)
==74809== by 0x100013B85: lexer_lex (lexer_lex.c:51)
==74809== by 0x1000195CD: interactive_shell (main.c:62)
==74809== by 0x100019802: main (main.c:92)
==74809==
==74809== 40 bytes in 1 blocks are definitely lost in loss record 59 of 129
==74809== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74809== by 0x100014883: token_init (token_init.c:19)
==74809== by 0x100013B85: lexer_lex (lexer_lex.c:51)
==74809== by 0x100012F10: lexer_delim (lexer_delim.c:25)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100014224: lexer_word (lexer_word.c:25)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x1000132BE: lexer_dquote (lexer_dquote.c:31)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x1000133C4: lexer_dquote (lexer_dquote.c:50)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x1000133C4: lexer_dquote (lexer_dquote.c:50)
==74809==
==74809== 40 bytes in 1 blocks are definitely lost in loss record 60 of 129
==74809== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74809== by 0x100014883: token_init (token_init.c:19)
==74809== by 0x100013B85: lexer_lex (lexer_lex.c:51)
==74809== by 0x1000141BF: lexer_sep (lexer_sep.c:42)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100012DFA: lexer_default (lexer_default.c:22)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100012F10: lexer_delim (lexer_delim.c:25)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100014224: lexer_word (lexer_word.c:25)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x1000132BE: lexer_dquote (lexer_dquote.c:31)
==74809==
==74809== 41 bytes in 1 blocks are definitely lost in loss record 63 of 129
==74809== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74809== by 0x100004494: ft_memalloc (ft_memalloc.c:20)
==74809== by 0x1000010D4: btree_create_node (btree_create_node.c:31)
==74809== by 0x100019E51: ft_parse (ft_parse.c:38)
==74809== by 0x10001A856: parse_separator (parse_separator.c:25)
==74809== by 0x100019EE8: ft_parse (ft_parse.c:44)
==74809== by 0x1000196E0: interactive_shell (main.c:72)
==74809== by 0x100019802: main (main.c:92)
==74809==
==74809== 58 (48 direct, 10 indirect) bytes in 2 blocks are definitely lost in loss record 72 of 129
==74809== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74809== by 0x100003B2E: ft_lstnew (ft_lstnew.c:19)
==74809== by 0x100003D3C: push (push.c:17)
==74809== by 0x100013279: lexer_dquote (lexer_dquote.c:26)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100012DFA: lexer_default (lexer_default.c:22)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100012F10: lexer_delim (lexer_delim.c:25)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100014224: lexer_word (lexer_word.c:25)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100014290: lexer_word (lexer_word.c:34)
==74809==
==74809== 80 bytes in 2 blocks are definitely lost in loss record 84 of 129
==74809== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74809== by 0x100014883: token_init (token_init.c:19)
==74809== by 0x100013B85: lexer_lex (lexer_lex.c:51)
==74809== by 0x100012F10: lexer_delim (lexer_delim.c:25)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100014224: lexer_word (lexer_word.c:25)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100014290: lexer_word (lexer_word.c:34)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100014290: lexer_word (lexer_word.c:34)
==74809== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74809== by 0x100014290: lexer_word (lexer_word.c:34)
==74809==
==74809== LEAK SUMMARY:
==74809== definitely lost: 313 bytes in 9 blocks
==74809== indirectly lost: 20 bytes in 4 blocks
==74809== possibly lost: 0 bytes in 0 blocks
==74809== still reachable: 112,724 bytes in 617 blocks
==74809== suppressed: 26,326 bytes in 191 blocks
==74809== Reachable blocks (those to which a pointer was found) are not shown.
==74809== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==74809==
==74809== For counts of detected and suppressed errors, rerun with: -v
==74809== ERROR SUMMARY: 8 errors from 8 contexts (suppressed: 14 from 14)
[1] 74809 segmentation fault valgrind --leak-check=full ./42sh 3> test
The text was updated successfully, but these errors were encountered: