JonasGoetz01 / 42-minishell

Built your very own shell, Minishell! Explore executing commands, managing history, and controlling inputs and outputs. Dive into handling processes and files while creating a user-friendly shell interface. Get hands-on with shell scripting in a fun and accessible way with Minishell (DONT PANIC SHELL)!
1 stars 1 forks source link

/bin/echo $"42$" segfault #168

Closed PaulicStudios closed 6 months ago

PaulicStudios commented 6 months ago
👤 user@267e80e9f783
/workspaces/42-minishell ❯ /bin/echo $"42$"
AddressSanitizer:DEADLYSIGNAL
=================================================================
==38664==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 (pc 0x5624dce85316 bp 0x000000000001 sp 0x7ffd31c9d550 T0)
==38664==The signal is caused by a READ memory access.
==38664==Hint: address points to the zero page.
    #0 0x5624dce85316 in ft_expand_tokens src/input_parsing/expander.c:69
    #1 0x5624dce83a63 in process_input src/prompt/prompt.c:19
    #2 0x5624dce83f16 in show_prompt src/prompt/prompt.c:133
    #3 0x5624dce819c5 in main src/main.c:51
    #4 0x7f2ee9e2cd8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    #5 0x7f2ee9e2ce3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    #6 0x5624dce816a4 in _start (/workspaces/42-minishell/minishell+0x46a4)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV src/input_parsing/expander.c:69 in ft_expand_tokens
==38664==ABORTING
PaulicStudios commented 6 months ago

same with

/workspaces/42-minishell ❯ /bin/echo "$ "
AddressSanitizer:DEADLYSIGNAL
=================================================================
==38862==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 (pc 0x55612ce0e316 bp 0x000000000001 sp 0x7ffcf7ab60d0 T0)
==38862==The signal is caused by a READ memory access.
==38862==Hint: address points to the zero page.
    #0 0x55612ce0e316 in ft_expand_tokens src/input_parsing/expander.c:69
    #1 0x55612ce0ca63 in process_input src/prompt/prompt.c:19
    #2 0x55612ce0cf16 in show_prompt src/prompt/prompt.c:133
    #3 0x55612ce0a9c5 in main src/main.c:51
    #4 0x7f256d118d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    #5 0x7f256d118e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    #6 0x55612ce0a6a4 in _start (/workspaces/42-minishell/minishell+0x46a4)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV src/input_parsing/expander.c:69 in ft_expand_tokens
==38862==ABORTING