build-android/enable_address_sanitizer.patch
author Thomas
Fri, 07 Jun 2019 07:41:36 +0200
branchsequoia_windows
changeset 3819 0c1bcfa6f9f3
parent 3742 37d915105396
permissions -rw-r--r--
Merge with sync
huss@3742
     1
diff --git a/build-android/jni/Android.mk b/build-android/jni/Android.mk
huss@3742
     2
--- a/build-android/jni/Android.mk
huss@3742
     3
+++ b/build-android/jni/Android.mk
huss@3742
     4
@@ -14,7 +14,9 @@
huss@3742
     5
 
huss@3742
     6
 LOCAL_MODULE    := pEpEngine
huss@3742
     7
 LOCAL_CFLAGS    += -std=c99
huss@3742
     8
-
huss@3742
     9
+#LOCAL_CFLAGS    += -fsanitize=address -fno-omit-frame-pointer
huss@3742
    10
+#LOCAL_LDFLAGS   += -fsanitize=address
huss@3742
    11
+#LOCAL_ARM_MODE := arm
huss@3742
    12
 # from http://www.sqlite.org/android/finfo?name=jni/sqlite/Android.mk 
huss@3742
    13
 #      http://www.sqlite.org/android/artifact/e8ed354b3e58c835
huss@3742
    14
 
huss@3742
    15
@@ -28,6 +30,7 @@
huss@3742
    16
                     $(GPGME_INCLUDE_PATH) \
huss@3742
    17
                     $(LIBETPAN_PATH)/include
huss@3742
    18
 LOCAL_C_INCLUDES += $(GPGBUILD)/$(TARGET_ARCH_ABI)/app_opt/include
huss@3742
    19
+LOCAL_C_INCLUDES += /home/huss/src/test/sequoia/openpgp-ffi/include
huss@3742
    20
 
huss@3742
    21
 $(shell sh $(LOCAL_PATH)/../takeOutHeaderFiles.sh $(LOCAL_PATH)../../)
huss@3742
    22
 LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)../include
huss@3742
    23
@@ -38,5 +41,6 @@
huss@3742
    24
 ASN1_SRC_FILES := $(wildcard $(LOCAL_PATH)/../../asn.1/*.c)
huss@3742
    25
 LOCAL_SRC_FILES := $(ENGINE_SRC_FILES:%=%)  $(ASN1_SRC_FILES:$(LOCAL_PATH)/%=%)
huss@3742
    26
 
huss@3742
    27
+#LOCAL_ADDRESS_SANITIZER:=true
huss@3742
    28
 
huss@3742
    29
 include $(BUILD_STATIC_LIBRARY)
huss@3742
    30
diff --git a/src/pEpEngine.c b/src/pEpEngine.c
huss@3742
    31
--- a/src/pEpEngine.c
huss@3742
    32
+++ b/src/pEpEngine.c
huss@3742
    33
@@ -2015,7 +2015,7 @@
huss@3742
    34
 // N.B. If testing (so NDEBUG not defined) but this message is spam,
huss@3742
    35
 //      put -D_PEP_SERVICE_LOG_OFF into CFLAGS/CXXFLAGS     
huss@3742
    36
 #if !defined(NDEBUG) && !defined(_PEP_SERVICE_LOG_OFF)
huss@3742
    37
-    fprintf(stdout, "\n*** %s %s %s %s\n", title, entity, description, comment);
huss@3742
    38
+    __android_log_print(ANDROID_LOG_DEBUG, "pEpEngine", " %s :: %s :: %s :: %s ", title, entity, description, comment);
huss@3742
    39
     session->service_log = true;
huss@3742
    40
 #endif
huss@3742
    41
 
huss@3742
    42
diff --git a/sync/gen_dot.ysl2 b/sync/gen_dot.ysl2
huss@3742
    43
--- a/sync/gen_dot.ysl2
huss@3742
    44
+++ b/sync/gen_dot.ysl2
huss@3742
    45
@@ -9,7 +9,7 @@
huss@3742
    46
     digraph finite_state_machine {
huss@3742
    47
         rankdir=LR;
huss@3742
    48
         node [shape = doublecircle];
huss@3742
    49
-        `apply "state[@end='1']" mode=end`;
huss@3742
    50
+        `apply "state[@timeout='off']" mode=end`;
huss@3742
    51
         node [shape = circle];
huss@3742
    52
 
huss@3742
    53
         `` apply "state" mode=do
huss@3742
    54
diff --git a/sync/sync.fsm b/sync/sync.fsm
huss@3742
    55
--- a/sync/sync.fsm
huss@3742
    56
+++ b/sync/sync.fsm
huss@3742
    57
@@ -155,7 +155,7 @@
huss@3742
    58
                 go HandshakingNewPhase2Second;
huss@3742
    59
         }
huss@3742
    60
 
huss@3742
    61
-        state HandshakingNewPhase1First {
huss@3742
    62
+        state HandshakingNewPhase1First timeout=300 {
huss@3742
    63
             on Rollback if sameTransactionAndPartner {
huss@3742
    64
                 do untrustThisKey;
huss@3742
    65
                 go Sole;
huss@3742
    66
@@ -172,7 +172,7 @@
huss@3742
    67
             }
huss@3742
    68
         }
huss@3742
    69
 
huss@3742
    70
-        state HandshakingNewPhase1Second {
huss@3742
    71
+        state HandshakingNewPhase1Second timeout=300 {
huss@3742
    72
             on Rollback if sameTransactionAndPartner {
huss@3742
    73
                 do untrustThisKey;
huss@3742
    74
                 go Sole;
huss@3742
    75
@@ -189,7 +189,7 @@
huss@3742
    76
             }
huss@3742
    77
         }
huss@3742
    78
 
huss@3742
    79
-        state HandshakingNewPhase2First {
huss@3742
    80
+        state HandshakingNewPhase2First timeout=300 {
huss@3742
    81
             on Cancel {
huss@3742
    82
                 send Rollback;
huss@3742
    83
                 go Sole;
huss@3742
    84
@@ -208,7 +208,7 @@
huss@3742
    85
             }
huss@3742
    86
         }
huss@3742
    87
 
huss@3742
    88
-        state HandshakingNewPhase2Second {
huss@3742
    89
+        state HandshakingNewPhase2Second timeout=300 {
huss@3742
    90
             on Cancel {
huss@3742
    91
                 send Rollback;
huss@3742
    92
                 go Sole;