View Issue Details

IDProjectCategoryView StatusLast Update
0000826bareos-coredirectorpublic2017-10-09 17:10
Reportermedicmomcilo Assigned Tojoergs  
PrioritylowSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version14.04
Product Version16.2.5 
Fixed in Version16.2.7 
Summary0000826: Enabling debugging output crashes Director
DescriptionRecently I needed to enable debugging on our production environment to troubleshoot some issue.
Used this command for that:
  setdebug level=500 trace=1 director

This caused vanilla Director to crash (installed from official Bareos repo).
Last line shown was:
  job.c:1184-0 entering apply_pool_overrides()

I've reproduced this with latest version in test environment and it seems that it's enough to comment out this debugging line in src/dird/job.c:1252
  Dmsg2(100, "Pool set to '%s' because of %s", jcr->res.full_pool->name(), "Job IncPool override\n");

I don't know why is this occuring, so can't propose a patch for this.
My workaround in test environment is to comment it out and rebuild.

Kind regards,
Momcilo "Momo" Medic.
(fedorauser)
TagsNo tags attached.

Relationships

child of 0000836 closedjoergs Release bareos-16.2.7 

Activities

joergs

joergs

2017-06-22 13:56

developer   ~0002674

My first guess would be to replace

Dmsg2(100, "Pool set to '%s' because of %s", jcr->res.full_pool->name(), "Job IncPool override\n");

by

Dmsg2(100, "Pool set to '%s' because of %s", jcr->res.pool->name(), "Job IncPool override\n");

Same for the other Dmsg2 lines around.

As I seams, you got a test environment, in which you can reproduce the problem, would you be so kind to test this?
medicmomcilo

medicmomcilo

2017-07-26 23:45

reporter   ~0002694

Hi Joerg,

Sorry for such a delayed response.
I tested your suggestion as soon as you noted it but never got around to reply.

It works as intended, but looking at the larger chunk of code I think it should be set to job level (e.g. for Incrementals it should be 'jcr->res.inc_pool->name()' ).

I've also tested this and it works without segfaults.
Code as it should look like is this:

      case L_FULL:
         if (jcr->res.full_pool) {
            jcr->res.pool = jcr->res.full_pool;
            pool_override = true;
            if (jcr->res.run_full_pool_override) {
               pm_strcpy(jcr->res.pool_source, _("Run FullPool override"));
               Dmsg2(100, "Pool set to '%s' because of %s", jcr->res.full_pool->name(), "Run FullPool override\n");
            } else {
               pm_strcpy(jcr->res.pool_source, _("Job FullPool override"));
               Dmsg2(100, "Pool set to '%s' because of %s", jcr->res.full_pool->name(), "Job FullPool override\n");
            }
         }
         break;
      case L_VIRTUAL_FULL:
         if (jcr->res.vfull_pool) {
            jcr->res.pool = jcr->res.vfull_pool;
            pool_override = true;
            if (jcr->res.run_vfull_pool_override) {
               pm_strcpy(jcr->res.pool_source, _("Run VFullPool override"));
               Dmsg2(100, "Pool set to '%s' because of %s", jcr->res.vfull_pool->name(), "Run VFullPool override\n");
            } else {
               pm_strcpy(jcr->res.pool_source, _("Job VFullPool override"));
               Dmsg2(100, "Pool set to '%s' because of %s", jcr->res.vfull_pool->name(), "Job VFullPool override\n");
            }
         }
         break;
      case L_INCREMENTAL:
         if (jcr->res.inc_pool) {
            jcr->res.pool = jcr->res.inc_pool;
            pool_override = true;
            if (jcr->res.run_inc_pool_override) {
               pm_strcpy(jcr->res.pool_source, _("Run IncPool override"));
               Dmsg2(100, "Pool set to '%s' because of %s", jcr->res.inc_pool->name(), "Run IncPool override\n");
            } else {
               pm_strcpy(jcr->res.pool_source, _("Job IncPool override"));
               Dmsg2(100, "Pool set to '%s' because of %s", jcr->res.inc_pool->name(), "Job IncPool override\n");
            }
         }
         break;
      case L_DIFFERENTIAL:
         if (jcr->res.diff_pool) {
            jcr->res.pool = jcr->res.diff_pool;
            pool_override = true;
            if (jcr->res.run_diff_pool_override) {
               pm_strcpy(jcr->res.pool_source, _("Run DiffPool override"));
               Dmsg2(100, "Pool set to '%s' because of %s", jcr->res.diff_pool->name(), "Run DiffPool override\n");
            } else {
               pm_strcpy(jcr->res.pool_source, _("Job DiffPool override"));
               Dmsg2(100, "Pool set to '%s' because of %s", jcr->res.diff_pool->name(), "Job DiffPool override\n");
            }
         }
         break;
      }

Please let me know if I can provide further help.

Kind regards,
Momcilo "Momo" Medic.
(fedorauser)
joergs

joergs

2017-08-02 12:01

developer   ~0002696

Your solution sound reasonable. Can you attach a patch to this ticket or do a github pull request? If this requires much effort on your side, let me know. Then I will do the changes myself.
medicmomcilo

medicmomcilo

2017-08-02 21:13

reporter   ~0002697

Hi Joerg,

Always a pleasure :)

Github pull request:
https://github.com/bareos/bareos/pull/62

Kind regards,
Momcilo "Momo" Medic.
(fedorauser)
joergs

joergs

2017-08-07 15:41

developer   ~0002699

Fix committed to bareos bareos-16.2 branch with changesetid 7070.

Related Changesets

bareos: bareos-16.2 674a5296

2017-08-02 23:06

medicmomcilo


Committer: joergs

Ported: N/A

Details Diff
Fix crash when debugging output is enabled

Fixes 0000826: Enabling debugging output crashes Director
Affected Issues
0000826
mod - AUTHORS Diff File
mod - src/dird/job.c Diff File

Issue History

Date Modified Username Field Change
2017-06-08 15:42 medicmomcilo New Issue
2017-06-16 15:07 stephand Relationship added related to 0000794
2017-06-16 15:08 stephand Relationship deleted related to 0000794
2017-06-22 13:56 joergs Note Added: 0002674
2017-06-22 13:56 joergs Status new => feedback
2017-07-26 23:45 medicmomcilo Note Added: 0002694
2017-07-26 23:45 medicmomcilo Status feedback => new
2017-08-02 12:01 joergs Note Added: 0002696
2017-08-02 12:01 joergs Assigned To => joergs
2017-08-02 12:01 joergs Status new => feedback
2017-08-02 21:13 medicmomcilo Note Added: 0002697
2017-08-02 21:13 medicmomcilo Status feedback => assigned
2017-08-07 15:41 joergs Changeset attached => bareos bareos-16.2 674a5296
2017-08-07 15:41 joergs Note Added: 0002699
2017-08-07 15:41 joergs Status assigned => resolved
2017-08-07 15:41 joergs Resolution open => fixed
2017-08-07 21:11 joergs Fixed in Version => 16.2.7
2017-08-07 21:12 joergs Relationship added child of 0000836
2017-10-09 17:10 joergs Status resolved => closed