Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9048412ybl; Fri, 17 Jan 2020 05:34:38 -0800 (PST) X-Google-Smtp-Source: APXvYqw7yleGO7j+t2kqwUI0XOfTLDmIU4Rnq7ozTo3vwxlfmq8KCjmknBKiv9rOzNPxXO/BW+eU X-Received: by 2002:a05:6830:145:: with SMTP id j5mr5845425otp.242.1579268078318; Fri, 17 Jan 2020 05:34:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579268078; cv=none; d=google.com; s=arc-20160816; b=mrQqERjhn/X7kODv/MZYCcqzB5eyP7O48WUvQR1sC0U6ps8CyiyjJ+gj69pyMzXkfM FvrHxX8N53mnawWt/NfGR9ar1XOOHUEg2azUXTj+W03JNqh8xxvSSES8gDIZgVZ6VIDL oTRfKAENg2IGF/WNDl4YRH05peuWTRhp2XgiROyjN6Qjo+Aa3P77bzFc5u4pOxK8gh23 A+k0jwZ76rMhDl1OFEPfB5d8Iau98PPp7N8TGTJnKVlypPZojZYMEJ0+Aq7k21PTb+31 0cDtTWEGmQytLEqfsMoGcVHpBZuR11v9cpPVBMcoeFQ5Yrr33UgwrBlndPm/6hadWbtu WHkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:date:from :dkim-signature; bh=BH6w80QxTdIP2HHzWV1JLbsVoRn3u0bYkHkZUerB7q0=; b=1HZ1NJ/ZZw2fYLi56ZjtZTH7nQtHdBs09lfPUsLyAr4xxpDdcZZiSGO2Wpdy4xob0K hvFPJ8UlK+O/dCWgUFXi2C4UWmvx7tYicn6Sp2+JmUZyjajqnfR+XHYDt0N54WHhN31c giDIjZvz5k9YDvu6uQ39pssOLZRwoeITBrKr1dN24CoF+XnH9B6VOx+/YUsYFehU/g9C 3rirdh1GnuB6KTUlCuV5IOT9n9TTj8xOFBgb3X4aI6bf4FUSv06GWsZobwslj+Qek3qK rjlJLE4fnNWF8RZr5+VBtdEExf/xIA1cM6yiKgNu63Q1PihtUWU1eWvgYj//iG2QmO3K +bCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=XxHlq2Hr; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h22si15684246otk.18.2020.01.17.05.34.09; Fri, 17 Jan 2020 05:34:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=XxHlq2Hr; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726688AbgAQNeH (ORCPT + 99 others); Fri, 17 Jan 2020 08:34:07 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33482 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbgAQNeG (ORCPT ); Fri, 17 Jan 2020 08:34:06 -0500 Received: by mail-wr1-f67.google.com with SMTP id b6so22768785wrq.0 for ; Fri, 17 Jan 2020 05:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=from:date:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=BH6w80QxTdIP2HHzWV1JLbsVoRn3u0bYkHkZUerB7q0=; b=XxHlq2HrtXJ4ywwA3gkdqpYxz3x4N0S6FaifZ7fNVZt2X/BHEgCmZyZi5zEYa3D9fs azElc6L3eQKardWGG3krKrZo8GPPNpyALhJfG1rj7ZTgdHktosYlCfEFyKmQ8fCXpGs3 603KtF6vFtV5uNp0sprU1HGpwWt4Jnm9tc66p0KQBLYzMp/kc8O/q+HaymaEsfDvU4IV O9ol1rST0UE70CXat+ahghPr6urJ16PxIGfFQf6XEKtWtp+az9DcHnjMVym5gQCB2Vfn y5iMTK6OWcy63hJdFzm2Fv5967eOK/RP5UJq+yuj60MOWrTpmvZ7OfaVKkOz93+6NT7x Xrpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=BH6w80QxTdIP2HHzWV1JLbsVoRn3u0bYkHkZUerB7q0=; b=VsWrwFB+2vCuAxpLtBljlM4cpSJaMuBEj5h0MsTsbjGK1S2unwFaAasKr4eNKj1CW/ joucIcob6dnJQiLhQMiffE7V3YdGNN1Ezygl0+s6YT2GSFhF4mBl7SvGsGS7nhbeSsOy njmaNTQlr5i25O44M934n1hCHcdSFjQ1JrLy+3FCsrSaHVQH3bwcU7bnZjYwqOPWLO7U 7NkIW46BlUIXfRwrTXwbGEK9CYa95FKAiSdH7z9TdCce4m44Bxid3Z/Kua+mRxKux88D w96SspOW5vMbzBYtxVCk2WGiExp+5ChtcSO/KhvDQtZfJRoXaPmfXKCak5mmoxCtMo8m Dp1g== X-Gm-Message-State: APjAAAXItbTmpTExMo2NDy5lsSOvXliWAUGQLGj74cvl4Osm9VmfrfcI 81VGLVFpKCDZYM3tl0hmVZbXxg== X-Received: by 2002:a05:6000:1052:: with SMTP id c18mr3041664wrx.268.1579268044819; Fri, 17 Jan 2020 05:34:04 -0800 (PST) Received: from mlowasrzechonek2133 ([217.153.94.18]) by smtp.gmail.com with ESMTPSA id c2sm34173581wrp.46.2020.01.17.05.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 05:34:03 -0800 (PST) From: "=?utf-8?Q?Micha=C5=82?= Lowas-Rzechonek" X-Google-Original-From: =?utf-8?Q?Micha=C5=82?= Lowas-Rzechonek Date: Fri, 17 Jan 2020 14:34:02 +0100 To: Brian Gix Cc: linux-bluetooth@vger.kernel.org, inga.stotland@intel.com Subject: Re: [PATCH BlueZ] mesh: Offload loopback packets to l_idle_onshot() Message-ID: <20200117133402.jvnrhoect6olamtk@mlowasrzechonek2133> Mail-Followup-To: Brian Gix , linux-bluetooth@vger.kernel.org, inga.stotland@intel.com References: <20200117071604.20675-1-brian.gix@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200117071604.20675-1-brian.gix@intel.com> User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Brian, On 01/16, Brian Gix wrote: > Any packet that may be handled internally by the daemon must be sent in > it's own idle_oneshot context, to prevent multiple nodes from handling > and responding in the same context, eventually corrupting memory. > > This addresses the following crash: > Program terminated with signal SIGSEGV, Segmentation fault. > 0 tcache_get (tc_idx=0) at malloc.c:2951 > 2951 tcache->entries[tc_idx] = e->next; > (gdb) bt > 0 tcache_get (tc_idx=0) at malloc.c:2951 > 1 __GI___libc_malloc (bytes=bytes@entry=16) at malloc.c:3058 > 2 0x0000564cff9bc1de in l_malloc (size=size@entry=16) at ell/util.c:62 > 3 0x0000564cff9bd46b in l_queue_push_tail (queue=0x564d000c9710, data=data@entry=0x564d000d0d60) at ell/queue.c:136 > 4 0x0000564cff9beabd in idle_add (callback=callback@entry=0x564cff9be4e0 , user_data=user_data@entry=0x564d000d4700, > flags=flags@entry=268435456, destroy=destroy@entry=0x564cff9be4c0 ) at ell/main.c:292 > 5 0x0000564cff9be5f7 in l_idle_oneshot (callback=callback@entry=0x564cff998bc0 , user_data=user_data@entry=0x564d000d83f0, > destroy=destroy@entry=0x0) at ell/idle.c:144 > 6 0x0000564cff998326 in send_tx (io=, info=0x7ffd035503f4, data=, len=) > at mesh/mesh-io-generic.c:637 > 7 0x0000564cff99675a in send_network_beacon (key=0x564d000cfee0) at mesh/net-keys.c:355 > 8 snb_timeout (timeout=0x564d000dd730, user_data=0x564d000cfee0) at mesh/net-keys.c:364 > 9 0x0000564cff9bdca2 in timeout_callback (fd=, events=, user_data=0x564d000dd730) at ell/timeout.c:81 > 10 timeout_callback (fd=, events=, user_data=0x564d000dd730) at ell/timeout.c:70 > 11 0x0000564cff9bedcd in l_main_iterate (timeout=) at ell/main.c:473 > 12 0x0000564cff9bee7c in l_main_run () at ell/main.c:520 > 13 l_main_run () at ell/main.c:502 > 14 0x0000564cff9bf08c in l_main_run_with_signal (callback=, user_data=0x0) at ell/main.c:642 > 15 0x0000564cff994b64 in main (argc=, argv=0x7ffd03550668) at mesh/main.c:268 Hm. I can't seem to wrap my head around this backtrace. Do you maybe have a reproduction path? -- Michał Lowas-Rzechonek Silvair http://silvair.com Jasnogórska 44, 31-358 Krakow, POLAND