1 This patch should fix a Segfault bug when a job is rescheduled.
2 The storage pointers were being released when they should not
7 patch -p0 <1.36.2-reschedule.patch
11 Index: src/dird/dird.h
12 ===================================================================
13 RCS file: /cvsroot/bacula/bacula/src/dird/dird.h,v
14 retrieving revision 1.7
16 --- src/dird/dird.h 19 Apr 2004 14:27:00 -0000 1.7
17 +++ src/dird/dird.h 18 Mar 2005 17:39:38 -0000
21 void dird_free_jcr(JCR *jcr);
22 +void dird_free_jcr_pointers(JCR *jcr);
24 ===================================================================
25 RCS file: /cvsroot/bacula/bacula/src/dird/job.c,v
26 retrieving revision 1.92.2.2
27 diff -u -r1.92.2.2 job.c
28 --- src/dird/job.c 27 Feb 2005 21:53:28 -0000 1.92.2.2
29 +++ src/dird/job.c 18 Mar 2005 17:39:38 -0000
35 - * Free the Job Control Record if no one is still using it.
36 - * Called from main free_jcr() routine in src/lib/jcr.c so
37 - * that we can do our Director specific cleanup of the jcr.
39 -void dird_free_jcr(JCR *jcr)
40 +/* Called directly from job rescheduling */
41 +void dird_free_jcr_pointers(JCR *jcr)
43 - Dmsg0(200, "Start dird free_jcr\n");
45 if (jcr->sd_auth_key) {
46 free(jcr->sd_auth_key);
47 jcr->sd_auth_key = NULL;
50 if (jcr->term_wait_inited) {
51 pthread_cond_destroy(&jcr->term_wait);
52 + jcr->term_wait_inited = false;
57 + * Free the Job Control Record if no one is still using it.
58 + * Called from main free_jcr() routine in src/lib/jcr.c so
59 + * that we can do our Director specific cleanup of the jcr.
61 +void dird_free_jcr(JCR *jcr)
63 + Dmsg0(200, "Start dird free_jcr\n");
65 + dird_free_jcr_pointers(jcr);
67 /* Delete lists setup to hold storage pointers */
68 for (int i=0; i<MAX_STORE; i++) {
69 if (jcr->storage[i]) {
70 Index: src/dird/jobq.c
71 ===================================================================
72 RCS file: /cvsroot/bacula/bacula/src/dird/jobq.c,v
73 retrieving revision 1.25.4.2
74 diff -u -r1.25.4.2 jobq.c
75 --- src/dird/jobq.c 15 Feb 2005 11:51:03 -0000 1.25.4.2
76 +++ src/dird/jobq.c 18 Mar 2005 17:39:38 -0000
78 bstrftime(dt, sizeof(dt), time(NULL));
79 Jmsg(jcr, M_INFO, 0, _("Rescheduled Job %s at %s to re-run in %d seconds.\n"),
80 jcr->Job, dt, (int)jcr->job->RescheduleInterval);
81 - dird_free_jcr(jcr); /* partial cleanup old stuff */
82 + dird_free_jcr_pointers(jcr); /* partial cleanup old stuff */
83 jcr->JobStatus = JS_WaitStartTime;
85 if (jcr->JobBytes == 0) {