changeset 260:156cf548c764

adding more debug code
author Carl Byington <carl@five-ten-sg.com>
date Sun, 17 Apr 2011 14:07:25 -0700
parents 78e95fab9a8b
children 41862bddcf63
files regression/regression-tests.bash src/debug.c src/libpst.c
diffstat 3 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/regression/regression-tests.bash	Sat Apr 16 10:31:32 2011 -0700
+++ b/regression/regression-tests.bash	Sun Apr 17 14:07:25 2011 -0700
@@ -65,8 +65,7 @@
             #$val ../src/readpst $jobs -te -r -D -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
 
             ## normal recursive dump
-            $val ../src/readpst  -j 10 -Sb -o output$n            $fn >$ba.err 2>&1
-            #$val ../src/readpst $jobs     -r    -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
+            $val ../src/readpst -j 0 -r -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
 
             ## separate mode with filename extensions
             #$val ../src/readpst $jobs     -r -e -D -cv -o output$n -d $ba.log $fn >$ba.err 2>&1
@@ -127,7 +126,8 @@
 #$func  23 rendgen5.pst          # appointment test cases
 #$func  24 paul.sheer.pst        # embedded rfc822 attachment
 #$func  25 jerry.pst             # non ascii subject lines
-$func  26 phill.bertolus.pst    #
+#$func  26 phill.bertolus.pst    # possible segfault in forked process, cannot reproduce
+$func  27 justin.phelps.pst     # segfault?
 
 [ -n "$val" ] && grep 'lost:' *err | grep -v 'lost: 0 '
 
--- a/src/debug.c	Sat Apr 16 10:31:32 2011 -0700
+++ b/src/debug.c	Sun Apr 17 14:07:25 2011 -0700
@@ -39,8 +39,8 @@
     #ifdef HAVE_SEMAPHORE_H
         debug_mutex = (sem_t*)output_mutex;
     #endif
-    memset(indent, ' ', MAX_DEPTH);
-    indent[MAX_DEPTH] = '\0';
+    memset(indent, ' ', MAX_DEPTH*4);
+    indent[MAX_DEPTH*4] = '\0';
     if (debug_fp) pst_debug_close();
     if (!fname) return;
     if ((debug_fp = fopen(fname, "wb")) == NULL) {
--- a/src/libpst.c	Sat Apr 16 10:31:32 2011 -0700
+++ b/src/libpst.c	Sun Apr 17 14:07:25 2011 -0700
@@ -1335,11 +1335,12 @@
                 pst_free_list(list);
                 id2_ptr = pst_getID2(id2_head, attach->id2_val);
                 if (id2_ptr) {
-                    DEBUG_WARN(("second pass attachment updating id2 found i_id %#"PRIx64"\n", id2_ptr->id->i_id));
-                    // id2_val has been updated to the ID2 value of the datablock containing the
-                    // attachment data
+                    DEBUG_WARN(("second pass attachment updating id2 %#"PRIx64" found i_id %#"PRIx64"\n", attach->id2_val, id2_ptr->id->i_id));
+                    // i_id has been updated to the datablock containing the attachment data
                     attach->i_id     = id2_ptr->id->i_id;
                     attach->id2_head = deep_copy(id2_ptr->child);
+                    DEBUG_WARN(("attachment size was %#"PRIx64", is now %#"PRIx64" based on size of i_id", attach->data.size, id2_ptr->id->size));
+                    attach->data.size = id2_ptr->id->size;
                 } else {
                     DEBUG_WARN(("have not located the correct value for the attachment [%#"PRIx64"]\n", attach->id2_val));
                 }
@@ -3989,7 +3990,7 @@
         free(b);
     } else {
         // here we will assume it is an indirection block that points to others
-        DEBUG_INFO(("Assuming it is a multi-block record because of it's id\n"));
+        DEBUG_INFO(("Assuming it is a multi-block record because of it's id %#"PRIx64"\n", ptr->i_id));
         ret = pst_ff_compile_ID(pf, ptr->i_id, h, (size_t)0);
     }
     ret = pst_finish_cleanup_holder(h, ret);