gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-schemafuzz] branch master updated: First drop at par


From: gnunet
Subject: [GNUnet-SVN] [taler-schemafuzz] branch master updated: First drop at parsing the stack trace and writing the result as a proper file.
Date: Wed, 11 Jul 2018 19:00:30 +0200

This is an automated email from the git hooks/post-receive script.

erwan-ulrich pushed a commit to branch master
in repository schemafuzz.

The following commit(s) were added to refs/heads/master by this push:
     new 9af2620  First drop at parsing the stack trace and writing the result 
as a proper file.
9af2620 is described below

commit 9af26203dfafd2c488b3ef67d2b16a4e8dea5d3e
Author: Feideus <address@hidden>
AuthorDate: Wed Jul 11 19:00:24 2018 +0200

    First drop at parsing the stack trace and writing the result as a proper 
file.
---
 errorReports/core                                  | Bin 389120 -> 0 bytes
 errorReports/parsedStackTrace_test_c_crash         |  72 +++++++++++++++++++++
 errorReports/stackTrace_test_c_crash               |   3 -
 src/main/java/org/schemaspy/DBFuzzer.java          |   8 ++-
 .../org/schemaspy/cli/CommandLineArguments.java    |   9 +++
 stackTraceCParser.sh                               |  59 +++++++++++------
 test_c_crash.exe                                   | Bin 0 -> 9936 bytes
 7 files changed, 126 insertions(+), 25 deletions(-)

diff --git a/errorReports/core b/errorReports/core
deleted file mode 100644
index 936af1d..0000000
Binary files a/errorReports/core and /dev/null differ
diff --git a/errorReports/parsedStackTrace_test_c_crash 
b/errorReports/parsedStackTrace_test_c_crash
new file mode 100644
index 0000000..4ace6c1
--- /dev/null
+++ b/errorReports/parsedStackTrace_test_c_crash
@@ -0,0 +1,72 @@
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
+tmpfun2 tmpfun main
+test_c_crash.c test_c_crash.c
+21 16
diff --git a/errorReports/stackTrace_test_c_crash 
b/errorReports/stackTrace_test_c_crash
deleted file mode 100644
index 3b968d4..0000000
--- a/errorReports/stackTrace_test_c_crash
+++ /dev/null
@@ -1,3 +0,0 @@
-#0  0x000000000040056f in tmpfun2 () at test_c_crash.c:21
-#1  0x0000000000400563 in tmpfun () at test_c_crash.c:16
-#2  0x000000000040054e in main (argc=1, argv=0x7ffd2395ebc8) at 
test_c_crash.c:10
diff --git a/src/main/java/org/schemaspy/DBFuzzer.java 
b/src/main/java/org/schemaspy/DBFuzzer.java
index be192a5..cb1b085 100644
--- a/src/main/java/org/schemaspy/DBFuzzer.java
+++ b/src/main/java/org/schemaspy/DBFuzzer.java
@@ -182,13 +182,17 @@ public class DBFuzzer
             try
             {
                 // the evaluator sets a mark for representing how interesting 
the mutation was
-                Process evaluatorProcess = new ProcessBuilder("/bin/bash", 
"./aLittleBitLessDumbEvaluator.sh").start();
-                mark = 
Integer.parseInt(getEvaluatorResponse(evaluatorProcess));
+                    Process tmpProcess = new ProcessBuilder("/bin/bash", 
"./emulated_program.sh").start(); // this should go soon now.
+                    mark = Integer.parseInt(getEvaluatorResponse(tmpProcess));
                 currentMutation.setInterest_mark(mark);
                 currentMutation.setWeight(mark);
                 currentMutation.propagateWeight(); //update parents weight 
according to this node new weight
                 System.out.println("marking : "+mark);
                 System.out.println("Weight : "+currentMutation.getWeight());
+
+                LOGGER.info("Target is : 
"+analyzer.getCommandLineArguments().getTarget());
+                Process evaluatorProcess = new ProcessBuilder("/bin/bash", 
"./stackTraceCParser.sh",analyzer.getCommandLineArguments().getTarget()).start();
+                LOGGER.info(getEvaluatorResponse(evaluatorProcess));
             }
             catch(Exception e)
             {
diff --git a/src/main/java/org/schemaspy/cli/CommandLineArguments.java 
b/src/main/java/org/schemaspy/cli/CommandLineArguments.java
index 0cc3b69..87f36d6 100644
--- a/src/main/java/org/schemaspy/cli/CommandLineArguments.java
+++ b/src/main/java/org/schemaspy/cli/CommandLineArguments.java
@@ -123,6 +123,13 @@ public class CommandLineArguments {
     )
     private String maxDepth;
 
+    @Parameter(
+            names = {
+                    "-tg", "--target",
+            }
+    )
+    private String target;
+
     /* TODO Password handling is more complex, see Config class (prompt for 
password, fallback to Environment variable, multiple schemas, etc.)
     @Parameter(
             names = {
@@ -210,4 +217,6 @@ public class CommandLineArguments {
 
     public String getMaxDepth() { return maxDepth; }
 
+    public String getTarget() {return target; }
+
 }
diff --git a/stackTraceCParser.sh b/stackTraceCParser.sh
index 98d6700..069ab45 100644
--- a/stackTraceCParser.sh
+++ b/stackTraceCParser.sh
@@ -17,33 +17,52 @@ ulimit -c 9999
 echo "--------------------------"
 ./$1
 echo "--------------------------"
-mv ./core errorReports/
-
-res=`echo bt | gdb test_c_crash.exe errorReports/core | sed -e 's/(gdb) //' | 
grep \# | uniq > errorReports/stackTrace_$binaryWithoutExtention `
-RESULT=`cat errorReports/stackTrace_$binaryWithoutExtention | sed 's/.* in //' 
| cut -d "(" -f1`
-
-i=0
-echo $RESULT |
-while IFS= read -r line;
-do
-    array[i]=`echo $line`
-    i=i+1
-done
-
-echo "${array[0]}"
-echo "${array[1]}"
-echo "${array[2]}"
-#echo $res;
-#cat errorReports/stackTrace_$binaryWithoutExtention;
 
+checkCoreGen=`ls | grep $1`;
 
+if [[ -n "$checkCoreGen" ]]
+then
+    mv ./core errorReports/
+else
+    echo "no core dump generated. Abort";
+    exit 0;
+fi
 
+echo bt | gdb test_c_crash.exe errorReports/core | sed -e 's/(gdb) //' | grep 
\# | uniq > errorReports/stackTrace_$binaryWithoutExtention
+tmp=`cat errorReports/stackTrace_$binaryWithoutExtention | sed 's/.* in //' | 
cut -d "(" -f1`
 
+echo "function names : "$tmp
+functionNameArray=(${tmp// / })
 
+tmp2=`cat errorReports/stackTrace_$binaryWithoutExtention | sed 's/.* at //' | 
cut -d "(" -f1 | cut -d "#" -f1`
+fileNameArray=(${tmp2// / })
+lineNumberArray=(${tmp2// / })
 
+cpt=0
+for i in "address@hidden"
+do
+   loopVar=$i
+   fileNameArray[cpt]="${loopVar%:*}"
+   cpt=$cpt+1
+done
+echo "file names : " "address@hidden"
 
+cpt=0
+for i in "address@hidden"
+do
+   loopVar=$i
+   lineNumberArray[cpt]=`echo $loopVar | sed 's/.*://'`
+   cpt=$cpt+1
+done
+echo "line numbers : " "address@hidden"
 
+var=`shuf -i 1-10000 -n 1`;
+reportFileName=parsedStackTrace_$binaryWithoutExtention_$var
+touch $reportFileName
 
+echo "address@hidden" >> errorReports/$reportFileName
+echo "address@hidden" >> errorReports/$reportFileName
+echo "address@hidden" >> errorReports/$reportFileName
 
-#rm errorReports/core A LA FIN
-#rm stackTrace files depending on option ?
\ No newline at end of file
+rm errorReports/core
+rm errorReports/stackTrace_$binaryWithoutExtention
diff --git a/test_c_crash.exe b/test_c_crash.exe
new file mode 100755
index 0000000..095f867
Binary files /dev/null and b/test_c_crash.exe differ

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]