From: Marco van Wieringen Date: Wed, 28 Mar 2012 16:33:14 +0000 (+0200) Subject: Fix bug #1853: bacula-sd dead but pid file exists. X-Git-Tag: Release-7.0.0~269 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3da938066fe94513fa2aa1a9b1bc1864013da4e2;p=bacula%2Fbacula 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. --- 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); /*