bees icon indicating copy to clipboard operation
bees copied to clipboard

Failed to locate .beeshome directory

Open stroucki opened this issue 6 years ago • 2 comments

I am trying to run bees by ./bees -m0 /mnt/btrfs. Since earlier this year, this has stopped working because it tries to get the root_fd as part of parsing the -m0 option before a root_fd had been set.

Backtrace from current git:

#0  BeesContext::root_fd (this=0x55555590f7c0) at bees.h:747
#1  0x00005555555835bf in BeesContext::home_fd (this=0x55555590f7c0)
    at bees-context.cc:192
#2  0x00005555555ea80d in BeesRoots::crawl_state_filename[abi:cxx11]() const (
    this=0x55555590fd30) at bees-roots.cc:94
#3  0x00005555555f03d1 in BeesRoots::BeesRoots (this=0x55555590fd30,
    ctx=std::shared_ptr (expired, weak 0) 0x7fffffffd820) at bees-roots.cc:571
#4  0x00005555555b69db in __gnu_cxx::new_allocator<BeesRoots>::construct<BeesRoots, std::shared_ptr<BeesContext> >(BeesRoots*, std::shared_ptr<BeesContext>&&)
    (this=0x7fffffffd917, __p=0x55555590fd30,
    __args#0=<unknown type in /tmp/btrfs/bees/bin/bees, CU 0x665e9, DIE 0xca550>) at /usr/include/c++/6/ext/new_allocator.h:120
#5  0x00005555555b4ad4 in std::allocator_traits<std::allocator<BeesRoots> >::construct<BeesRoots, std::shared_ptr<BeesContext> >(std::allocator<BeesRoots>&, BeesRoots*, std::shared_ptr<BeesContext>&&) (__a=..., __p=0x55555590fd30,
    __args#0=<unknown type in /tmp/btrfs/bees/bin/bees, CU 0x665e9, DIE 0xca550>) at /usr/include/c++/6/bits/alloc_traits.h:475
#6  0x00005555555b2c23 in std::_Sp_counted_ptr_inplace<BeesRoots, std::allocator<BeesRoots>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::shared_ptr<BeesContext> >(std::allocator<BeesRoots>, std::shared_ptr<BeesContext>&&) (
    this=0x55555590fd20, __a=...)
    at /usr/include/c++/6/bits/shared_ptr_base.h:520
#7  0x00005555555b0bf8 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<BeesRoots, std::allocator<BeesRoots>, std::shared_ptr<BeesContext> >(std::_Sp_make_shared_tag, BeesRoots*, std::allocator<BeesRoots> const&, std::shared_ptr<BeesContext>&&) (this=0x7fffffffdac8, __a=...)
    at /usr/include/c++/6/bits/shared_ptr_base.h:615
#8  0x00005555555af22e in std::__shared_ptr<BeesRoots, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<BeesRoots>, std::shared_ptr<BeesContext> >(std::_Sp_make_shared_tag, std::allocator<BeesRoots> const&, std::shared_ptr<BeesContext>&&) (this=0x7fffffffdac0, __tag=..., __a=...)
    at /usr/include/c++/6/bits/shared_ptr_base.h:1100
#9  0x00005555555ab9a2 in std::shared_ptr<BeesRoots>::shared_ptr<std::allocator<BeesRoots>, std::shared_ptr<BeesContext> >(std::_Sp_make_shared_tag, std::allocator<BeesRoots> const&, std::shared_ptr<BeesContext>&&) (this=0x7fffffffdac0,
    __tag=..., __a=...) at /usr/include/c++/6/bits/shared_ptr.h:319
#10 0x00005555555a6db3 in std::allocate_shared<BeesRoots, std::allocator<BeesRoots>, std::shared_ptr<BeesContext> >(std::allocator<BeesRoots> const&, std::shared_ptr<BeesContext>&&) (__a=...,
    __args#0=<unknown type in /tmp/btrfs/bees/bin/bees, CU 0x665e9, DIE 0xca550>) at /usr/include/c++/6/bits/shared_ptr.h:620
#11 0x00005555555a2201 in std::make_shared<BeesRoots, std::shared_ptr<BeesContext> >(std::shared_ptr<BeesContext>&&) (
    __args#0=<unknown type in /tmp/btrfs/bees/bin/bees, CU 0x665e9, DIE 0xca550>) at /usr/include/c++/6/bits/shared_ptr.h:636
#12 0x000055555558f8bf in BeesContext::roots (this=0x55555590f7c0)
    at bees-context.cc:1083
#13 0x00005555555681b4 in bees_main (argc=3, argv=0x7fffffffe6c8)
    at bees.cc:842
#14 0x000055555556946f in <lambda()>::operator()(void) const (
    __closure=0x55555590f150) at bees.cc:944
#15 0x000055555556cdf1 in std::_Function_handler<void(), main(int, char**)::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...)
    at /usr/include/c++/6/functional:1731
#16 0x0000555555571538 in std::function<void ()>::operator()() const (
    this=0x7fffffffe570) at /usr/include/c++/6/functional:2127
#17 0x0000555555631271 in crucible::catch_and_explain(std::function<void ()> const&, std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)> const&) (f=..., explainer=...) at error.cc:67
#18 0x0000555555569567 in main (argc=3, argv=0x7fffffffe6c8) at bees.cc:945

stroucki avatar Jul 24 '19 20:07 stroucki

Thread 1 "bees" hit Breakpoint 1, BeesContext::root_fd (this=0x55555590f7c0)
    at bees.h:747
747             Fd root_fd() const { return m_root_fd; }
(gdb) print m_root_fd
$1 = {m_ptr = std::shared_ptr (empty) 0x0,
  static s_map_mutex = {<std::__mutex_base> = {_M_mutex = {__data = {
          __lock = 0, __count = 0, __owner = 0, __nusers = 0, __kind = 0,
          __spins = 0, __elision = 0, __list = {__prev = 0x0, __next = 0x0}},
        __size = '\000' <repeats 39 times>, __align = 0}}, <No data fields>},
  static s_map = std::map with 0 elements,
  static s_traits = {<No data fields>}}

stroucki avatar Jul 24 '19 21:07 stroucki

Yep, that's a bug. Using an absolute path in $BEESHOME works, but relative paths do not.

Zygo avatar Jul 25 '19 18:07 Zygo