From patchwork Sun Jun 7 13:34:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Przemys=C5=82aw_Fierek?= X-Patchwork-Id: 11591549 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C96FD739 for ; Sun, 7 Jun 2020 13:34:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 826E620663 for ; Sun, 7 Jun 2020 13:34:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=silvair-com.20150623.gappssmtp.com header.i=@silvair-com.20150623.gappssmtp.com header.b="oO74wrIG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726536AbgFGNeq (ORCPT ); Sun, 7 Jun 2020 09:34:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726522AbgFGNep (ORCPT ); Sun, 7 Jun 2020 09:34:45 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2E59C08C5C2 for ; Sun, 7 Jun 2020 06:34:44 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id x18so718196lji.1 for ; Sun, 07 Jun 2020 06:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-language; bh=arPQqpZ4J5CJL7kf1Df1N0NF9F132QxvEUodblLo484=; b=oO74wrIGEUAX9AJKgx4mg8NPP55SgF9DZXlhg3sHq8rsLr0hWtQJb3ODVBGw8vQrSU Hf62ydACVFfgeFsrdBItBiCobBTjbNPGzZSMpnHXeh/nC7pe+3qI+Bkb63E4BfchMGj9 CQ3EjhsviZ//NR9krerNkMs5c1eAsQPBWum7XILKHRwy/wJbHNPdU9JPc5lQmtD39xPI clpWhgYJN9Q07ANIiV/AKu9VOb1m+PctnPiqTedElRF4N0ntMXNa+oi7CHN/TDKeI/9q ZsTcW9yuahK+6nbsbfhbbPNUQDnKpDDsb+GEnVPd5SUxlmmrRXR9Fbe3kBGZoUACGWoR XDPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-language; bh=arPQqpZ4J5CJL7kf1Df1N0NF9F132QxvEUodblLo484=; b=skVaWGxswAY4aCyX8Az3srZBgLYfGcpBhQOSxWBwRDeolqo9GNWVxDsLT05o2CPzl8 inE5mhxStRCt4MXdfbjkbG//2M3rpO/+vFvsWrJPyG1xSjWoYahxMPwg6pRgIYxnt6/P CcylLGOREu9g0+mBIQjfG4ioyQW5HpBdBXQ38bUrLw4vpOd+bFDI30/RJ66NA86lMmp4 oEfezLVITecQKfN6DVuyhWoEGqZEOpLdkUnOvC76zO9kX2kEHQ8678i4gv0O7O49PLQ5 uKL2TDWgXE9AKzNGxkKZcNKFix8RJDY89r9c9x8ad9/vqyGAE2M1r3sk9xeaMKwbLOFO nKVQ== X-Gm-Message-State: AOAM531H35bT35nJgl98njd1FgHxQ0XL3p+GoZgesJAYg/LwvFCAxxhA UOvwrTPfswnrlgse2pYcRjbhyvgkFUo= X-Google-Smtp-Source: ABdhPJwMo1FpTVVgP4O3yLvtBQa72CnSp3tJsVZBjVkX4hTRInALct+WrCdgnr/gLD73yxytI9bkIQ== X-Received: by 2002:a2e:8e27:: with SMTP id r7mr8802102ljk.382.1591536881465; Sun, 07 Jun 2020 06:34:41 -0700 (PDT) Received: from [192.168.65.55] (174.60.citypartner.pl. [195.210.60.174]) by smtp.gmail.com with ESMTPSA id u9sm3373831ljd.9.2020.06.07.06.34.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Jun 2020 06:34:40 -0700 (PDT) From: =?utf-8?q?Przemys=C5=82aw_Fierek?= Subject: Segmentation fault in the mesh/node.c To: Brian Gix Cc: inga.stotland@intel.com, linux-bluetooth@vger.kernel.org Message-ID: <116e6cc1-5a49-a833-689b-4f00880e455b@silvair.com> Date: Sun, 7 Jun 2020 15:34:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi, After rebase on the latest BlueZ version our functional tests failed on SEGV in the `node.c` file. Seems that call two D-Bus functions `join` and `leave` one after the other (before receive `join_complete`) causes SEGV. In the attached files there is the backtrace and the diff with my changes (adds extra some logs). Best regards, Przemysław Fierek 11:58:15 =================================== FAILURES =================================== 11:58:15 _______________________ test_remove_storage_after_leave ________________________ 11:58:15 11:58:15 application = ._Application object at 0x7f0cf3fb1050> 11:58:15 meshd = 11:58:15 node_storage = .NodeStorage'> 11:58:15 11:58:15 async def test_remove_storage_after_leave(application, meshd, node_storage): 11:58:15 await application.import_node() 11:58:15 11:58:15 assert application.token_ring.token 11:58:15 11:58:15 with node_storage() as storage, node_storage(backup=True) as backup: 11:58:15 assert storage["token"] == application.token_ring.token 11:58:15 assert backup["token"] == application.token_ring.token 11:58:15 11:58:15 > await application.leave() 11:58:15 11:58:15 bluez_tests/test_storage.py:230: 11:58:15 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 11:58:15 /usr/local/lib/python3.7/dist-packages/bluetooth_mesh/application.py:721: in leave 11:58:15 await self.network_interface.leave(self.token_ring.token) 11:58:15 /usr/local/lib/python3.7/dist-packages/bluetooth_mesh/interfaces.py:309: in leave 11:58:15 await self._interface.call_leave(token) 11:58:15 /usr/local/lib/python3.7/dist-packages/dbus_next/aio/proxy_object.py:79: in method_fn 11:58:15 BaseProxyInterface._check_method_return(msg, intr_method.out_signature) 11:58:15 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 11:58:15 11:58:15 msg = , signature = '' 11:58:15 11:58:15 @staticmethod 11:58:15 def _check_method_return(msg, signature=None): 11:58:15 if msg.message_type == MessageType.ERROR: 11:58:15 > raise DBusError._from_message(msg) 11:58:15 E dbus_next.errors.DBusError: Message recipient disconnected from message bus without replying 11:58:15 11:58:15 /usr/local/lib/python3.7/dist-packages/dbus_next/proxy_object.py:59: DBusError 11:58:15 ------------------------------ Captured log setup ------------------------------ 11:58:15 09:58:06.319 asyncio DEBUG Using selector: EpollSelector 11:58:15 09:58:06.393 MESHD INFO Starting: ['gosu', 'root', 'env', 'SEGFAULT_SIGNALS=abrt segv fpe', 'LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so', '/usr/libexec/bluetooth/bluetooth-meshd', '--config=/tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config', '--io=tcpserver:65254', '--debug'] 11:58:15 09:58:06.402 MESHD.stderr INFO 2020-06-05 09:58:06.399 main.c:126 ready_callback D-Bus ready 11:58:15 09:58:06.402 MESHD.stderr INFO 2020-06-05 09:58:06.399 main.c:107 request_name_callback Request name success 11:58:15 09:58:06.402 MESHD.stderr INFO 2020-06-05 09:58:06.399 mesh.c:276 mesh_init Loading node configuration from /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config 11:58:15 09:58:06.403 MESHD INFO Started 11:58:15 09:58:06.406 APPLICATION INFO Elements: {} 11:58:15 09:58:06.407 APPLICATION DEBUG Connecting to D-Bus 11:58:15 09:58:06.409 MESHD.stderr INFO 2020-06-05 09:58:06.403 mesh-io-tcpserver.c:435 tls_ctx_init TLS initialization: done 11:58:15 09:58:06.409 MESHD.stderr INFO 2020-06-05 09:58:06.403 mesh-io-tcpserver.c:234 get_fd_info Server bind -> addr:0.0.0.0 port:65254 fd:6 11:58:15 09:58:06.409 MESHD.stderr INFO 2020-06-05 09:58:06.403 mesh-io-tcpserver.c:580 tcpserver_io_init Started mesh on tcp port 65254 11:58:15 09:58:06.409 MESHD.stderr INFO 2020-06-05 09:58:06.403 mesh.c:296 mesh_init mesh/mesh.c:mesh_init() io 0x56413d49e9c0 11:58:15 09:58:06.410 MESHD.stderr INFO 2020-06-05 09:58:06.404 mesh.c:881 mesh_dbus_init Added Network Interface on /org/bluez/mesh 11:58:15 09:58:06.418 APPLICATION INFO Connecting to org.bluez.mesh 11:58:15 09:58:06.425 APPLICATION INFO Registering application 11:58:15 ------------------------------ Captured log call ------------------------------- 11:58:15 09:58:06.434 APPLICATION WARNING Import 83bf3b46-8103-45a2-8bcc-e70d8d0b46d3 11:58:15 09:58:06.436 MESHD.stderr INFO 2020-06-05 09:58:06.435 mesh.c:778 import_call mesh/mesh.c:import_call() Import local node request 11:58:15 09:58:06.437 MESHD.stderr INFO 2020-06-05 09:58:06.435 node.c:1720 node_import mesh/node.c:node_import() 11:58:15 09:58:06.437 MESHD.stderr INFO 2020-06-05 09:58:06.435 node.c:267 node_new new elements: 0x56413d4ca930 11:58:15 09:58:06.438 MESHD.stderr INFO 2020-06-05 09:58:06.438 node.c:1283 get_app_properties mesh/node.c:get_app_properties() path /com/silvair/application 11:58:15 09:58:06.438 MESHD.stderr INFO 2020-06-05 09:58:06.438 node.c:1129 get_element_properties mesh/node.c:get_element_properties() path /com/silvair/application/element0 11:58:15 09:58:06.439 MESHD.stderr INFO 2020-06-05 09:58:06.438 node.c:1214 convert_node_to_storage db_node->elements 0x56413d4c9840 11:58:15 09:58:06.440 MESHD.stderr INFO 2020-06-05 09:58:06.438 mesh-config-json.c:1706 mesh_config_create mesh/mesh-config-json.c:mesh_config_create() New node config /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3/node.json 11:58:15 09:58:06.450 MESHD.stderr INFO 2020-06-05 09:58:06.450 net-keys.c:493 net_key_beacon_refresh mesh/net-keys.c:net_key_beacon_refresh() Setting SNB: IVI: 00000000, IVU: 0, KR: 0 11:58:15 09:58:06.451 MESHD.stderr INFO 2020-06-05 09:58:06.450 util.c:52 print_packet mesh/util.c:print_packet() 51086.450 Set SNB Beacon to: 2b01003ecaff672f67337000000000a502cffc80248d4c 11:58:15 09:58:06.451 MESHD.stderr INFO 2020-06-05 09:58:06.450 mesh-config-json.c:565 mesh_config_net_key_add mesh/mesh-config-json.c:mesh_config_net_key_add() netKey 0000 11:58:15 09:58:06.451 MESHD.stderr INFO 2020-06-05 09:58:06.451 net.c:778 mesh_net_set_friend_mode mesh/net.c:mesh_net_set_friend_mode() mesh_net_set_friend_mode - 0 11:58:15 09:58:06.452 MESHD.stderr INFO 2020-06-05 09:58:06.451 net.c:292 trigger_heartbeat mesh/net.c:trigger_heartbeat() trigger_heartbeat: 0001 --> 0 11:58:15 09:58:06.453 MESHD.stderr INFO 2020-06-05 09:58:06.453 cfgmod-server.c:1263 cfgmod_server_init mesh/cfgmod-server.c:cfgmod_server_init() 00 11:58:15 09:58:06.454 MESHD.stderr INFO 2020-06-05 09:58:06.453 mesh.c:712 create_node_ready_cb mesh/mesh.c:create_node_ready_cb() Calling JoinComplete (create) 11:58:15 09:58:06.461 STORAGE INFO /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3/node.json 11:58:15 09:58:06.468 STORAGE INFO /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3/node.json.bak 11:58:15 09:58:06.474 APPLICATION INFO Leave 11:58:15 09:58:06.475 MESHD.stderr INFO 2020-06-05 09:58:06.475 mesh.c:659 leave_call mesh/mesh.c:leave_call() Leave 11:58:15 09:58:06.475 MESHD.stderr INFO 2020-06-05 09:58:06.475 mesh-config-json.c:2329 mesh_config_destroy_nvm mesh/mesh-config-json.c:mesh_config_destroy_nvm() Delete node config /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3 11:58:15 09:58:06.476 MESHD.stderr INFO 2020-06-05 09:58:06.476 util.c:151 del_fobject mesh/util.c:del_fobject() RM /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3/node.json.bak 11:58:15 09:58:06.477 MESHD.stderr INFO 2020-06-05 09:58:06.476 util.c:151 del_fobject mesh/util.c:del_fobject() RM /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3/node.json 11:58:15 09:58:06.477 MESHD.stderr INFO 2020-06-05 09:58:06.476 util.c:145 del_fobject mesh/util.c:del_fobject() RMDIR /tmp/pytest-of-user/pytest-0/test_remove_storage_after_leav0/config/83bf3b46810345a28bcce70d8d0b46d3 11:58:15 09:58:06.477 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:296 free_node_dbus_resources Node: 0x56413d4cadb0 11:58:15 09:58:06.477 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:306 free_node_dbus_resources elements: 0x56413d4ca930 11:58:15 09:58:06.478 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:278 free_element_path el: 0x56413d49f3d0, path: 0x56413d4cac50 11:58:15 09:58:06.478 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:343 free_node_resources log1 11:58:15 09:58:06.478 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:345 free_node_resources log2 11:58:15 09:58:06.479 MESHD.stderr INFO 2020-06-05 09:58:06.476 node.c:347 free_node_resources log3 11:58:15 09:58:06.479 MESHD.stderr INFO 2020-06-05 09:58:06.477 node.c:353 free_node_resources log4 11:58:15 09:58:06.479 MESHD.stderr INFO 2020-06-05 09:58:06.477 node.c:2414 node_finalize_new_node Nnnnode: 0x56413d4cadb0 11:58:15 09:58:06.479 MESHD.stderr INFO 2020-06-05 09:58:06.477 node.c:296 free_node_dbus_resources Node: 0x56413d4cadb0 11:58:15 09:58:06.480 MESHD.stderr INFO 2020-06-05 09:58:06.477 node.c:306 free_node_dbus_resources elements: 0x56413d498010 11:58:15 09:58:06.480 MESHD.segfault INFO *** Segmentation fault 11:58:15 09:58:06.480 MESHD.registers DEBUG Register dump: 11:58:15 09:58:06.480 MESHD.registers DEBUG 11:58:15 09:58:06.481 MESHD.registers DEBUG RAX: 0000000000000000 RBX: 0005000600070007 RCX: 0000000000000000 11:58:15 09:58:06.481 MESHD.registers DEBUG RDX: 0000000000000000 RSI: 000056413c31ba70 RDI: 000056413d498010 11:58:15 09:58:06.481 MESHD.registers DEBUG RBP: 000056413c31ba70 R8 : 0000000000000019 R9 : 0000000000000019 11:58:15 09:58:06.481 MESHD.registers DEBUG R10: 000056413c37a2ae R11: 0000000000000246 R12: 0000000000000000 11:58:15 09:58:06.482 MESHD.registers DEBUG R13: 000056413d4cdf20 R14: 000056413d49e1a0 R15: 0000000000000001 11:58:15 09:58:06.482 MESHD.registers DEBUG RSP: 00007ffc556d92b0 11:58:15 09:58:06.482 MESHD.registers DEBUG 11:58:15 09:58:06.482 MESHD.registers DEBUG RIP: 000056413c347330 EFLAGS: 00010202 11:58:15 09:58:06.483 MESHD.registers DEBUG 11:58:15 09:58:06.483 MESHD.registers DEBUG CS: 0033 FS: 0000 GS: 0000 11:58:15 09:58:06.483 MESHD.registers DEBUG 11:58:15 09:58:06.483 MESHD.registers DEBUG Trap: 0000000d Error: 00000000 OldMask: 00004002 CR2: 00000000 11:58:15 09:58:06.484 MESHD.registers DEBUG 11:58:15 09:58:06.484 MESHD.registers DEBUG FPUCW: 0000037f FPUSW: 00000000 TAG: 00000000 11:58:15 09:58:06.484 MESHD.registers DEBUG RIP: 00000000 RDP: 00000000 11:58:15 09:58:06.484 MESHD.registers DEBUG 11:58:15 09:58:06.485 MESHD.registers DEBUG ST(0) 0000 0000000000000000 ST(1) 0000 0000000000000000 11:58:15 09:58:06.485 MESHD.registers DEBUG ST(2) 0000 0000000000000000 ST(3) 0000 0000000000000000 11:58:15 09:58:06.485 MESHD.registers DEBUG ST(4) 0000 0000000000000000 ST(5) 0000 0000000000000000 11:58:15 09:58:06.485 MESHD.registers DEBUG ST(6) 0000 0000000000000000 ST(7) 0000 0000000000000000 11:58:15 09:58:06.486 MESHD.registers DEBUG mxcsr: 1f80 11:58:15 09:58:06.486 MESHD.registers DEBUG XMM0: 00000000000000000000000000ffff00 XMM1: 00000000000000000000000000ffff00 11:58:15 09:58:06.486 MESHD.registers DEBUG XMM2: 00000000000000000000000000ffff00 XMM3: 00000000000000000000000000ffff00 11:58:15 09:58:06.486 MESHD.registers DEBUG XMM4: 00000000000000000000000000ffff00 XMM5: 00000000000000000000000000ffff00 11:58:15 09:58:06.487 MESHD.registers DEBUG XMM6: 00000000000000000000000000ffff00 XMM7: 00000000000000000000000000ffff00 11:58:15 09:58:06.487 MESHD.registers DEBUG XMM8: 00000000000000000000000000ffff00 XMM9: 00000000000000000000000000ffff00 11:58:15 09:58:06.487 MESHD.registers DEBUG XMM10: 00000000000000000000000000ffff00 XMM11: 00000000000000000000000000ffff00 11:58:15 09:58:06.487 MESHD.registers DEBUG XMM12: 00000000000000000000000000ffff00 XMM13: 00000000000000000000000000ffff00 11:58:15 09:58:06.487 MESHD.registers DEBUG XMM14: 00000000000000000000000000ffff00 XMM15: 00000000000000000000000000ffff00 11:58:15 09:58:06.488 MESHD.registers DEBUG 11:58:15 09:58:06.489 MESHD.backtrace INFO Backtrace: 11:58:15 09:58:06.509 MESHD.backtrace INFO l_queue_foreach /home/user/bluez/ell/queue.c:441 (discriminator 3) 11:58:15 09:58:06.510 MESHD.backtrace DEBUG 439: 11:58:15 09:58:06.510 MESHD.backtrace DEBUG 440: for (entry = queue->head; entry; entry = entry->next) 11:58:15 09:58:06.511 MESHD.backtrace DEBUG 441: function(entry->data, user_data); diff --git a/mesh/node.c b/mesh/node.c index db888d27c..bc7151621 100644 --- a/mesh/node.c +++ b/mesh/node.c @@ -264,6 +264,7 @@ static struct mesh_node *node_new(const uint8_t uuid[16]) node = l_new(struct mesh_node, 1); node->net = mesh_net_new(node); node->elements = l_queue_new(); + l_info("new elements: %p", node->elements); memcpy(node->uuid, uuid, sizeof(node->uuid)); set_defaults(node); @@ -274,8 +275,11 @@ static void free_element_path(void *a, void *b) { struct node_element *element = a; + l_info("el: %p, path: %p", element, element->path); + l_free(element->path); element->path = NULL; + } static void element_free(void *data) @@ -289,6 +293,8 @@ static void element_free(void *data) static void free_node_dbus_resources(struct mesh_node *node) { + l_info("Node: %p", node); + if (!node) return; @@ -297,6 +303,8 @@ static void free_node_dbus_resources(struct mesh_node *node) node->disc_watch = 0; } + l_info("elements: %p", node->elements); + l_queue_foreach(node->elements, free_element_path, NULL); l_free(node->owner); node->owner = NULL; @@ -332,12 +340,17 @@ static void free_node_resources(void *data) /* Free dynamic resources */ free_node_dbus_resources(node); + l_info("log1"); l_queue_destroy(node->elements, element_free); + l_info("log2"); + node->elements = NULL; + l_info("log3"); mesh_agent_remove(node->agent); mesh_config_release(node->cfg); mesh_net_free(node->net); l_free(node->storage_dir); l_free(node); + l_info("log4"); } /* @@ -1198,6 +1211,7 @@ static void convert_node_to_storage(struct mesh_node *node, db_node->seq_number = node->seq_number; db_node->elements = l_queue_new(); + l_info("db_node->elements %p", db_node->elements); entry = l_queue_get_entries(node->elements); @@ -1354,6 +1368,8 @@ static bool add_local_node(struct mesh_node *node, uint16_t unicast, bool kr, update_net_settings(node); + mesh_config_save(node->cfg, true, NULL, NULL); + /* Initialize configuration server model */ cfgmod_server_init(node, PRIMARY_ELE_IDX); @@ -2352,6 +2411,8 @@ void node_finalize_new_node(struct mesh_node *node, struct mesh_io *io) if (!node) return; + l_info("Nnnnode: %p", node); + free_node_dbus_resources(node); mesh_agent_remove(node->agent);