Re: Something amiss in bacula-9.6.7: Possible race condition

Sven Hartge <[email protected]>
Newsgroups gmane.comp.sysutils.backup.bacula.devel
Message-ID <[email protected]>
On 19.01.21 19:40, Martin Simmons wrote:

> I say "in theory" because it looks like Bacula 9.6.4 broke this!
> 
> What is the output of "show catalog" in bconsole?  My guess is that you will
> see db_driver=MySQ i.e. missing the final "L" of MySQL.  This will prevent it
> from reusing the BDB object, leading to unexpected concurrency.
> 
> The bug is caused by this change:
> 
> diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c
> index fdb1d97bf9..11c4406ea7 100644
> --- a/bacula/src/dird/dird.c
> +++ b/bacula/src/dird/dird.c
> @@ -1265,7 +1265,7 @@ static bool check_catalog(cat_op mode)
>              /* To copy dbdriver field into "CAT" catalog resource class (local)
>               * from dbdriver in "BDB" catalog DB Interface class (global)
>               */
> -            strncpy(catalog->db_driver, BDB_db_driver, db_driver_len);
> +            bstrncpy(catalog->db_driver, BDB_db_driver, db_driver_len);
>            }
>         }
> 
> which was part of 9.6.4.
> 
> To fix it, replace db_driver_len with db_driver_len+1 in this call to
> bstrncpy.  This has been fixed in Bacula 11 because the seemingly minor
> problem with "status catalog" was reported in
> https://bugs.bacula.org/view.php?id=2551 but it looks like the significance of
> it wasn't realized.

This is so very amazing! I think this may also explain and cure the 
deadlock problems we have been seeing since 9.6.4.

And also me wondering why suddenly Bacula needed so many more database 
connections since 9.6.4 in contrast to before.

Phil, I am pulling your patch for Gentoo for Debian to get this fix into 
Bullseye ASAP.

Grüße,
Sven.


_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.