GithubHelp home page GithubHelp logo

crash echo + pipe about 42sh HOT 2 CLOSED

jzck avatar jzck commented on July 24, 2024
crash echo + pipe

from 42sh.

Comments (2)

Gwojda avatar Gwojda commented on July 24, 2024

dans le meme genre :

Crash sur cd | pwd

➜ 42sh_test_completion git:(master) ✗ cd | pwd
==74964== Invalid read of size 8
==74964== at 0x100010FF4: job_addprocess (job_addprocess.c:29)
==74964== by 0x10000A94D: exec_command (exec_command.c:59)
==74964== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74964== by 0x10000AD2E: exec_pipe (exec_pipe.c:40)
==74964== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74964== by 0x100019713: interactive_shell (main.c:75)
==74964== by 0x100019802: main (main.c:92)
==74964== Address 0x0 is not stack'd, malloc'd or (recently) free'd
==74964==
==74964==
==74964== Process terminating with default action of signal 11 (SIGSEGV)
==74964== Access not within mapped region at address 0x0
==74964== at 0x100010FF4: job_addprocess (job_addprocess.c:29)
==74964== by 0x10000A94D: exec_command (exec_command.c:59)
==74964== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74964== by 0x10000AD2E: exec_pipe (exec_pipe.c:40)
==74964== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74964== by 0x100019713: interactive_shell (main.c:75)
==74964== by 0x100019802: main (main.c:92)
==74964== If you believe this happened as a result of a stack
==74964== overflow in your program's main thread (unlikely but
==74964== possible), you can try to increase the size of the
==74964== main thread stack using the --main-stacksize= flag.
==74964== The main thread stack size used in this run was 8388608.
==74964==
==74964== HEAP SUMMARY:
==74964== in use at exit: 139,146 bytes in 810 blocks
==74964== total heap usage: 1,774 allocs, 964 frees, 206,170 bytes allocated
==74964==
/Users/gwojda
==74964== 19 (16 direct, 3 indirect) bytes in 1 blocks are definitely lost in loss record 23 of 123
==74964== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74964== by 0x100004494: ft_memalloc (ft_memalloc.c:20)
==74964== by 0x100004A88: ft_sstradd (ft_sstradd.c:26)
==74964== by 0x10000AA77: token_to_argv (exec_command.c:34)
==74964== by 0x10000A918: exec_command (exec_command.c:55)
==74964== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74964== by 0x10000ACCD: exec_pipe (exec_pipe.c:31)
==74964== by 0x10000AF78: ft_exec (ft_exec.c:39)
==74964== by 0x100019713: interactive_shell (main.c:75)
==74964== by 0x100019802: main (main.c:92)
==74964==
==74964== 40 bytes in 1 blocks are definitely lost in loss record 53 of 123
==74964== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74964== by 0x100014883: token_init (token_init.c:19)
==74964== by 0x100013B85: lexer_lex (lexer_lex.c:51)
==74964== by 0x1000195CD: interactive_shell (main.c:62)
==74964== by 0x100019802: main (main.c:92)
==74964==
==74964== 40 bytes in 1 blocks are definitely lost in loss record 54 of 123
==74964== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74964== by 0x100014883: token_init (token_init.c:19)
==74964== by 0x100013B85: lexer_lex (lexer_lex.c:51)
==74964== by 0x100012F10: lexer_delim (lexer_delim.c:25)
==74964== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74964== by 0x100014224: lexer_word (lexer_word.c:25)
==74964== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74964== by 0x100014290: lexer_word (lexer_word.c:34)
==74964== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74964== by 0x100014290: lexer_word (lexer_word.c:34)
==74964== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74964== by 0x100012E76: lexer_default (lexer_default.c:28)
==74964==
==74964== 40 bytes in 1 blocks are definitely lost in loss record 55 of 123
==74964== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74964== by 0x100014883: token_init (token_init.c:19)
==74964== by 0x100013B85: lexer_lex (lexer_lex.c:51)
==74964== by 0x1000141BF: lexer_sep (lexer_sep.c:42)
==74964== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74964== by 0x100012DFA: lexer_default (lexer_default.c:22)
==74964== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74964== by 0x100012F10: lexer_delim (lexer_delim.c:25)
==74964== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74964== by 0x100014224: lexer_word (lexer_word.c:25)
==74964== by 0x100013BC1: lexer_lex (lexer_lex.c:54)
==74964== by 0x100014290: lexer_word (lexer_word.c:34)
==74964==
==74964== 41 bytes in 1 blocks are definitely lost in loss record 58 of 123
==74964== at 0x10003F671: malloc (in /Users/gwojda/.brew/Cellar/valgrind/3.12.0/lib/valgrind/vgpreload_memcheck-amd64-darwin.so)
==74964== by 0x100004494: ft_memalloc (ft_memalloc.c:20)
==74964== by 0x1000010D4: btree_create_node (btree_create_node.c:31)
==74964== by 0x100019E51: ft_parse (ft_parse.c:38)
==74964== by 0x10001A856: parse_separator (parse_separator.c:25)
==74964== by 0x100019EE8: ft_parse (ft_parse.c:44)
==74964== by 0x1000196E0: interactive_shell (main.c:72)
==74964== by 0x100019802: main (main.c:92)
==74964==
==74964== LEAK SUMMARY:
==74964== definitely lost: 177 bytes in 5 blocks
==74964== indirectly lost: 3 bytes in 1 blocks
==74964== possibly lost: 0 bytes in 0 blocks
==74964== still reachable: 112,640 bytes in 613 blocks
==74964== suppressed: 26,326 bytes in 191 blocks
==74964== Reachable blocks (those to which a pointer was found) are not shown.
==74964== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==74964==
==74964== For counts of detected and suppressed errors, rerun with: -v
==74964== ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 14 from 14)
[1] 74964 segmentation fault valgrind --leak-check=full ./42sh 3> test

from 42sh.

Gwojda avatar Gwojda commented on July 24, 2024

➜ 42sh_test_completion git:(master) ✗ valgrind --leak-check=full ./42sh 3>test
==75121== Memcheck, a memory error detector
==75121== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==75121== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==75121== Command: ./42sh
==75121==
--75121-- UNKNOWN fcntl 67!
--75121-- UNKNOWN fcntl 67! (repeated 2 times)
➜ 42sh_test_completion git:(master) ✗ echo | echo

➜ 42sh_test_completion git:(master) ✗ echo | echo

➜ 42sh_test_completion ==75121==
==75121== Process terminating with default action of signal 13 (SIGPIPE)
==75121== at 0x100005913: ft_strnew (ft_strnew.c:25)
==75121== by 0x100005588: ft_strjoin (ft_strjoin.c:19)
==75121== by 0x1000036B0: ft_loop_read (get_next_line.c:46)
==75121== by 0x10000357C: get_next_line (get_next_line.c:78)
==75121== by 0x1000153DB: ft_git_status (ft_prompt.c:31)
==75121== by 0x100015166: ft_prompt (ft_prompt.c:104)
==75121== by 0x100018B5F: readline_init (readline.c:95)
==75121== by 0x100018B84: readline (readline.c:102)
==75121== by 0x1000194EF: interactive_shell (main.c:56)
==75121== by 0x100019802: main (main.c:92)
==75121==
==75121== HEAP SUMMARY:
==75121== in use at exit: 139,487 bytes in 820 blocks
==75121== total heap usage: 2,100 allocs, 1,280 frees, 210,727 bytes allocated

from 42sh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.