marimlem / minishell

0 stars 0 forks source link

open fds in heredoc #55

Closed marimlem closed 1 month ago

marimlem commented 2 months ago
minishell:$ << hd
> abc
> hd
==152769== 
==152769== FILE DESCRIPTORS: 3 open (3 std) at exit.
==152769== 
==152769== HEAP SUMMARY:
==152769==     in use at exit: 208,208 bytes in 226 blocks
==152769==   total heap usage: 820 allocs, 594 frees, 238,928 bytes allocated
==152769== 
==152769== LEAK SUMMARY:
==152769==    definitely lost: 0 bytes in 0 blocks
==152769==    indirectly lost: 0 bytes in 0 blocks
==152769==      possibly lost: 0 bytes in 0 blocks
==152769==    still reachable: 0 bytes in 0 blocks
==152769==         suppressed: 208,208 bytes in 226 blocks
==152769== 
==152769== For lists of detected and suppressed errors, rerun with: -s
==152769== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1 from 1)
minishell:$ << hd""
==152767== Warning: noted but unhandled ioctl 0x5412 with no size/direction hints.
==152767==    This could cause spurious value errors to appear.
==152767==    See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.

minishell:$ ^C
minishell:$ ^C
minishell:$ ^C
minishell:$ cat << h
> abc
> $USER
> h
abc
lknobloc
minishell:$ cat << h""
> abc $USER
> h
abc $USER
minishell:$ exit
exit minishell
==152767== 
==152767== FILE DESCRIPTORS: 5 open (3 std) at exit.
==152767== Open file descriptor 4: /dev/pts/2
==152767==    at 0x49D9FEB: dup (syscall-template.S:120)
==152767==    by 0x404C42: setup_fds (execute_utils.c:43)
==152767==    by 0x404A54: executor2 (execute2.c:133)
==152767==    by 0x4015E5: main (main.c:81)
==152767== 
==152767== Open file descriptor 3: /dev/pts/2
==152767==    at 0x49D9FEB: dup (syscall-template.S:120)
==152767==    by 0x404C2C: setup_fds (execute_utils.c:42)
==152767==    by 0x404A54: executor2 (execute2.c:133)
==152767==    by 0x4015E5: main (main.c:81)
==152767== 
==152767== 
==152767== HEAP SUMMARY:
==152767==     in use at exit: 208,388 bytes in 241 blocks
==152767==   total heap usage: 1,026 allocs, 785 frees, 242,535 bytes allocated
==152767== 
==152767== LEAK SUMMARY:
==152767==    definitely lost: 0 bytes in 0 blocks
==152767==    indirectly lost: 0 bytes in 0 blocks
==152767==      possibly lost: 0 bytes in 0 blocks
==152767==    still reachable: 0 bytes in 0 blocks
==152767==         suppressed: 208,388 bytes in 241 blocks
==152767== 
==152767== For lists of detected and suppressed errors, rerun with: -s
==152767== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 1 from 1)