brpc在 arm64环境 使用 valgrind会显示 很多内存 泄漏,
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 30/100
Línea de trabajo
Comienza con las trazas de Valgrind de arm64 reportadas en bthread::id_create_impl, bthread::TaskGroup::init, bthread::WorkStealingQueue::init y butil::iobuf::acquire_tls_block(). Reproduce el crecimiento de memoria y compara el comportamiento con y sin tcmalloc; se considera terminado cuando se haya identificado la fuga relevante o la interacción con el asignador y se haya confirmado que el proceso arm64 ya no sigue creciendo hasta terminar con OOM.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
brpc在 arm64环境 内存 快速增长 后oom, 使用 valgrind会显示 很多内存 泄漏, 不确定 是 哪儿 的 问题, 另外就是 如果 加上 tcmalloc后, 就不会一直内存增长
To Reproduce
Expected behavior
Versions
OS: Linux xxx 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 16:08:13 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
Compiler: gcc10
brpc:brpc-1.10.0
protobuf:
Additional context/screenshots
==301== 872,576 (35,904 direct, 836,672 indirect) bytes in 17 blocks are definitely lost in loss record 1,911 of 1,927
==301== at 0x4866554: operator new(unsigned long, std::align_val_t, std::nothrow_t const&) (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==301== by 0x51CA47: bthread::id_create_impl(bthread_id_t*, void*, int ()(bthread_id_t, void, int), int ()(bthread_id_t, void, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)) (in /app/bin/visioncloud_gateway)
==301== by 0x51CB47: bthread_id_create (in /app/bin/visioncloud_gateway)
==301== by 0x3AC86F: brpc::Socket::OnCreated(brpc::SocketOptions const&) (in /app/bin/visioncloud_gateway)
==301== by 0x3B5123: int brpc::VersionedRefWithIdbrpc::Socket::Createbrpc::SocketOptions(unsigned long*, brpc::SocketOptions) (in /app/bin/visioncloud_gateway)
==301== by 0x3ACEDF: brpc::Socket::Create(brpc::SocketOptions const&, unsigned long*) (in /app/bin/visioncloud_gateway)
==301== by 0x462787: brpc::Acceptor::OnNewConnectionsUntilEAGAIN(brpc::Socket*) (in /app/bin/visioncloud_gateway)
==301== by 0x462D83: brpc::Acceptor::OnNewConnections(brpc::Socket*) (in /app/bin/visioncloud_gateway)
==301== by 0x3A9083: brpc::Socket::ProcessEvent(void*) (in /app/bin/visioncloud_gateway)
==301== by 0x50A4D3: bthread::TaskGroup::task_runner(long) (in /app/bin/visioncloud_gateway)
==301== by 0x50AB2F: bthread::TaskGroup::run_main_task() (in /app/bin/visioncloud_gateway)
==301== by 0x5118CF: bthread::TaskControl::worker_thread(void*) (in /app/bin/visioncloud_gateway)
==301==
==301== 1,015,064 (3,480 direct, 1,011,584 indirect) bytes in 145 blocks are definitely lost in loss record 1,912 of 1,927
==301== at 0x4866058: operator new(unsigned long, std::nothrow_t const&) (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==301== by 0x5AE187: butil::detail::get_or_new_thread_exit_helper() (in /app/bin/visioncloud_gateway)
==301== by 0x5AE207: butil::thread_atexit(void ()(void), void*) (in /app/bin/visioncloud_gateway)
==301== by 0x509C2B: bthread::TaskGroup::init(unsigned long) (in /app/bin/visioncloud_gateway)
==301== by 0x50F1E7: bthread::TaskControl::create_group(int) (in /app/bin/visioncloud_gateway)
==301== by 0x511723: bthread::TaskControl::worker_thread(void*) (in /app/bin/visioncloud_gateway)
==301== by 0x50AD5B7: start_thread (pthread_create.c:442)
==301== by 0x5115EDB: thread_start (clone.S:79)
==301==
==301== 2,179,072 bytes in 133 blocks are definitely lost in loss record 1,920 of 1,927
==301== at 0x4865058: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==301== by 0x50994F: bthread::TaskGroup::init(unsigned long) (in /app/bin/visioncloud_gateway)
==301== by 0x50F1E7: bthread::TaskControl::create_group(int) (in /app/bin/visioncloud_gateway)
==301== by 0x511723: bthread::TaskControl::worker_thread(void*) (in /app/bin/visioncloud_gateway)
==301== by 0x50AD5B7: start_thread (pthread_create.c:442)
==301== by 0x5115EDB: thread_start (clone.S:79)
==301==
==301== 4,423,680 bytes in 135 blocks are definitely lost in loss record 1,923 of 1,927
==301== at 0x4867388: operator new[](unsigned long, std::nothrow_t const&) (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==301== by 0x50B99F: bthread::WorkStealingQueue::init(unsigned long) (in /app/bin/visioncloud_gateway)
==301== by 0x50993F: bthread::TaskGroup::init(unsigned long) (in /app/bin/visioncloud_gateway)
==301== by 0x50F1E7: bthread::TaskControl::create_group(int) (in /app/bin/visioncloud_gateway)
==301== by 0x511723: bthread::TaskControl::worker_thread(void*) (in /app/bin/visioncloud_gateway)
==301== by 0x50AD5B7: start_thread (pthread_create.c:442)
==301== by 0x5115EDB: thread_start (clone.S:79)
==301==
==301== 13,746,176 (376,832 direct, 13,369,344 indirect) bytes in 46 blocks are definitely lost in loss record 1,926 of 1,927
==301== at 0x4865058: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==301== by 0x5A260F: butil::iobuf::acquire_tls_block() (in /app/bin/visioncloud_gateway)
==301== by 0x5A3773: butil::IOPortal::pappend_from_file_descriptor(int, long, unsigned long) (in /app/bin/visioncloud_gateway)
==301== by 0x3A6723: brpc::Socket::DoRead(unsigned long) (in /app/bin/visioncloud_gateway)
==301== by 0x3E75DF: brpc::InputMessenger::OnNewMessages(brpc::Socket*) (in /app/bin/visioncloud_gateway)
==301== by 0x3A9083: brpc::Socket::ProcessEvent(void*) (in /app/bin/visioncloud_gateway)
==301== by 0x50A4D3: bthread::TaskGroup::task_runner(long) (in /app/bin/visioncloud_gateway)
==301== by 0x50AB2F: bthread::TaskGroup::run_main_task() (in /app/bin/visioncloud_gateway)
==301== by 0x5118CF: bthread::TaskControl::worker_thread(void*) (in /app/bin/visioncloud_gateway)
==301== by 0x50AD5B7: start_thread (pthread_create.c:442)
==301== by 0x5115EDB: thread_start (clone.S:79)
==301==
==301== LEAK SUMMARY:
==301== definitely lost: 8,546,672 bytes in 4,651 blocks
==301== indirectly lost: 17,290,390 bytes in 2,683 blocks
==301== possibly lost: 485,305 bytes in 258 blocks
==301== still reachable: 44,379,389 bytes in 6,286 blocks
==301== of which reachable via heuristic:
==301== newarray : 3,656 bytes in 2 blocks
==301== suppressed: 0 bytes in 0 blocks
==301== Reachable blocks (those to which a pointer was found) are not shown.
==301== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==301==
==301== Use --track-origins=yes to see where uninitialised values come from
==301== For lists of detected and suppressed errors, rerun with: -s
==301== ERROR SUMMARY: 171162 errors from 1164 contexts (suppressed: 0 from 0)
root@visioncloud-gateway-d5c95b555-xjjc5:/app#
root@visioncloud-gateway-d5c95b555-xjjc5:/app# ==301== 13,746,176 (376,832 direct, 13,369,344 indirect) bytes in 46 blocks are definitely lost in loss record 1,926 of 1,927
==301== at 0x4865058: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-arm64-linux.so)
==301== by 0x5A260F: butil::iobuf::acquire_tls_block() (in /app/bin/visioncloud_gateway)
==301== by 0x5A3773: butil::IOPortal::pappend_from_file_descriptor(int, long, unsigned long) (in /app/bin/visioncloud_gateway)
==301== by 0x3A6723: brpc::Socket::DoRead(unsigned long) (in /app/bin/visioncloud_gateway)
==301== by 0x3E75DF: brpc::InputMessenger::OnNewMessages(brpc::Socket*) (in /app/bin/visioncloud_gateway)
==301== by 0x3A9083: brpc::Socket::ProcessEvent(void*) (in /app/bin/visioncloud_gateway)
==301== by 0x50A4D3: bthread::TaskGroup::task_runner(long) (in /app/bin/visioncloud_gateway)
==301== by 0x50AB2F: bthread::TaskGroup::run_main_task() (in /app/bin/visioncloud_gateway)
==301== by 0x5118CF: bthread::TaskControl::worker_thread(void*) (in /app/bin/visioncloud_gateway)
==301== by 0x50AD5B7: start_thread (pthread_create.c:442)
==301== by 0x5115EDB: thread_start (clone.S:79)
- Lenguaje dominante
- C++
- Estrellas
- 17.6k
- Forks
- 4.2k
- Merge medio
- 3 d 17 h
- PR fusionados (30 d)
- 72
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/brpc
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días
-
endpoint2hostname() prints a byte-swapped port for IPv6 endpointsPosiblemente ocupada @0z5a la tomó hace 8 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 2 días
-
perf(butil): ARM64 (aarch64) performance and modernisation improvements across atomics, CRC32C, spin-wait hints, and fast timersPosiblemente ocupada @jimmystewpot la tomó hace 2 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
Los mantenedores suelen responder en 2 días
-
file:// naming service takes a comment after the address as the tagPosiblemente ocupada @0z5a la tomó hace 8 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
Todos los issues de apache/brpc
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
protocolbuffers/protobuf#31768 ·
Los mantenedores suelen responder en 1 día
-
Needs: Triage :mag: Platform: Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
react/react-native#60167 ·
Los mantenedores suelen responder en 2 días
-
Level format documentationAbiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
-
tests: ofx_render_test doesn't compile against FFmpeg 4.x (const AVCodec* to av_find_best_stream)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NatronGitHub/openfx-io#221 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
subsurface/subsurface#5145 ·
Los mantenedores suelen responder en 2 días