Closed JaeSeoKim closed 3 years ago
minishell>cat readme.md | ./minishell; leaks minishell
Inappropriate ioctl for deviceProcess: minishell [83429]
Path: /Volumes/VOLUME/*/minishell
Load Address: 0x10bef0000
Identifier: minishell
Version: ???
Code Type: X86-64
Parent Process: zsh [78112]
Date/Time: 2021-05-21 13:00:46.233 +0900
Launch Time: 2021-05-21 13:00:37.021 +0900
OS Version: Mac OS X 10.15.7 (19H1030)
Report Version: 7
Analysis Tool: /Applications/Xcode.app/Contents/Developer/usr/bin/leaks
Analysis Tool Version: Xcode 12.3 (12C33)
Physical footprint: 352K
Physical footprint (peak): 352K
----
leaks Report Version: 4.0
Process 83429: 251 nodes malloced for 18 KB
Process 83429: 0 leaks for 0 total leaked bytes.
해결
Expected Behavior
와 같은 명령어를 실행 할 경우
Inappropriate ioctl for device
가 출력이 되고 leaks에서 leaks가 발생하지 않아야 함.Current Behavior
위 명령어 기준으로 아래와 같이 leaks이 발생함
Possible Solution
파일과 같이
ft_pipe_connect
함수 호출 후 status가 0 보다 작은 경우ft_pipe_close
도 동일하게 호출하고 반환하도록 수정 해야 함.Steps to Reproduce
cat readme.md | ./minishell; leaks minishell
명령어 실행