iijung / minishell

간단한 bash 쉘 구현
0 stars 1 forks source link

서브쉘 사용 시 세그폴트 발생 #53

Closed iijung closed 1 year ago

iijung commented 1 year ago
minishell$ (a && b) > c
==4323== Use of uninitialised value of size 8
==4323==    at 0x405E80: split_by_subshell (parse.c:53)
==4323==    by 0x406096: subshell_parsing (parse.c:72)
==4323==    by 0x405F8A: parse (parse.c:90)
==4323==    by 0x4013C7: run (minishell.c:30)
==4323==    by 0x40136F: main (minishell.c:60)
==4323==
==4323== Use of uninitialised value of size 8
==4323==    at 0x405E8C: split_by_subshell (parse.c:54)
==4323==    by 0x406096: subshell_parsing (parse.c:72)
==4323==    by 0x405F8A: parse (parse.c:90)
==4323==    by 0x4013C7: run (minishell.c:30)
==4323==    by 0x40136F: main (minishell.c:60)
==4323==
==4323== Invalid read of size 8
==4323==    at 0x405EC6: split_by_subshell (parse.c:59)
==4323==    by 0x406096: subshell_parsing (parse.c:72)
==4323==    by 0x405F8A: parse (parse.c:90)
==4323==    by 0x4013C7: run (minishell.c:30)
==4323==    by 0x40136F: main (minishell.c:60)
==4323==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
==4323==
==4323==
==4323== Process terminating with default action of signal 11 (SIGSEGV)
==4323==  Access not within mapped region at address 0x8
==4323==    at 0x405EC6: split_by_subshell (parse.c:59)
==4323==    by 0x406096: subshell_parsing (parse.c:72)
==4323==    by 0x405F8A: parse (parse.c:90)
==4323==    by 0x4013C7: run (minishell.c:30)
==4323==    by 0x40136F: main (minishell.c:60)
==4323==  If you believe this happened as a result of a stack
==4323==  overflow in your program's main thread (unlikely but
==4323==  possible), you can try to increase the size of the
==4323==  main thread stack using the --main-stacksize= flag.
==4323==  The main thread stack size used in this run was 8388608.
==4323==
==4323== HEAP SUMMARY:
==4323==     in use at exit: 200,488 bytes in 360 blocks
==4323==   total heap usage: 1,093 allocs, 733 frees, 231,117 bytes allocated
==4323==
==4323== LEAK SUMMARY:
==4323==    definitely lost: 0 bytes in 0 blocks
==4323==    indirectly lost: 0 bytes in 0 blocks
==4323==      possibly lost: 0 bytes in 0 blocks
==4323==    still reachable: 200,488 bytes in 360 blocks
==4323==         suppressed: 0 bytes in 0 blocks
==4323== Reachable blocks (those to which a pointer was found) are not shown.
==4323== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==4323==
==4323== Use --track-origins=yes to see where uninitialised values come from
==4323== For lists of detected and suppressed errors, rerun with: -s
==4323== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
Segmentation fault