From 57e871c02eb6377572c88b9916b929d795be931f Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Wed, 28 Mar 2012 18:33:14 +0200 Subject: [PATCH] Fix bug #1853: bacula-sd dead but pid file exists. We scanned using a %d pattern into a bool value. On some platforms (SPARC) this gives a severe SIGBUS e.g. bus error as the sizeof(bool) on 64 bits is 1 byte and the %d uses an integer value which is 4 bytes. Its obvious now we know this problem that its an problem on other platforms too but it seems only on SPARC it triggers a hardware error by the CPU. The workaround is to use a temporary variable and set the bool to either true or false based on the integer value. --- bacula/src/stored/job.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bacula/src/stored/job.c b/bacula/src/stored/job.c index 8be2b4e201..7fabf57785 100644 --- a/bacula/src/stored/job.c +++ b/bacula/src/stored/job.c @@ -74,7 +74,7 @@ bool job_cmd(JCR *jcr) BSOCK *dir = jcr->dir_bsock; POOL_MEM job_name, client_name, job, fileset_name, fileset_md5; int32_t JobType, level, spool_attributes, no_attributes, spool_data; - int32_t write_part_after_job, PreferMountedVols; + int32_t write_part_after_job, PreferMountedVols, rerunning; int stat; JCR *ojcr; @@ -88,7 +88,7 @@ bool job_cmd(JCR *jcr) &JobType, &level, fileset_name.c_str(), &no_attributes, &spool_attributes, fileset_md5.c_str(), &spool_data, &write_part_after_job, &PreferMountedVols, spool_size, - &jcr->rerunning, &jcr->VolSessionId, &jcr->VolSessionTime); + &rerunning, &jcr->VolSessionId, &jcr->VolSessionTime); if (stat != 17) { pm_strcpy(jcr->errmsg, dir->msg); dir->fsend(BAD_job, stat, jcr->errmsg); @@ -96,6 +96,7 @@ bool job_cmd(JCR *jcr) jcr->setJobStatus(JS_ErrorTerminated); return false; } + jcr->rerunning = (rerunning) ? true : false; Dmsg3(100, "==== rerunning=%d VolSesId=%d VolSesTime=%d\n", jcr->rerunning, jcr->VolSessionId, jcr->VolSessionTime); /* -- 2.39.5