From dev-return-58701-archive-asf-public=cust-asf.ponee.io@thrift.apache.org Thu Jun 4 19:33:02 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 886BF180656 for ; Thu, 4 Jun 2020 21:33:02 +0200 (CEST) Received: (qmail 10252 invoked by uid 500); 4 Jun 2020 19:33:01 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 10240 invoked by uid 99); 4 Jun 2020 19:33:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Jun 2020 19:33:01 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id DFE534107E for ; Thu, 4 Jun 2020 19:33:00 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 32E6A780472 for ; Thu, 4 Jun 2020 19:33:00 +0000 (UTC) Date: Thu, 4 Jun 2020 19:33:00 +0000 (UTC) From: "Jens Geyer (Jira)" To: dev@thrift.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (THRIFT-5122) Fix memory leak in c_glib tutorial server MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/THRIFT-5122?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Jens Geyer resolved THRIFT-5122. -------------------------------- Fix Version/s: 0.14.0 Resolution: Fixed > Fix memory leak in c_glib tutorial server > ----------------------------------------- > > Key: THRIFT-5122 > URL: https://issues.apache.org/jira/browse/THRIFT-5122 > Project: Thrift > Issue Type: Bug > Components: Tutorial > Affects Versions: 0.13.0 > Reporter: wangyunjian > Assignee: wangyunjian > Priority: Minor > Fix For: 0.14.0 > > Time Spent: 1h 40m > Remaining Estimate: 0h > > The memory leak was triggered on running c_glib tutorial server. The memo= ry used by a ThriftStruct's properties don't need to call g_strdup and=C2= =A0will be malloced on set property. And the error object need to be freed. > Leak: > Direct leak of 19 byte(s) in 1 object(s) allocated from: > #0 0x7f1744030ae8 in __interceptor_malloc (/usr/lib64/libasan.so.5+0xefa= e8) > #1 0x7f17430851d5 in g_malloc (/usr/lib64/libglib-2.0.so.0+0x531d5) > #2 0x7f174309eb32 in g_strdup (/usr/lib64/libglib-2.0.so.0+0x6cb32) > #3 0x403285 in tutorial_calculator_handler_calculate /mnt/hgfs/share/thr= ift-0.13.0/tutorial/c_glib/c_glib_server.c:233 > #4 0x4081e4 in calculator_handler_calculate gen-c_glib/calculator.c:713 > #5 0x409870 in calculator_processor_process_calculate gen-c_glib/calcula= tor.c:1030 > #6 0x40a483 in calculator_processor_dispatch_call gen-c_glib/calculator.= c:1198 > #7 0x7f1743d1ee53 in thrift_dispatch_processor_process (/usr/lib64/libth= rift_c_glib.so.0+0xee53) > #8 0x7f1743d32d11 in thrift_simple_server_serve src/thrift/c_glib/server= /thrift_simple_server.c:58 > #9 0x7f1743d31b9a in thrift_server_serve src/thrift/c_glib/server/thrift= _server.c:108 > #10 0x404113 in main /mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/c_gli= b_server.c:506 > #11 0x7f1742869872 in __libc_start_main (/usr/lib64/libc.so.6+0x23872) > #12 0x402a0d in _start (/mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/.l= ibs/tutorial_server+0x402a0d) > Direct leak of 16 byte(s) in 1 object(s) allocated from: > #0 0x7f1744030ae8 in __interceptor_malloc (/usr/lib64/libasan.so.5+0xefa= e8) > #1 0x7f17430851d5 in g_malloc (/usr/lib64/libglib-2.0.so.0+0x531d5) > #2 0x7f174309ce06 in g_slice_alloc (/usr/lib64/libglib-2.0.so.0+0x6ae06) > #3 0x7f174306a350 in g_error_new_valist (/usr/lib64/libglib-2.0.so.0+0x3= 8350) > #4 0x7f174306a75e in g_set_error (/usr/lib64/libglib-2.0.so.0+0x3875e) > #5 0x7f1743d2df8e in thrift_server_socket_accept src/thrift/c_glib/trans= port/thrift_server_socket.c:147 > #6 0x7f1743d2d17d in thrift_server_transport_accept (/usr/lib64/libthrif= t_c_glib.so.0+0x1d17d) > #7 0x7f1743d3298a in thrift_simple_server_serve src/thrift/c_glib/server= /thrift_simple_server.c:42 > #8 0x7f1743d31b9a in thrift_server_serve src/thrift/c_glib/server/thrift= _server.c:108 > #9 0x404113 in main /mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/c_glib= _server.c:506 > #10 0x7f1742869872 in __libc_start_main (/usr/lib64/libc.so.6+0x23872) > #11 0x402a0d in _start (/mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/.l= ibs/tutorial_server+0x402a0d) > Direct leak of 2 byte(s) in 1 object(s) allocated from: > #0 0x7f1744030ae8 in __interceptor_malloc (/usr/lib64/libasan.so.5+0xefa= e8) > #1 0x7f17430851d5 in g_malloc (/usr/lib64/libglib-2.0.so.0+0x531d5) > #2 0x7f174309eb32 in g_strdup (/usr/lib64/libglib-2.0.so.0+0x6cb32) > #3 0x403569 in tutorial_calculator_handler_calculate /mnt/hgfs/share/thr= ift-0.13.0/tutorial/c_glib/c_glib_server.c:265 > #4 0x4081e4 in calculator_handler_calculate gen-c_glib/calculator.c:713 > #5 0x409870 in calculator_processor_process_calculate gen-c_glib/calcula= tor.c:1030 > #6 0x40a483 in calculator_processor_dispatch_call gen-c_glib/calculator.= c:1198 > #7 0x7f1743d1ee53 in thrift_dispatch_processor_process (/usr/lib64/libth= rift_c_glib.so.0+0xee53) > #8 0x7f1743d32d11 in thrift_simple_server_serve src/thrift/c_glib/server= /thrift_simple_server.c:58 > #9 0x7f1743d31b9a in thrift_server_serve src/thrift/c_glib/server/thrift= _server.c:108 > #10 0x404113 in main /mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/c_gli= b_server.c:506 > #11 0x7f1742869872 in __libc_start_main (/usr/lib64/libc.so.6+0x23872) > #12 0x402a0d in _start (/mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/.l= ibs/tutorial_server+0x402a0d) > Direct leak of 2 byte(s) in 1 object(s) allocated from: > #0 0x7f1744030ae8 in __interceptor_malloc (/usr/lib64/libasan.so.5+0xefa= e8) > #1 0x7f17430851d5 in g_malloc (/usr/lib64/libglib-2.0.so.0+0x531d5) > #2 0x7f174309eb32 in g_strdup (/usr/lib64/libglib-2.0.so.0+0x6cb32) > #3 0x7f1743af773c (/usr/lib64/libgobject-2.0.so.0+0x3a73c) > #4 0x7f1743ad60a5 in g_object_get_valist (/usr/lib64/libgobject-2.0.so.0= +0x190a5) > #5 0x7f1743ad6463 in g_object_get (/usr/lib64/libgobject-2.0.so.0+0x1946= 3) > #6 0x403a2b in tutorial_calculator_handler_get_struct /mnt/hgfs/share/th= rift-0.13.0/tutorial/c_glib/c_glib_server.c:333 > #7 0x40c76c in shared_service_handler_get_struct gen-c_glib/shared_servi= ce.c:325 > #8 0x40cc0d in shared_service_processor_process_get_struct gen-c_glib/sh= ared_service.c:416 > #9 0x40d1f5 in shared_service_processor_dispatch_call gen-c_glib/shared_= service.c:498 > #10 0x40a4d4 in calculator_processor_dispatch_call gen-c_glib/calculator= .c:1206 > #11 0x7f1743d1ee53 in thrift_dispatch_processor_process (/usr/lib64/libt= hrift_c_glib.so.0+0xee53) > #12 0x7f1743d32d11 in thrift_simple_server_serve src/thrift/c_glib/serve= r/thrift_simple_server.c:58 > #13 0x7f1743d31b9a in thrift_server_serve src/thrift/c_glib/server/thrif= t_server.c:108 > #14 0x404113 in main /mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/c_gli= b_server.c:506 > #15 0x7f1742869872 in __libc_start_main (/usr/lib64/libc.so.6+0x23872) > #16 0x402a0d in _start (/mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/.l= ibs/tutorial_server+0x402a0d) > Direct leak of 2 byte(s) in 1 object(s) allocated from: > #0 0x7f1744030ae8 in __interceptor_malloc (/usr/lib64/libasan.so.5+0xefa= e8) > #1 0x7f17430851d5 in g_malloc (/usr/lib64/libglib-2.0.so.0+0x531d5) > #2 0x7f174309eb32 in g_strdup (/usr/lib64/libglib-2.0.so.0+0x6cb32) > #3 0x403a5a in tutorial_calculator_handler_get_struct /mnt/hgfs/share/th= rift-0.13.0/tutorial/c_glib/c_glib_server.c:337 > #4 0x40c76c in shared_service_handler_get_struct gen-c_glib/shared_servi= ce.c:325 > #5 0x40cc0d in shared_service_processor_process_get_struct gen-c_glib/sh= ared_service.c:416 > #6 0x40d1f5 in shared_service_processor_dispatch_call gen-c_glib/shared_= service.c:498 > #7 0x40a4d4 in calculator_processor_dispatch_call gen-c_glib/calculator.= c:1206 > #8 0x7f1743d1ee53 in thrift_dispatch_processor_process (/usr/lib64/libth= rift_c_glib.so.0+0xee53) > #9 0x7f1743d32d11 in thrift_simple_server_serve src/thrift/c_glib/server= /thrift_simple_server.c:58 > #10 0x7f1743d31b9a in thrift_server_serve src/thrift/c_glib/server/thrif= t_server.c:108 > #11 0x404113 in main /mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/c_gli= b_server.c:506 > #12 0x7f1742869872 in __libc_start_main (/usr/lib64/libc.so.6+0x23872) > #13 0x402a0d in _start (/mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/.l= ibs/tutorial_server+0x402a0d) > Indirect leak of 54 byte(s) in 1 object(s) allocated from: > #0 0x7f1744030f28 in __interceptor_realloc (/usr/lib64/libasan.so.5+0xef= f28) > #1 0x7f17429537d9 in __GI___vasprintf_chk (/usr/lib64/libc.so.6+0x10d7d9= ) > #2 0x7f17430c5a6c in g_vasprintf (/usr/lib64/libglib-2.0.so.0+0x93a6c) > #3 0x7f174309ecd0 in g_strdup_vprintf (/usr/lib64/libglib-2.0.so.0+0x6cc= d0) > #4 0x7f174306a365 in g_error_new_valist (/usr/lib64/libglib-2.0.so.0+0x3= 8365) > #5 0x7f174306a75e in g_set_error (/usr/lib64/libglib-2.0.so.0+0x3875e) > #6 0x7f1743d2df8e in thrift_server_socket_accept src/thrift/c_glib/trans= port/thrift_server_socket.c:147 > #7 0x7f1743d2d17d in thrift_server_transport_accept (/usr/lib64/libthrif= t_c_glib.so.0+0x1d17d) > #8 0x7f1743d3298a in thrift_simple_server_serve src/thrift/c_glib/server= /thrift_simple_server.c:42 > #9 0x7f1743d31b9a in thrift_server_serve src/thrift/c_glib/server/thrift= _server.c:108 > #10 0x404113 in main /mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/c_gli= b_server.c:506 > #11 0x7f1742869872 in __libc_start_main (/usr/lib64/libc.so.6+0x23872) > #12 0x402a0d in _start (/mnt/hgfs/share/thrift-0.13.0/tutorial/c_glib/.l= ibs/tutorial_server+0x402a0d) > =C2=A0 -- This message was sent by Atlassian Jira (v8.3.4#803005)