Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid free(), HazptrDomain.h, reported by valgrind #4590

Closed
xtcyclist opened this issue Aug 29, 2022 · 1 comment
Closed

invalid free(), HazptrDomain.h, reported by valgrind #4590

xtcyclist opened this issue Aug 29, 2022 · 1 comment
Assignees
Labels
severity/minor Severity of bug type/bug Type: something is unexpected
Milestone

Comments

@xtcyclist
Copy link
Contributor

xtcyclist commented Aug 29, 2022

==2498== Thread 283 hazptr-tpe-0:
==2498== Invalid free() / delete / delete[] / realloc()
==2498==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==2498==    by 0x29913AB: folly::hazptr_obj_base_linked<folly::UnboundedQueue<folly::CPUThreadPoolExecutor::CPUTask, false, false, false, 6ul, 7ul, std::atomic>::Segment, std::atomic, std::default_delete<folly::UnboundedQueue<folly::CPUThreadPoolExecutor::CPUTask, false, false, false, 6ul, 7ul, std::atomic>::Segment> >::set_reclaim()::{lambda(folly::hazptr_obj<std::atomic>*, folly::hazptr_obj_list<std::atomic>&)#1}::_FUN(folly::hazptr_obj<std::atomic>*, folly::hazptr_obj_list<std::atomic>&) (in /root/src/nebula-ent/build/bin/nebula-graphd)
==2498==    by 0x12CA715: reclaim_unprotected (HazptrDomain.h:550)
==2498==    by 0x12CA715: match_reclaim_untagged (HazptrDomain.h:495)
==2498==    by 0x12CA715: folly::hazptr_domain<std::atomic>::do_reclamation(int) (HazptrDomain.h:518)
==2498==    by 0x29A6B27: folly::ThreadPoolExecutor::runTask(std::shared_ptr<folly::ThreadPoolExecutor::Thread> const&, folly::ThreadPoolExecutor::Task&&) (in /root/src/nebula-ent/build/bin/nebula-graphd)
==2498==    by 0x298BB49: folly::CPUThreadPoolExecutor::threadRun(std::shared_ptr<folly::ThreadPoolExecutor::Thread>) (in /root/src/nebula-ent/build/bin/nebula-graphd)
==2498==    by 0x29A8296: void folly::detail::function::FunctionTraits<void ()>::callBig<std::_Bind<void (folly::ThreadPoolExecutor::*(folly::ThreadPoolExecutor*, std::shared_ptr<folly::ThreadPoolExecutor::Thread>))(std::shared_ptr<folly::ThreadPoolExecutor::Thread>)> >(folly::detail::function::Data&) (in /root/src/nebula-ent/build/bin/nebula-graphd)
==2498==    by 0x30065D3: execute_native_thread_routine (in /root/src/nebula-ent/build/bin/nebula-graphd)
==2498==    by 0x49AD608: start_thread (pthread_create.c:477)
==2498==    by 0x4AE9292: clone (clone.S:95)
==2498==  Address 0x91c1b800 is in a rw- anonymous segment
==2498==
==2498== Invalid free() / delete / delete[] / realloc()
==2498==    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==2498==    by 0x29912E4: folly::hazptr_obj_base_linked<folly::UnboundedQueue<folly::CPUThreadPoolExecutor::CPUTask, false, false, false, 6ul, 7ul, std::atomic>::Segment, std::atomic, std::default_delete<folly::UnboundedQueue<folly::CPUThreadPoolExecutor::CPUTask, false, false, false, 6ul, 7ul, std::atomic>::Segment> >::set_reclaim()::{lambda(folly::hazptr_obj<std::atomic>*, folly::hazptr_obj_list<std::atomic>&)#1}::_FUN(folly::hazptr_obj<std::atomic>*, folly::hazptr_obj_list<std::atomic>&) (in /root/src/nebula-ent/build/bin/nebula-graphd)
==2498==    by 0x12CA715: reclaim_unprotected (HazptrDomain.h:550)
==2498==    by 0x12CA715: match_reclaim_untagged (HazptrDomain.h:495)
==2498==    by 0x12CA715: folly::hazptr_domain<std::atomic>::do_reclamation(int) (HazptrDomain.h:518)
==2498==    by 0x29A6B27: folly::ThreadPoolExecutor::runTask(std::shared_ptr<folly::ThreadPoolExecutor::Thread> const&, folly::ThreadPoolExecutor::Task&&) (in /root/src/nebula-ent/build/bin/nebula-graphd)
==2498==    by 0x298BB49: folly::CPUThreadPoolExecutor::threadRun(std::shared_ptr<folly::ThreadPoolExecutor::Thread>) (in /root/src/nebula-ent/build/bin/nebula-graphd)
==2498==    by 0x29A8296: void folly::detail::function::FunctionTraits<void ()>::callBig<std::_Bind<void (folly::ThreadPoolExecutor::*(folly::ThreadPoolExecutor*, std::shared_ptr<folly::ThreadPoolExecutor::Thread>))(std::shared_ptr<folly::ThreadPoolExecutor::Thread>)> >(folly::detail::function::Data&) (in /root/src/nebula-ent/build/bin/nebula-graphd)
==2498==    by 0x30065D3: execute_native_thread_routine (in /root/src/nebula-ent/build/bin/nebula-graphd)
==2498==    by 0x49AD608: start_thread (pthread_create.c:477)
==2498==    by 0x4AE9292: clone (clone.S:95)
==2498==  Address 0x91c18000 is in a rw- anonymous segment

Follow the same procedure in #4587 to reproduce.

@xtcyclist xtcyclist added the type/bug Type: something is unexpected label Aug 29, 2022
@xtcyclist xtcyclist changed the title invalid free() in graphd, reported by valgrind invalid free(), HazptrDomain.h, reported by valgrind Aug 29, 2022
@Sophie-Xie Sophie-Xie added this to the v3.3.0 milestone Aug 29, 2022
@Sophie-Xie Sophie-Xie assigned xtcyclist and unassigned xtcyclist Aug 29, 2022
@codesigner
Copy link
Contributor

三方库的代码中valgrind报的错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor Severity of bug type/bug Type: something is unexpected
Projects
None yet
Development

No branches or pull requests

4 participants