View Issue Details

IDProjectCategoryView StatusLast Update
0001064bareos-core[All Projects] Generalpublic2019-02-26 18:02
Reporterj.friedrichAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformLinuxOSCentOSOS Version7
Product Version18.2.5 
Target VersionFixed in Version 
Summary0001064: bconsole crashes after 5 minutes in restore operation due to forgotten watchdog
DescriptionDebug trace:

bconsole (800): lib/watchdog.cc:198-0 Registered watchdog 21c3898, interval 300 one shot
bconsole (1900): lib/watchdog.cc:310-0 pthread_cond_timedwait 60
bconsole (900): lib/btimers.cc:188-0 Start bsock timer 21c3828 tid=0x2c00007f6d858b78 for 300 secs at 1551200139

bconsole (800): lib/watchdog.cc:198-0 Registered watchdog 21c1928, interval 600 one shot
bconsole (1900): lib/watchdog.cc:310-0 pthread_cond_timedwait 60
bconsole (900): lib/btimers.cc:188-0 Start bsock timer 21c0fb8 tid=0x5800007f6d858b78 for 600 secs at 1551200139

bconsole (900): lib/btimers.cc:206-0 Stop bsock timer 21c0fb8 tid=0x0000007f6d858b78 at 1551200139.
bconsole (800): lib/watchdog.cc:218-0 Unregistered watchdog 21c1928

However, watchdog 21c3898 is still active and will fire after 5 minutes.

bconsole (1900): lib/watchdog.cc:310-0 pthread_cond_timedwait 60
bconsole (1900): lib/watchdog.cc:310-0 pthread_cond_timedwait 60
bconsole (1900): lib/watchdog.cc:310-0 pthread_cond_timedwait 60
bconsole (1900): lib/watchdog.cc:310-0 pthread_cond_timedwait 60
bconsole (3400): lib/watchdog.cc:281-0 Watchdog callback p=0x21c3898 fire=1551200439
bconsole (900): lib/btimers.cc:244-0 thread timer 21c3898 kill bsock tid=7f6d7aadace0 at 1551200439.
bconsole (1900): lib/watchdog.cc:310-0 pthread_cond_timedwait 60
bconsole (900): lib/signal.cc:137-0 sig=12 User-defined signal 2
Steps To Reproduce1. start bconsole
2. run restore immediately
3. select a restore with a larger directory which takes longer than 5 minutes to complete
4. after 5 minutes you will be returned to Linux prompt

Workaround:
wait for > 5 minutes before starting the restore operation
Additional InformationThe bug is in core/src/lib/bsock.cc:

bool BareosSocket::ConsoleAuthenticateWithDirector(JobControlRecord* jcr,
                                                   const char* identity,
                                                   s_password& password,
                                                   TlsResource* tls_resource,
                                                   BStringList& response_args,
                                                   uint32_t& response_id)
{
  char bashed_name[MAX_NAME_LENGTH];
  BareosSocket* dir = this; /* for readability */

  bstrncpy(bashed_name, identity, sizeof(bashed_name));
  BashSpaces(bashed_name);

dir->StartTimer(60 * 5); /* 5 minutes */

This timer will not be stopped on success!

TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
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

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-02-26 18:02 j.friedrich New Issue