Bug 248358

Summary: sysutils/bareos-server bareos-dir core dumps during -t configtest at startup
Product: Ports & Packages Reporter: ddrinnon
Component: Individual Port(s)Assignee: Jose Alonso Cardenas Marquez <acm>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (acm)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description ddrinnon 2020-07-30 00:41:52 UTC
When running service bareos-dir start, I get a core dump:

root@nas04:/usr/local/etc/bareos # service bareos-dir start
Performing sanity check on /usr/local/etc/bareos/ configuration:
BAREOS interrupted by signal 11: Segmentation violation
Segmentation fault (core dumped)
/usr/local/etc/rc.d/bareos-dir: WARNING: failed precmd routine for bareos_dir

manually running /usr/local/sbin/bareos-dir with -t and -d 1000:

....
bareos-dir (500): cats/mysql.cc:540-0 we have 0 rows
bareos-dir (100): cats/sql_query.cc:105-0 called: void BareosDb::FillQueryVaList(PoolMem &, BareosDb::SQL_QUERY, __va_list_tag *) with query name sql_get_max_connections (45)
bareos-dir (100): cats/sql_query.cc:110-0 called: void BareosDb::FillQueryVaList(PoolMem &, BareosDb::SQL_QUERY, __va_list_tag *) query is now SHOW VARIABLES LIKE 'max_connections'
bareos-dir (500): cats/mysql.cc:414-0 SqlQueryWithHandler starts with SHOW VARIABLES LIKE 'max_connections'
bareos-dir (500): cats/mysql.cc:465-0 SqlQueryWithHandler succeeded. checking handler
bareos-dir (500): cats/mysql.cc:487-0 SqlQueryWithHandler finished
bareos-dir (100): cats/mysql.cc:247-0 closedb ref=0 connected=1 db=803c53848
bareos-dir (100): cats/mysql.cc:252-0 close db=803c53848
BAREOS interrupted by signal 11: Segmentation violation
Segmentation fault (core dumped)


bareos-dir seems to run okay and is able to backup and restore clients if I bypass the "-t" in /usr/local/etc/rc.d/bareos-dir or just run /usr/local/sbin/bareos-dir -u bareos -g bareos -v -c /usr/local/etc/bareos/ manually. 

This is on a FreeBSD x64 v11.3 p11 system and I've duplicated it on other 11.3 systems as well.  This happens with Bareos 18 and 19.  17 works fine.  I have not tested on v11.4 or higher.

Using MySQL 5.7 for the db server.
Comment 1 Jose Alonso Cardenas Marquez freebsd_committer freebsd_triage 2020-12-15 07:09:31 UTC
- Could you test with latest version of sysutils/bareos-server (19.2.9)?
Comment 2 ddrinnon 2021-01-24 18:54:29 UTC
Confirmed that this is fixed in 19.2.9
Thank you!