Zygo / bees

Best-Effort Extent-Same, a btrfs dedupe agent
GNU General Public License v3.0
692 stars 56 forks source link

a segfault of bees #250

Closed wangyugui-e16 closed 1 year ago

wangyugui-e16 commented 1 year ago

a segfault of bees version: github master

Core was generated by `bees -a ./'.
(gdb) where
#0  0x00007f6546236387 in raise () from /lib64/libc.so.6
#1  0x00007f6546237a78 in abort () from /lib64/libc.so.6
#2  0x00007f6546278f67 in __libc_message () from /lib64/libc.so.6
#3  0x00007f6546281329 in _int_free () from /lib64/libc.so.6
#4  0x0000000000426987 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() ()
#5  0x000000000045e5f9 in BeesRoots::is_root_ro(unsigned long) ()
#6  0x00000000004309d3 in BeesContext::is_root_ro(unsigned long) ()
#7  0x0000000000468f11 in BeesCrawl::fetch_extents() ()
#8  0x0000000000469430 in BeesCrawl::fetch_extents_harder() ()
#9  0x000000000046a622 in BeesCrawl::pop_front() ()
#10 0x000000000046a83e in BeesRoots::crawl_batch(std::shared_ptr<BeesCrawl>) ()
#11 0x000000000046bbbb in BeesScanModeIndependent::scan() ()
#12 0x000000000045ffae in BeesRoots::crawl_roots() ()
#13 0x000000000046033a in std::_Function_handler<void (), BeesRoots::crawl_thread()::{lambda()#2}>::_M_invoke(std::_Any_data const&) ()
#14 0x000000000048ea52 in crucible::catch_all(std::function<void ()> const&, std::function<void (std::string)> const&)
    ()
#15 0x00000000004ab16b in crucible::TaskState::exec() ()
#16 0x000000000048ea52 in crucible::catch_all(std::function<void ()> const&, std::function<void (std::string)> const&)
    ()
#17 0x00000000004ac6ca in crucible::TaskConsumer::consumer_thread() ()
#18 0x00000000004b4bcf in execute_native_thread_routine ()
#19 0x00007f6547207ea5 in start_thread () from /lib64/libpthread.so.0
#20 0x00007f65462feb0d in clone () from /lib64/libc.so.6
wangyugui-e16 commented 1 year ago

build with '-static-libgcc -static-libstdc++', and then yet not happen.

wangyugui-e16 commented 1 year ago

It happen again with the build ''-static-libgcc -static-libstdc++".

# gdb /usr/hpc-bio/fs/bees core.5587
Reading symbols from /usr/hpc-bio/fs/bees...done.
[New LWP 5588]
[New LWP 5596]
[New LWP 5600]
[New LWP 5601]
[New LWP 5602]
[New LWP 5598]
[New LWP 5590]
[New LWP 5589]
[New LWP 5587]
[New LWP 5592]
[New LWP 5594]
[New LWP 5603]
[New LWP 5597]
[New LWP 5591]
[New LWP 5593]
[New LWP 5595]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `bees -c 10 -a ./'.
Program terminated with signal 6, Aborted.
#0  0x00007f557f436387 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.17-326.el7_9.x86_64 libgcc-4.8.5-44.el7.x86_64
(gdb) where
#0  0x00007f557f436387 in raise () from /lib64/libc.so.6
#1  0x00007f557f437a78 in abort () from /lib64/libc.so.6
#2  0x00007f557f478f67 in __libc_message () from /lib64/libc.so.6
#3  0x00007f557f481329 in _int_free () from /lib64/libc.so.6
#4  0x00000000004422ae in deallocate (this=0x1cec2e8, __p=<optimized out>)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/ext/atomicity.h:82
#5  deallocate (__a=..., __n=1, __p=<optimized out>)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/alloc_traits.h:462
#6  _M_put_node (this=0x1cec2e8, __p=<optimized out>)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/stl_tree.h:603
#7  _M_drop_node (this=0x1cec2e8, __p=<optimized out>)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/stl_tree.h:670
#8  std::_Rb_tree<crucible::BtrfsIoctlSearchHeader, crucible::BtrfsIoctlSearchHeader, std::_Identity<crucible::BtrfsIoctlSearchHeader>, std::less<crucible::BtrfsIoctlSearchHeader>, std::allocator<crucible::BtrfsIoctlSearchHeader> >::_M_erase (this=0x1cec2e8, __x=<optimized out>) at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/stl_tree.h:1874
#9  0x00000000004a0e9e in clear (this=0x1cec2e8) at fs.cc:751
#10 clear (this=0x1cec2e8) at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/stl_set.h:734
#11 crucible::BtrfsIoctlSearchKey::do_ioctl_nothrow(int) () at fs.cc:751
#12 0x00000000004a1513 in crucible::BtrfsIoctlSearchKey::do_ioctl(int) () at fs.cc:802
#13 0x0000000000484524 in crucible::BtrfsTreeFetcher::at(unsigned long) ()
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/ext/atomicity.h:96
#14 0x0000000000484aea in crucible::BtrfsRootFetcher::root(unsigned long) () at btrfs-tree.cc:677
#15 0x000000000045df2b in BeesRoots::is_root_ro(unsigned long) () at bees-roots.cc:1104
#16 0x0000000000430741 in is_root_ro (root=5, this=0x1ce9490) at bees-context.cc:187
#17 BeesContext::dedup(BeesRangePair const&) () at bees-context.cc:199
#18 0x00000000004538dd in BeesResolver::replace_dst(BeesFileRange const&)::{lambda(BeesFileRange const&)#5}::operator()(BeesFileRange const&) const () at bees-resolve.cc:441
#19 0x0000000000457fd2 in operator() (__args#0=..., this=0x7f557f3fc3d0)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:260
#20 BeesResolver::for_each_extent_ref(BeesBlockData, std::function<bool (BeesFileRange const&)>) ()
    at bees-resolve.cc:368
#21 0x00000000004587bd in BeesResolver::replace_dst(BeesFileRange const&) ()
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/ext/atomicity.h:96
---Type <return> to continue, or q <return> to quit---
#22 0x00000000004393b1 in BeesContext::scan_one_extent(BeesFileRange const&, crucible::Extent const&) ()
    at bees-context.cc:541
#23 0x000000000043a5c3 in operator() (__closure=0x7f5508003f30) at bees-context.cc:738
#24 std::_Function_handler<void (), BeesContext::scan_forward(BeesFileRange const&)::{lambda()#4}::operator()() const::{lambda()#1}>::_M_invoke(std::_Any_data const&) ()
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:297
#25 0x000000000048e3b2 in operator() (this=<optimized out>)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:260
#26 crucible::catch_all(std::function<void ()> const&, std::function<void (std::string)> const&) () at error.cc:55
#27 0x000000000042bdd5 in operator() (__closure=0x7f5508008490)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:87
#28 std::_Function_handler<void (), BeesContext::scan_forward(BeesFileRange const&)::{lambda()#4}>::_M_invoke(std::_Any_data const&) () at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:297
#29 0x000000000048e3b2 in operator() (this=<optimized out>)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:260
#30 crucible::catch_all(std::function<void ()> const&, std::function<void (std::string)> const&) () at error.cc:55
#31 0x0000000000435f98 in BeesContext::scan_forward(BeesFileRange const&) ()
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:87
#32 0x000000000045a957 in operator() (__closure=0x7f55080013f0) at bees-roots.cc:633
#33 std::_Function_handler<void (), BeesFileCrawl::crawl_one_extent()::{lambda()#4}>::_M_invoke(std::_Any_data const&)
    () at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:297
#34 0x000000000048e3b2 in operator() (this=<optimized out>)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:260
#35 crucible::catch_all(std::function<void ()> const&, std::function<void (std::string)> const&) () at error.cc:55
#36 0x0000000000467d14 in BeesFileCrawl::crawl_one_extent() ()
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:87
#37 0x00000000004681a8 in operator() (__closure=0x7f553c002040) at bees-roots.cc:681
#38 std::_Function_handler<void (), BeesRoots::crawl_batch(std::shared_ptr<BeesCrawl>)::{lambda()#4}>::_M_invoke(std::_Any_data const&) () at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:297
#39 0x000000000048e3b2 in operator() (this=<optimized out>)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:260
#40 crucible::catch_all(std::function<void ()> const&, std::function<void (std::string)> const&) () at error.cc:55
#41 0x00000000004aaacb in crucible::TaskState::exec() () at /opt/rh/devtoolset-8/root/usr/include/c++/8/new:169
---Type <return> to continue, or q <return> to quit---
#42 0x000000000048e3b2 in operator() (this=<optimized out>)
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/std_function.h:260
#43 crucible::catch_all(std::function<void ()> const&, std::function<void (std::string)> const&) () at error.cc:55
#44 0x00000000004ac02a in crucible::TaskConsumer::consumer_thread() ()
    at /opt/rh/devtoolset-8/root/usr/include/c++/8/new:169
#45 0x00000000004c48af in execute_native_thread_routine ()
#46 0x00007f557fc07ea5 in start_thread () from /lib64/libpthread.so.0
#47 0x00007f557f4feb0d in clone () from /lib64/libc.so.6
(gdb)