From patchwork Wed Jun 14 12:29:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 13279998 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC7A5EB64D9 for ; Wed, 14 Jun 2023 12:31:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244417AbjFNMbc (ORCPT ); Wed, 14 Jun 2023 08:31:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236369AbjFNMba (ORCPT ); Wed, 14 Jun 2023 08:31:30 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20606.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e8a::606]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 313CB26AC for ; Wed, 14 Jun 2023 05:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jxr5Q85Z/+gmyWQKw4SzctGt5ENeJrAD/AGstxQOnQBWid7/EY2z0hrqTDLCVDvI9RO/2zkfmre89dOQmChT27abheKrbDOhMIQlf5DzntxLoCH9g8ZSZIEGWFQJ/hsnj85kc+PWsiwwiDYnxriigKv7U9Sy4CWMW9uOEtxn67z4b+dc5aqMVRTr4YqwxabgZINxArzmr3WGN89oXWvyGKrbCFxGz71SQNSuWFG9weF/aoc24jVUZyQmI/jfftRVhXe+SyPUClVlds3Bo+ySKwkT0s2t4YWrXihyOxJc3HK53wopWb5dMrzbTwn/sOpS3FNZ0Mb3EtT2K3XmqCUc1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EbojeEM/28BeTeMcdx32bjkeLg/PCL2BII8ZV7iFbS8=; b=nxbelPVDXS4Mumhi91IHrgTU7RjECJIEkUYgRq+zIIoVkdftEnvcH4+LdbeVfSUAXUPioTMsEdLuxaRdX+DhC3qpufpzxw6uAkKESMAFKEpBFEeuAXAau2rc414skae1QOJdvg53FdkiUrlsfnlMzfelAJAYyrevrNI4FUsdkyQ/rS3Xa4I+zud+zPQRxpJS1XVtXyN8F+NvpIUtFpqUQpGe6InvBbn5PtfbM3FxjZFZccjXSHX37WRVGOpoZ2cismNEvhxYaiyAkUoRIBrVJMwRidHxJMcT32C1OQylsS5/Zkr/cEMtKo1A2vtczBmQtmsl9mFJrXTldV/JJwfnMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=infinera.com; dmarc=pass action=none header.from=infinera.com; dkim=pass header.d=infinera.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infinera.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EbojeEM/28BeTeMcdx32bjkeLg/PCL2BII8ZV7iFbS8=; b=X4nz1DoKM68uXv6wvHqQj5DWyCkyH1JM2o0fFZ8RiqIS+KSyGfmOWD63Y4gCjY0DK8Pn5BhCrube/iSyXTF05Z0h16/ZG30KkHyiL8A1N6qFA2Vt9R6m1vfxpT3cFl1T2QXBsl98xBsJZKnftsyUkVZSp2OgC3SRUD8FAlUPPywEXbX3xsdFbZdNXE/QFatkZ3s2tFDn1g3XB/QzXH1gypq8brx8ULWilWkUj2bi9WuAvcgVNa0lG91+oPCO0E3XB3HeEflKUnpNFChFmy8IQR8XxBPG7kE7hzdx59uTPPITlvAzVn09biP2pfOU4S68rYWDw9jsYPpZW+yWpQLc+w== Received: from PH0PR10MB4615.namprd10.prod.outlook.com (2603:10b6:510:36::24) by DS7PR10MB5215.namprd10.prod.outlook.com (2603:10b6:5:3a3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.37; Wed, 14 Jun 2023 12:29:44 +0000 Received: from PH0PR10MB4615.namprd10.prod.outlook.com ([fe80::f01a:585:8d6:3d3c]) by PH0PR10MB4615.namprd10.prod.outlook.com ([fe80::f01a:585:8d6:3d3c%7]) with mapi id 15.20.6477.037; Wed, 14 Jun 2023 12:29:43 +0000 From: Joakim Tjernlund To: "linux-bluetooth@vger.kernel.org" Subject: bluez SEGV in current master Thread-Topic: bluez SEGV in current master Thread-Index: AQHZnrvlRF4IgSCGUkSDIZGoqFv8fQ== Date: Wed, 14 Jun 2023 12:29:43 +0000 Message-ID: <6704ebbea9d1bb64e54b45b1b3d6cd321b28971b.camel@infinera.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Evolution 3.48.2 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=infinera.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR10MB4615:EE_|DS7PR10MB5215:EE_ x-ms-office365-filtering-correlation-id: 3d7e3a20-dbf7-414a-855f-08db6cd30814 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: D5xWzdAk4WTv1kk7MBD+eW7+izVBIH58oDnEAqUm0A9I+FctXHfHGfOw9RenmJp/fxEIs8ocfN895aG7QT+Dp8jJR67YQCzUsmkIsaDhm9cT/7yXBFRNBvyZ7yKtpG6JuwVfLh47LX2XBSPP+3StBpuHDh7rVImaH4SembTefvisCkdn7Crxw7gMa+lA5EI3hfQ/712G1UGjyWIxaOMRD2AuxtDodxZdvgW4A27Ou9mzCgFgpQjXGmlmto+mHcAiHsBgf95h2JYFPEUP520OipcwaO5h1siHHQ0KSd2UU19QaJOgZdjHjZcSwhj+46xncnsWg4q3u7YJhTXLzxn43R936gdu88cbafGRFXg0t4jB0kv8MvUwl1Dgz5Rk3Ph7wbX3h/3V7yhNSyO9UxyEDwoo+WYppxzbZcrG8AoxUgnSm/Y4OkuJNGleLDitHiGM1uArx7iwfAVN+cj+imU7GF00xoTFoDGJqmqEKiJByCXC2cfCHCbL9jr7zHEbmKNjCSDzadDAmxAER3hZ25gi5ns9w+ZE5NTCEFhrkDza/cTRmCv2pe1gaAlmVyueGESpO7S7GL6T9W3CW2HqzzWxiHxXHeF6C1u+gAMMjymuhud4J/upfZTGXmFFcMyrIXnW x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB4615.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(346002)(396003)(136003)(376002)(451199021)(83380400001)(5660300002)(186003)(6506007)(2906002)(2616005)(41300700001)(6512007)(8936002)(8676002)(6486002)(316002)(38070700005)(122000001)(36756003)(478600001)(38100700002)(86362001)(76116006)(66476007)(66556008)(64756008)(66946007)(6916009)(66446008)(91956017)(71200400001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?T7GpgJKhrrw4lt+QwvbLkI7eM27B?= =?utf-8?q?jrlNhoZ5yq3EPOKW4C25sTm9VD0nonmM26wTOGu14Kd9fDYvjk93MM6R/HW9CYjLi?= =?utf-8?q?h2TeFPg9puwG5IsP1KGEqALp1Ulcs9wjG6Omp8zNQdwo5ga46BYi7i9UmOcAmwGBs?= =?utf-8?q?h+UrFGX6TKDDZXGDbBqisZr8ZopMKZPwsYMuQba/TGpbucURn9jS6VCtcXgvtkIUz?= =?utf-8?q?wOrqE5mhUfaL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+nXDBBD4gaSmBiELBW2iV3VAB3rno7fRF?= =?utf-8?q?rcu7AWsgL2L1fIQWfb/O+5Asx+BnVYuVY0QflGDofiltVpQJqovrezHA5VH7FsMxm?= =?utf-8?q?3oVVd80ZZvFobkZhTvVt9dq4yZjJikMJ1vAv5biFgbafbBdOQRWAW4c1G0afddv3s?= =?utf-8?q?oX0yUKReej7rRi0vffSE2CrMkbYZAJ0NALmJE885XaniEGKzWVeUJX1YXLdA6m7gp?= =?utf-8?q?tT2gi+s5FtAIa5QSLBr0Ggtv1JuxCDQDPvU8akwOEcGDN03lOQEm/IANsSJKxZ0Qz?= =?utf-8?q?+hTNhRlA9aL4DrEuQ3fxpHGs+SHHypQvU4p3OPGh8SFZqFuTot6XQHZce8bai6Pp1?= =?utf-8?q?mlVX7dn7+dpiZUJO20QkKudfmoXAJGBWMQS7sdqJe4RwInmou95OGaKBWs65NLVz3?= =?utf-8?q?EHd4x1NVBFhmNcefmTCKnt3Hx4zZ/zPN6cFxt96zgyyiw7MT/LrRuQVNRWDvHwvQT?= =?utf-8?q?1bDJNa+XXuQ?= Content-ID: <6395BFF37A1CB94EAE3C64D9824E1B48@namprd10.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: infinera.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB4615.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d7e3a20-dbf7-414a-855f-08db6cd30814 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jun 2023 12:29:43.1912 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 285643de-5f5b-4b03-a153-0ae2dc8aaf77 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FLFH4TYBxyZE+50mvcxgC/ANpN8VtmAxkcqnekU7GBuPH+c1qVt+VwQ17CS2KqGEb3jOP+SQlnp04YU+MXqjbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5215 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org commit bap: Add broadcast source support, 3030883, in bluez.git A co-worker see this SEGV when connecting a headset: Jun 13 13:38:15 systemd-coredump[3941]: Process 1897 (bluetoothd) of user 0 dumped core. Module bluetoothd without build-id. #0 0x0000556bea93277a a2dp_resume_complete (bluetoothd + 0x3e77a) #1 0x0000556bea9210a2 finalize_resume (bluetoothd + 0x2d0a2) #2 0x0000556bea92afaf avdtp_start_resp (bluetoothd + 0x36faf) #6 0x0000556bea9dcc85 mainloop_run (bluetoothd + 0xe8c85) #7 0x0000556bea9dd0dc mainloop_run_with_signal (bluetoothd + 0xe90dc) #8 0x0000556bea91a4ef main (bluetoothd + 0x264ef) #11 0x0000556bea91ace1 _start (bluetoothd + 0x26ce1) Jun 13 13:38:15 systemd[1]: bluetooth.service: Main process exited, code=dumped, status=11/SEGV Crash seems to be at: 342 static void a2dp_resume_complete(struct avdtp *session, int err, 343 void *user_data) 344 { 345 struct media_owner *owner = user_data; 346 struct media_request *req = owner->pending; 347 struct media_transport *transport = owner->transport; 348 struct a2dp_sep *sep = media_endpoint_get_sep(transport->endpoint); A good start(but does NOT fix the problem) might be: bluez-5.66 Works fine though. Headset: WH-1000XM3 Jocke --- bluez-9999/profiles/audio/transport.c.org 2023-06-13 18:38:14.542137531 +0200 +++ bluez-9999/profiles/audio/transport.c 2023-06-13 18:48:32.542527882 +0200 @@ -345,7 +345,7 @@ struct media_owner *owner = user_data; struct media_request *req = owner->pending; struct media_transport *transport = owner->transport; - struct a2dp_sep *sep = media_endpoint_get_sep(transport->endpoint); + struct a2dp_sep *sep; struct avdtp_stream *stream; int fd; uint16_t imtu, omtu; @@ -355,7 +355,10 @@ if (err) goto fail; + if (!transport) + goto fail; + sep = media_endpoint_get_sep(transport->endpoint); stream = a2dp_sep_get_stream(sep); if (stream == NULL) goto fail;