Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- echo "-- Testing your implementation of OpenShell --"
- echo ""
- echo "- If you have any problem in passing a test read the corresponding"
- echo "- source file to understand what the test is checking"
- echo ""
- echo -n "********************* PRESS ENTER TO RUN TESTS ... "
- read answ
- echo ls |./shell
- echo ls -h -a -l|sort| ./shell
- $ ./RUN_TESTS
- -- Testing your implementation of OpenShell --
- - If you have any problem in passing a test read the corresponding
- - source file to understand what the test is checking
- ********************* PRESS ENTER TO RUN TESTS ...
- Current working dir: /home/dac/ClionProjects/shell2/openshell
- 'PATH' is set to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin.
- p[0][0] ls
- CMakeLists.txt compile errors.c foo.txt LICENSE main.o openshell-0.16430.tar.gz README.md sh username.txt VERSION
- CommandEntry.h do.h errors.h git.version main.c Makefile openshell.h RUN_TESTS shell util.c
- Segmentation fault (core dumped)
- Current working dir: /home/dac/ClionProjects/shell2/openshell
- 'PATH' is set to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin.
- p[0][0] ls
- p[0][1] -h
- p[0][2] -a
- p[0][3] -l
- total 304K
- drwxrwxr-x 5 dac dac 4,0K maj 1 13:21 .
- drwxrwxr-x 6 dac dac 4,0K maj 1 11:43 ..
- -rw-rw-r-- 1 dac dac 465 apr 30 04:58 CMakeLists.txt
- -rw-rw-r-- 1 dac dac 339 apr 30 05:21 CommandEntry.h
- drwxrwxr-x 2 dac dac 4,0K apr 30 03:23 compile
- -rw-rw-r-- 1 dac dac 362 apr 30 05:21 do.h
- -rw-rw-r-- 1 dac dac 857 apr 30 05:59 errors.c
- -rw-rw-r-- 1 dac dac 317 apr 27 03:42 errors.h
- -rw-rw-r-- 1 dac dac 0 apr 27 07:44 foo.txt
- drwxrwxr-x 8 dac dac 4,0K maj 1 13:26 .git
- -rw-rw-r-- 1 dac dac 244 apr 21 09:09 .gitignore
- -rw-rw-r-- 1 dac dac 14 apr 23 19:15 git.version
- drwxrwxr-x 2 dac dac 4,0K maj 1 13:33 .idea
- -rw-rw-r-- 1 dac dac 1,3K apr 21 09:09 LICENSE
- -rw-rw-r-- 1 dac dac 20K maj 1 13:20 main.c
- -rw-rw-r-- 1 dac dac 92K maj 1 13:21 main.o
- -rw-rw-r-- 1 dac dac 661 apr 30 02:41 Makefile
- -rw-rw-r-- 1 dac dac 13K apr 30 11:37 openshell-0.16430.tar.gz
- -rw-rw-r-- 1 dac dac 1,5K maj 1 13:21 openshell.h
- -rw-rw-r-- 1 dac dac 1,2K maj 1 12:04 README.md
- -rwxrwxr-x 1 dac dac 337 maj 1 13:00 RUN_TESTS
- -rw-rw-r-- 1 dac dac 206 maj 1 12:39 sh
- -rwxrwxr-x 1 dac dac 65K maj 1 13:21 shell
- -rw-rw-r-- 1 dac dac 1,4K maj 1 13:21 username.txt
- -rw-rw-r-- 1 dac dac 27K maj 1 06:10 util.c
- -rw-rw-r-- 1 dac dac 29 maj 1 13:21 VERSION
- Segmentation fault (core dumped)
- $ valgrind -v --leak-check=full echo ls |./shell
- Current working dir: /home/dac/ClionProjects/shell2/openshell
- 'PATH' is set to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin.
- ==8201== Memcheck, a memory error detector
- ==8201== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
- ==8201== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
- ==8201== Command: echo ls
- ==8201==
- --8201-- Valgrind options:
- --8201-- -v
- --8201-- --leak-check=full
- --8201-- Contents of /proc/version:
- --8201-- Linux version 4.4.0-21-generic (buildd@lgw01-21) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2) ) #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016
- --8201--
- --8201-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
- --8201-- Page sizes: currently 4096, max supported 4096
- --8201-- Valgrind library directory: /usr/lib/valgrind
- --8201-- Reading syms from /bin/echo
- --8201-- object doesn't have a symbol table
- --8201-- Reading syms from /lib/x86_64-linux-gnu/ld-2.23.so
- --8201-- Considering /lib/x86_64-linux-gnu/ld-2.23.so ..
- --8201-- .. CRC mismatch (computed d3da0723 wanted a1c29704)
- --8201-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.23.so ..
- --8201-- .. CRC is valid
- --8201-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
- --8201-- Considering /usr/lib/valgrind/memcheck-amd64-linux ..
- --8201-- .. CRC mismatch (computed 2535049d wanted 2b024814)
- --8201-- object doesn't have a symbol table
- --8201-- object doesn't have a dynamic symbol table
- --8201-- Scheduler: using generic scheduler lock implementation.
- --8201-- Reading suppressions file: /usr/lib/valgrind/default.supp
- ==8201== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-8201-by-dac-on-???
- ==8201== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-8201-by-dac-on-???
- ==8201== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-8201-by-dac-on-???
- ==8201==
- ==8201== TO CONTROL THIS PROCESS USING vgdb (which you probably
- ==8201== don't want to do, unless you know exactly what you're doing,
- ==8201== or are doing some strange experiment):
- ==8201== /usr/lib/valgrind/../../bin/vgdb --pid=8201 ...command...
- ==8201==
- ==8201== TO DEBUG THIS PROCESS USING GDB: start GDB like this
- ==8201== /path/to/gdb echo
- ==8201== and then give GDB the following command
- ==8201== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=8201
- ==8201== --pid is optional if only one valgrind process is running
- ==8201==
- --8201-- REDIR: 0x401cdc0 (ld-linux-x86-64.so.2:strlen) redirected to 0x3809e181 (???)
- --8201-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
- --8201-- Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
- --8201-- .. CRC mismatch (computed d0558d51 wanted ab599393)
- --8201-- object doesn't have a symbol table
- --8201-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
- --8201-- Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
- --8201-- .. CRC mismatch (computed f5fca1b4 wanted 7dda00ad)
- --8201-- object doesn't have a symbol table
- ==8201== WARNING: new redirection conflicts with existing -- ignoring it
- --8201-- old: 0x0401cdc0 (strlen ) R-> (0000.0) 0x3809e181 ???
- --8201-- new: 0x0401cdc0 (strlen ) R-> (2007.0) 0x04c31020 strlen
- --8201-- REDIR: 0x401b710 (ld-linux-x86-64.so.2:index) redirected to 0x4c30bc0 (index)
- --8201-- REDIR: 0x401b930 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c320d0 (strcmp)
- --8201-- REDIR: 0x401db20 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c35270 (mempcpy)
- --8201-- Reading syms from /lib/x86_64-linux-gnu/libc-2.23.so
- --8201-- Considering /lib/x86_64-linux-gnu/libc-2.23.so ..
- --8201-- .. CRC mismatch (computed 2adb2e50 wanted 9b73f606)
- --8201-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.23.so ..
- --8201-- .. CRC is valid
- --8201-- REDIR: 0x4ec8fd0 (libc.so.6:strcasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
- --8201-- REDIR: 0x4ec4850 (libc.so.6:strcspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
- --8201-- REDIR: 0x4ecb2c0 (libc.so.6:strncasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
- --8201-- REDIR: 0x4ec6cc0 (libc.so.6:strpbrk) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
- --8201-- REDIR: 0x4ec7050 (libc.so.6:strspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
- --8201-- REDIR: 0x4ec871b (libc.so.6:memcpy@GLIBC_2.2.5) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
- --8201-- REDIR: 0x4ec69d0 (libc.so.6:rindex) redirected to 0x4c308a0 (rindex)
- --8201-- REDIR: 0x4ec4cf0 (libc.so.6:strlen) redirected to 0x4c30f60 (strlen)
- --8201-- REDIR: 0x4ec32e0 (libc.so.6:__GI_strcmp) redirected to 0x4c31fe0 (__GI_strcmp)
- --8201-- REDIR: 0x4ec5140 (libc.so.6:__GI_strncmp) redirected to 0x4c31710 (__GI_strncmp)
- --8201-- REDIR: 0x4ec3080 (libc.so.6:__GI_strchr) redirected to 0x4c30a00 (__GI_strchr)
- --8201-- REDIR: 0x4ec7e30 (libc.so.6:memchr) redirected to 0x4c32170 (memchr)
- --8201-- REDIR: 0x4ecfd30 (libc.so.6:strchrnul) redirected to 0x4c34da0 (strchrnul)
- --8201-- REDIR: 0x4ebd550 (libc.so.6:malloc) redirected to 0x4c2db20 (malloc)
- --8201-- REDIR: 0x4ec8980 (libc.so.6:__GI_mempcpy) redirected to 0x4c34fa0 (__GI_mempcpy)
- --8201-- REDIR: 0x4ecda40 (libc.so.6:__GI_memcpy) redirected to 0x4c32b00 (__GI_memcpy)
- --8201-- REDIR: 0x4ebda70 (libc.so.6:free) redirected to 0x4c2ed80 (free)
- --8201-- REDIR: 0x4ec8e60 (libc.so.6:__GI_stpcpy) redirected to 0x4c33f80 (__GI_stpcpy)
- --8201-- REDIR: 0x4ec32a0 (libc.so.6:strcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
- --8201-- REDIR: 0x4ed8b40 (libc.so.6:__strcmp_sse2_unaligned) redirected to 0x4c31f90 (strcmp)
- p[0][0] ls
- CMakeLists.txt compile errors.c foo.txt LICENSE main.o openshell-0.16430.tar.gz README.md sh username.txt VERSION
- CommandEntry.h do.h errors.h git.version main.c Makefile openshell.h RUN_TESTS shell util.c
- ==8201==
- ==8201== HEAP SUMMARY:
- ==8201== in use at exit: 0 bytes in 0 blocks
- ==8201== total heap usage: 46 allocs, 46 frees, 11,527 bytes allocated
- ==8201==
- ==8201== All heap blocks were freed -- no leaks are possible
- ==8201==
- ==8201== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
- ==8201== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
- Segmentation fault (core dumped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement