Bareos Bug Tracker
Bareos Bug Tracker

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000826bareos-core[All Projects] directorpublic2017-06-08 15:422017-08-07 21:12
Reportermedicmomcilo 
Assigned Tojoergs 
PrioritylowSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformLinuxOSUbuntuOS Version14.04
Product Version16.2.5 
Target VersionFixed 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.
bareos-master: impactyes
bareos-master: actionfixed
bareos-16.2: impactyes
bareos-16.2: actionfixed
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action
Attached Files

- Relationships
child of 0000836assignedstephand Release bareos-16.2.7 

-  Notes
(0002674)
joergs (administrator)
2017-06-22 13:56

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?
(0002694)
medicmomcilo (reporter)
2017-07-26 23:45

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)
(0002696)
joergs (administrator)
2017-08-02 12:01

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.
(0002697)
medicmomcilo (reporter)
2017-08-02 21:13

Hi Joerg,

Always a pleasure :)

Github pull request:
https://github.com/bareos/bareos/pull/62 [^]

Kind regards,
Momcilo "Momo" Medic.
(fedorauser)
(0002699)
joergs (administrator)
2017-08-07 15:41

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

- Related Changesets
bareos: bareos-16.2 674a5296
Timestamp: 2017-08-02 21:06:59
Author: medicmomcilo
Committer: joergs
Ported: N/A
Details ] Diff ]
Fix crash when debugging output is enabled

Fixes 0000826: Enabling debugging output crashes Director
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 bareos-master: impact => yes
2017-08-07 21:11 joergs bareos-master: action => fixed
2017-08-07 21:11 joergs bareos-16.2: impact => yes
2017-08-07 21:11 joergs bareos-16.2: action => fixed
2017-08-07 21:11 joergs Fixed in Version => 16.2.7
2017-08-07 21:12 joergs Relationship added child of 0000836


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker