View Issue Details

IDProjectCategoryView StatusLast Update
0001459bareos-coreinstaller / packagespublic2022-07-04 17:11
Reporterkhvalera Assigned Tobruno-at-bareos  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSanyOS Version3
Product Version21.1.3 
Summary0001459: Fails to build ceph plugin on Archlinux
DescriptionCeph plugin cannot be built on Archlinux with ceph 15.2.14

Build report:

```
[ 73%] Building CXX object core/src/stored/backends/CMakeFiles/bareossd-cephfs.dir/cephfs_device.cc.o
In file included from /data/builds-pkg/bareos/src/bareos/core/src/stored/backends/cephfs_device.cc:33:
/data/builds-pkg/bareos/src/bareos/core/src/stored/backends/cephfs_device.h:31:10: fatal error: cephfs/libcephfs.h: No such file or directory
    31 | #include <cephfs/libcephfs.h>
       | ^~~~~~~~~~~~~~~~~~~~
compilation aborted.
make[2]: *** [core/src/stored/backends/CMakeFiles/bareossd-cephfs.dir/build.make:76: core/src/stored/backends/CMakeFiles/bareossd-cephfs.dir/cephfs_device.cc .o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3157: core/src/stored/backends/CMakeFiles/bareossd-cephfs.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
TagsNo tags attached.

Activities

bruno-at-bareos

bruno-at-bareos

2022-05-10 13:03

manager   ~0004605

Maybe you can describe a bit more your setup, from where come cephfs
maybe the result of find libcephfs.h can be useful
khvalera

khvalera

2022-05-10 15:12

reporter   ~0004606

You can fix this error by installing ceph-libs. But the assembly does not happen:

[ 97%] Building CXX object core/src/plugins/filed/CMakeFiles/cephfs-fd.dir/cephfs/cephfs-fd.cc.o
/data/builds-pkg/bareos/src/bareos/core/src/plugins/filed/cephfs/cephfs-fd.cc: In the "bRC filedaemon::get_next_file_to_backup(PluginContext*)" function:
/data/builds-pkg/bareos/src/bareos/core/src/plugins/filed/cephfs/cephfs-fd.cc:421:33: error: cannot convert "stat*" to "ceph_statx*"
  421 | &p_ctx->statp, &stmask);
      | ^~~~~~~~~~~~~
      | |
      | stat*
In file included from /data/builds-pkg/bareos/src/bareos/core/src/plugins/filed/cephfs/cephfs-fd.cc:35:
/usr/include/cephfs/libcephfs.h:564:43: note: when initializing the 4th argument "int ceph_readdirplus_r(ceph_mount_info*, ceph_dir_result*, dirent*, ceph_statx*, unsigned int, unsigned int, Inode**)"
  564 | struct ceph_statx *stx, unsigned want, unsigned flags, struct Inode **out);
      | ~~~~~~~~~~~~~~~~~~^~~
make[2]: *** [core/src/plugins/filed/CMakeFiles/cephfs-fd.dir/build.make:76: core/src/plugins/filed/CMakeFiles/cephfs-fd.dir/cephfs/cephfs -fd.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3908: core/src/plugins/filed/CMakeFiles/cephfs-fd.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
bruno-at-bareos

bruno-at-bareos

2022-05-10 17:31

manager   ~0004610

When we ask for a bit more information about your setup you maybe make the effort to give useful information like compiler used, cmake output etc ...
otherside we can clause here telling it works so well with cephfs upper version like 15.2.15 or 16.2.7 ...
khvalera

khvalera

2022-05-27 23:58

reporter   ~0004628

After updating the system and the attached patch, bareos began to build again
009-fix-timer_thread.patch (551 bytes)   
--- core/src/lib/timer_thread.cc  2022-03-17 17:22:34.000000000 +0100
+++ core/src/lib/timer_thread.cc  2022-05-15 19:28:30.410009804 +0200
@@ -213,9 +213,11 @@
       remove_from_list = true;
     } else {
       p->scheduled_run_timepoint = last_timer_run_timepoint + p->interval;
+      next_timer_run = min(p->scheduled_run_timepoint, next_timer_run);
     }
+  } else {
+    next_timer_run = min(p->scheduled_run_timepoint, next_timer_run);
   }
-  next_timer_run = min(p->scheduled_run_timepoint, next_timer_run);
   return remove_from_list;
 }
009-fix-timer_thread.patch (551 bytes)   
bruno-at-bareos

bruno-at-bareos

2022-07-04 17:10

manager   ~0004653

I will mark this closed done by

commit ce3339d28
Author: Andreas Rogge <andreas.rogge@bareos.com>
Date: Wed Feb 2 19:41:25 2022 +0100

    lib: fix use-after-free in timer_thread

diff --git a/core/src/lib/timer_thread.cc b/core/src/lib/timer_thread.cc
index 7ec802198..1624ddd4f 100644
--- a/core/src/lib/timer_thread.cc
+++ b/core/src/lib/timer_thread.cc
@@ -2,7 +2,7 @@
    BAREOSĀ® - Backup Archiving REcovery Open Sourced

    Copyright (C) 2002-2011 Free Software Foundation Europe e.V.
- Copyright (C) 2019-2019 Bareos GmbH & Co. KG
+ Copyright (C) 2019-2022 Bareos GmbH & Co. KG

    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version three of the GNU Affero General Public
@@ -204,6 +204,7 @@ static bool RunOneItem(TimerThread::Timer* p,
       = std::chrono::steady_clock::now();

   bool remove_from_list = false;
+ next_timer_run = min(p->scheduled_run_timepoint, next_timer_run);
   if (p->is_active && last_timer_run_timepoint > p->scheduled_run_timepoint) {
     LogMessage(p);
     p->user_callback(p);
@@ -215,7 +216,6 @@ static bool RunOneItem(TimerThread::Timer* p,
       p->scheduled_run_timepoint = last_timer_run_timepoint + p->interval;
     }
   }
- next_timer_run = min(p->scheduled_run_timepoint, next_timer_run);
   return remove_from_list;
 }
bruno-at-bareos

bruno-at-bareos

2022-07-04 17:11

manager   ~0004654

Fixed with https://github.com/bareos/bareos/pull/1060

Issue History

Date Modified Username Field Change
2022-05-09 16:37 khvalera New Issue
2022-05-10 13:03 bruno-at-bareos Note Added: 0004605
2022-05-10 15:12 khvalera Note Added: 0004606
2022-05-10 17:31 bruno-at-bareos Note Added: 0004610
2022-05-27 23:58 khvalera Note Added: 0004628
2022-05-27 23:58 khvalera File Added: 009-fix-timer_thread.patch
2022-07-04 17:10 bruno-at-bareos Note Added: 0004653
2022-07-04 17:11 bruno-at-bareos Assigned To => bruno-at-bareos
2022-07-04 17:11 bruno-at-bareos Status new => resolved
2022-07-04 17:11 bruno-at-bareos Resolution open => fixed
2022-07-04 17:11 bruno-at-bareos Note Added: 0004654