Dennis,

The attached patch fix the crash.

You have log corruption because of amdump and amvault running simultaneously.
Jean-Louis

On 05/15/2012 08:20 AM, Dennis Benndorf wrote:
Am 15.05.2012 14:14, schrieb Jean-Louis Martineau:
On 05/15/2012 07:54 AM, Dennis Benndorf wrote:

Log file /usr/local/etc/amanda/daily/catalog/log.20120506180002.0 stamped 20120506180002, expecting 20120505180458!
I never saw amanda print this message.

This happens when amvault starts and amdump is not finished, so I think they both write in the same log-file. But this has happened a few times ago, mostly when our monthly backups take more than 24hours.


Can you run gdb again and get the value of the second argument to g_string_chunk_insert_const.
How do I do that?



Send me /usr/local/etc/amanda/daily/catalog/log.20120506180002.0 and /usr/local/etc/amanda/daily/catalog/log.20120505180458.0

Jean-Louis


Attached.

Regards,
Dennis

diff --git a/server-src/find.c b/server-src/find.c
index 0edd6af..0b0348f 100644
--- a/server-src/find.c
+++ b/server-src/find.c
@@ -711,7 +711,8 @@ search_logfile(
     char *ck_label=NULL;
     int level = 0;
     off_t filenum;
-    char *ck_datestamp, *datestamp;
+    char *ck_datestamp=NULL;
+    char *datestamp;
     char *s;
     int ch;
     disk_t *dp;
@@ -745,6 +746,8 @@ search_logfile(
     filenum = (off_t)0;
     while(get_logline(logf)) {
 	if (curlog == L_START && curprog == P_TAPER) {
+	    amfree(ck_label);
+	    ck_datestamp = NULL;
 	    if(parse_taper_datestamp_log(curstr, &ck_datestamp,
                                          &ck_label) == 0) {
 		g_printf(_("strange log line in %s \"start taper %s\"\n"),
@@ -770,11 +773,14 @@ search_logfile(
 	    }
             amfree(current_label);
             current_label = ck_label;
+	    ck_label = NULL;
             if (datestamp == NULL) {
                 datestamp = g_strdup(ck_datestamp);
             }
 	    filenum = (off_t)0;
 	}
+	if (!datestamp)
+	    continue;
 	if (right_label &&
 	    (curlog == L_SUCCESS ||
 	     curlog == L_CHUNK || curlog == L_PART || curlog == L_PARTPARTIAL) &&

Reply via email to