Advertisement
Guest User

Untitled

a guest
May 1st, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.75 KB | None | 0 0
  1. #!/bin/sh
  2. echo "-- Testing your implementation of OpenShell --"
  3. echo ""
  4. echo "- If you have any problem in passing a test read the corresponding"
  5. echo "- source file to understand what the test is checking"
  6. echo ""
  7. echo -n "********************* PRESS ENTER TO RUN TESTS ... "
  8. read answ
  9. echo ls |./shell
  10. echo ls -h -a -l|sort| ./shell
  11.  
  12. $ ./RUN_TESTS
  13. -- Testing your implementation of OpenShell --
  14.  
  15. - If you have any problem in passing a test read the corresponding
  16. - source file to understand what the test is checking
  17.  
  18. ********************* PRESS ENTER TO RUN TESTS ...
  19. Current working dir: /home/dac/ClionProjects/shell2/openshell
  20. 'PATH' is set to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin.
  21.  
  22. p[0][0] ls
  23.  
  24. CMakeLists.txt compile errors.c foo.txt LICENSE main.o openshell-0.16430.tar.gz README.md sh username.txt VERSION
  25. CommandEntry.h do.h errors.h git.version main.c Makefile openshell.h RUN_TESTS shell util.c
  26. Segmentation fault (core dumped)
  27. Current working dir: /home/dac/ClionProjects/shell2/openshell
  28. 'PATH' is set to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin.
  29.  
  30. p[0][0] ls
  31. p[0][1] -h
  32. p[0][2] -a
  33. p[0][3] -l
  34.  
  35. total 304K
  36. drwxrwxr-x 5 dac dac 4,0K maj 1 13:21 .
  37. drwxrwxr-x 6 dac dac 4,0K maj 1 11:43 ..
  38. -rw-rw-r-- 1 dac dac 465 apr 30 04:58 CMakeLists.txt
  39. -rw-rw-r-- 1 dac dac 339 apr 30 05:21 CommandEntry.h
  40. drwxrwxr-x 2 dac dac 4,0K apr 30 03:23 compile
  41. -rw-rw-r-- 1 dac dac 362 apr 30 05:21 do.h
  42. -rw-rw-r-- 1 dac dac 857 apr 30 05:59 errors.c
  43. -rw-rw-r-- 1 dac dac 317 apr 27 03:42 errors.h
  44. -rw-rw-r-- 1 dac dac 0 apr 27 07:44 foo.txt
  45. drwxrwxr-x 8 dac dac 4,0K maj 1 13:26 .git
  46. -rw-rw-r-- 1 dac dac 244 apr 21 09:09 .gitignore
  47. -rw-rw-r-- 1 dac dac 14 apr 23 19:15 git.version
  48. drwxrwxr-x 2 dac dac 4,0K maj 1 13:33 .idea
  49. -rw-rw-r-- 1 dac dac 1,3K apr 21 09:09 LICENSE
  50. -rw-rw-r-- 1 dac dac 20K maj 1 13:20 main.c
  51. -rw-rw-r-- 1 dac dac 92K maj 1 13:21 main.o
  52. -rw-rw-r-- 1 dac dac 661 apr 30 02:41 Makefile
  53. -rw-rw-r-- 1 dac dac 13K apr 30 11:37 openshell-0.16430.tar.gz
  54. -rw-rw-r-- 1 dac dac 1,5K maj 1 13:21 openshell.h
  55. -rw-rw-r-- 1 dac dac 1,2K maj 1 12:04 README.md
  56. -rwxrwxr-x 1 dac dac 337 maj 1 13:00 RUN_TESTS
  57. -rw-rw-r-- 1 dac dac 206 maj 1 12:39 sh
  58. -rwxrwxr-x 1 dac dac 65K maj 1 13:21 shell
  59. -rw-rw-r-- 1 dac dac 1,4K maj 1 13:21 username.txt
  60. -rw-rw-r-- 1 dac dac 27K maj 1 06:10 util.c
  61. -rw-rw-r-- 1 dac dac 29 maj 1 13:21 VERSION
  62. Segmentation fault (core dumped)
  63.  
  64. $ valgrind -v --leak-check=full echo ls |./shell
  65. Current working dir: /home/dac/ClionProjects/shell2/openshell
  66. 'PATH' is set to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin.
  67. ==8201== Memcheck, a memory error detector
  68. ==8201== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
  69. ==8201== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
  70. ==8201== Command: echo ls
  71. ==8201==
  72. --8201-- Valgrind options:
  73. --8201-- -v
  74. --8201-- --leak-check=full
  75. --8201-- Contents of /proc/version:
  76. --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
  77. --8201--
  78. --8201-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
  79. --8201-- Page sizes: currently 4096, max supported 4096
  80. --8201-- Valgrind library directory: /usr/lib/valgrind
  81. --8201-- Reading syms from /bin/echo
  82. --8201-- object doesn't have a symbol table
  83. --8201-- Reading syms from /lib/x86_64-linux-gnu/ld-2.23.so
  84. --8201-- Considering /lib/x86_64-linux-gnu/ld-2.23.so ..
  85. --8201-- .. CRC mismatch (computed d3da0723 wanted a1c29704)
  86. --8201-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.23.so ..
  87. --8201-- .. CRC is valid
  88. --8201-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
  89. --8201-- Considering /usr/lib/valgrind/memcheck-amd64-linux ..
  90. --8201-- .. CRC mismatch (computed 2535049d wanted 2b024814)
  91. --8201-- object doesn't have a symbol table
  92. --8201-- object doesn't have a dynamic symbol table
  93. --8201-- Scheduler: using generic scheduler lock implementation.
  94. --8201-- Reading suppressions file: /usr/lib/valgrind/default.supp
  95. ==8201== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-8201-by-dac-on-???
  96. ==8201== embedded gdbserver: writing to /tmp/vgdb-pipe-to-vgdb-from-8201-by-dac-on-???
  97. ==8201== embedded gdbserver: shared mem /tmp/vgdb-pipe-shared-mem-vgdb-8201-by-dac-on-???
  98. ==8201==
  99. ==8201== TO CONTROL THIS PROCESS USING vgdb (which you probably
  100. ==8201== don't want to do, unless you know exactly what you're doing,
  101. ==8201== or are doing some strange experiment):
  102. ==8201== /usr/lib/valgrind/../../bin/vgdb --pid=8201 ...command...
  103. ==8201==
  104. ==8201== TO DEBUG THIS PROCESS USING GDB: start GDB like this
  105. ==8201== /path/to/gdb echo
  106. ==8201== and then give GDB the following command
  107. ==8201== target remote | /usr/lib/valgrind/../../bin/vgdb --pid=8201
  108. ==8201== --pid is optional if only one valgrind process is running
  109. ==8201==
  110. --8201-- REDIR: 0x401cdc0 (ld-linux-x86-64.so.2:strlen) redirected to 0x3809e181 (???)
  111. --8201-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
  112. --8201-- Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
  113. --8201-- .. CRC mismatch (computed d0558d51 wanted ab599393)
  114. --8201-- object doesn't have a symbol table
  115. --8201-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
  116. --8201-- Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
  117. --8201-- .. CRC mismatch (computed f5fca1b4 wanted 7dda00ad)
  118. --8201-- object doesn't have a symbol table
  119. ==8201== WARNING: new redirection conflicts with existing -- ignoring it
  120. --8201-- old: 0x0401cdc0 (strlen ) R-> (0000.0) 0x3809e181 ???
  121. --8201-- new: 0x0401cdc0 (strlen ) R-> (2007.0) 0x04c31020 strlen
  122. --8201-- REDIR: 0x401b710 (ld-linux-x86-64.so.2:index) redirected to 0x4c30bc0 (index)
  123. --8201-- REDIR: 0x401b930 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c320d0 (strcmp)
  124. --8201-- REDIR: 0x401db20 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c35270 (mempcpy)
  125. --8201-- Reading syms from /lib/x86_64-linux-gnu/libc-2.23.so
  126. --8201-- Considering /lib/x86_64-linux-gnu/libc-2.23.so ..
  127. --8201-- .. CRC mismatch (computed 2adb2e50 wanted 9b73f606)
  128. --8201-- Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.23.so ..
  129. --8201-- .. CRC is valid
  130. --8201-- REDIR: 0x4ec8fd0 (libc.so.6:strcasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
  131. --8201-- REDIR: 0x4ec4850 (libc.so.6:strcspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
  132. --8201-- REDIR: 0x4ecb2c0 (libc.so.6:strncasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
  133. --8201-- REDIR: 0x4ec6cc0 (libc.so.6:strpbrk) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
  134. --8201-- REDIR: 0x4ec7050 (libc.so.6:strspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
  135. --8201-- REDIR: 0x4ec871b (libc.so.6:memcpy@GLIBC_2.2.5) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
  136. --8201-- REDIR: 0x4ec69d0 (libc.so.6:rindex) redirected to 0x4c308a0 (rindex)
  137. --8201-- REDIR: 0x4ec4cf0 (libc.so.6:strlen) redirected to 0x4c30f60 (strlen)
  138. --8201-- REDIR: 0x4ec32e0 (libc.so.6:__GI_strcmp) redirected to 0x4c31fe0 (__GI_strcmp)
  139. --8201-- REDIR: 0x4ec5140 (libc.so.6:__GI_strncmp) redirected to 0x4c31710 (__GI_strncmp)
  140. --8201-- REDIR: 0x4ec3080 (libc.so.6:__GI_strchr) redirected to 0x4c30a00 (__GI_strchr)
  141. --8201-- REDIR: 0x4ec7e30 (libc.so.6:memchr) redirected to 0x4c32170 (memchr)
  142. --8201-- REDIR: 0x4ecfd30 (libc.so.6:strchrnul) redirected to 0x4c34da0 (strchrnul)
  143. --8201-- REDIR: 0x4ebd550 (libc.so.6:malloc) redirected to 0x4c2db20 (malloc)
  144. --8201-- REDIR: 0x4ec8980 (libc.so.6:__GI_mempcpy) redirected to 0x4c34fa0 (__GI_mempcpy)
  145. --8201-- REDIR: 0x4ecda40 (libc.so.6:__GI_memcpy) redirected to 0x4c32b00 (__GI_memcpy)
  146. --8201-- REDIR: 0x4ebda70 (libc.so.6:free) redirected to 0x4c2ed80 (free)
  147. --8201-- REDIR: 0x4ec8e60 (libc.so.6:__GI_stpcpy) redirected to 0x4c33f80 (__GI_stpcpy)
  148. --8201-- REDIR: 0x4ec32a0 (libc.so.6:strcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
  149. --8201-- REDIR: 0x4ed8b40 (libc.so.6:__strcmp_sse2_unaligned) redirected to 0x4c31f90 (strcmp)
  150.  
  151. p[0][0] ls
  152.  
  153. CMakeLists.txt compile errors.c foo.txt LICENSE main.o openshell-0.16430.tar.gz README.md sh username.txt VERSION
  154. CommandEntry.h do.h errors.h git.version main.c Makefile openshell.h RUN_TESTS shell util.c
  155. ==8201==
  156. ==8201== HEAP SUMMARY:
  157. ==8201== in use at exit: 0 bytes in 0 blocks
  158. ==8201== total heap usage: 46 allocs, 46 frees, 11,527 bytes allocated
  159. ==8201==
  160. ==8201== All heap blocks were freed -- no leaks are possible
  161. ==8201==
  162. ==8201== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
  163. ==8201== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
  164. Segmentation fault (core dumped)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement