42shpimanmls / 42sh

Shell project at 42
3 stars 0 forks source link

echo `unsetenv $PATH` (invalid read) #297

Closed n0izn0iz closed 7 years ago

n0izn0iz commented 7 years ago
[nmeier@e1r9p16.42.fr ~/Projects/42sh]$ echo `unsetenv $PATH`
==76484== embedded gdbserver: reading from /var/folders/zz/zyxvpxvq6csfxvn_n0001bym000_zn/T//vgdb-pipe-from-vgdb-to-76484-by-nmeier-on-???
==76484== embedded gdbserver: writing to   /var/folders/zz/zyxvpxvq6csfxvn_n0001bym000_zn/T//vgdb-pipe-to-vgdb-from-76484-by-nmeier-on-???
==76484== embedded gdbserver: shared mem   /var/folders/zz/zyxvpxvq6csfxvn_n0001bym000_zn/T//vgdb-pipe-shared-mem-vgdb-76484-by-nmeier-on-???
==76484==
==76484== TO CONTROL THIS PROCESS USING vgdb (which you probably
==76484== don't want to do, unless you know exactly what you're doing,
==76484== or are doing some strange experiment):
==76484==   /Users/nmeier/.brew/Cellar/valgrind/3.12.0/lib/valgrind/../../bin/vgdb --pid=76484 ...command...
==76484==
==76484== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==76484==   /path/to/gdb ./42sh
==76484== and then give GDB the following command
==76484==   target remote | /Users/nmeier/.brew/Cellar/valgrind/3.12.0/lib/valgrind/../../bin/vgdb --pid=76484
==76484== --pid is optional if only one valgrind process is running
==76484==
Usage: unsetenv <key> …
==76475== Invalid read of size 1
==76475==    at 0x10000578D: split_subsitutions_run (command_substitution.c:80)
==76475==    by 0x100005CF4: split_subsitutions (command_substitution_2.c:63)
==76475==    by 0x100005D14: command_substition (command_substitution_2.c:71)
==76475==    by 0x100005E86: expand_cmd_word (expansion.c:17)
==76475==    by 0x100005DAB: expand_cmd_words (expansion.c:46)
==76475==    by 0x100005081: execute_simple_command (execute_pipeline.c:69)
==76475==    by 0x100005181: execute_pipeline (execute_pipeline.c:101)
==76475==    by 0x100004DF5: execute_and_or_list (execute_command_list.c:36)
==76475==    by 0x100004EF1: execute_command_list (execute_command_list.c:77)
==76475==    by 0x10000ADD7: main_loop (main.c:37)
==76475==    by 0x10000AC7E: main (main.c:56)
==76475==  Address 0x1 is not stack'd, malloc'd or (recently) free'd