Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp504163rdb; Thu, 15 Feb 2024 06:52:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXE5pXR5Y6x0aZfEY9ZhgbUPVJIVPX8dUwgw19XGjxu/07b30eJBC0b/dOryxRGbRB3V68nTqDNFKmYzG8ql9qRyZHyQYDW6/S6NUGgiQ== X-Google-Smtp-Source: AGHT+IGmeFgbbDhABfKjo1/QTrYSp0wwL/BmM1g8cHdprbBfndUwgu+R5Jevb5k0BkDWVzzZ1dRg X-Received: by 2002:a05:6a21:8ccc:b0:1a0:5f9b:9ec7 with SMTP id ta12-20020a056a218ccc00b001a05f9b9ec7mr7260323pzb.13.1708008770009; Thu, 15 Feb 2024 06:52:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708008769; cv=pass; d=google.com; s=arc-20160816; b=OeAePBv3vhc/SelTVwAH/d1dIpfFcXanL5FBY3RsI7ioO8L3mJpUCRO+xN6I/ZTSMC 1wkzCl7nDCujcoysvy740VKMmfu9CPz0PGUyzjYkw1wn/3SoNYhPz+Z1yLWPbqO8wpZl VuzqDS37n9TQGfGYFiruNGIhLJrrRHLTt2/N+N36U0gBooQzwvk6hbS/OdvvjhwXCWKz u+5nGKYbmzRGr6OCEDXJX9muOboVYPNkIeU/VfB85pF9uOV5WaxUP2/66TXHMjttWQwc AizutXtZJRPMPABtH6YAleLNcIa3H8g20j60qoUhosSYo1jjnOr2PKF85eLFtk0Z7QRR 1fJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=7P5XOQSjOOH/9SMenUqQtkrTkMFlFlHoOyp0fXtf7KI=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=xNLn32GnA+aNn1EQBoxs++VfcugrwxyY6A2oth6gzueplTHWfvVK88g2UrSxt0r+4Y 7Mz2nLs6x35VK66jVS/YQgV+/sarHohEzPkpl8KoMfhotPsYwxo4qRzEsYq/ZetSmJ6w 9ZrMmlcJtaLu3A08UyYkJzsUvKQHi56H2KWdDpJaSZUNd+O8yL8KmUSJxmus1LKUm6Af Z7CR4eyFJMRgPvoZgi95tJGuNzs6qBqV8IVrE/nVdBygYaXkcNL5oMQHTp6PO5wnGQyi 3HqXUUS0Rg9lwjryxoAz4auBVx6VtTFM/fWZqUDM8EmtsNHy1ZKtYNHt+SD+1H+bIkgK igvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QfwcIHjw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-1897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e4-20020a656784000000b005db918c79b2si1199905pgr.326.2024.02.15.06.52.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:52:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=QfwcIHjw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-1897-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1897-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2236E28BE31 for ; Thu, 15 Feb 2024 14:52:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B6D4132489; Thu, 15 Feb 2024 14:52:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QfwcIHjw" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com [209.85.222.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F8E7433B9 for ; Thu, 15 Feb 2024 14:52:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708008756; cv=none; b=NPM8IbxxTEtONtwPKTq82GbgZAUWG6xDO6sRDypYkxmHw8jXC/IKT/9BhHTvvBQBnhpqZH6kkXZeUDc8wnbhKTomAKNvWRBbpDf9LhcbDEKwJAdd4wrU+vv6UHmp8oHz7YgTjPUMgcjyVqTH4pEqd6upao550zZPYO4oTyiGoRE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708008756; c=relaxed/simple; bh=rs+xhSSPojzybdR+KRmx9baMEWRAskn9ddHXn06cgzo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ieh5DqKrWor6jvrej7ysHmIrGIwMZUWC+GmFjj547oRMpw/2v96evWgpsaoaGqGEslVDAss9u1Op6IUr/+OFAm82PcTR02vlAhkO5zRPHq8Z4OuzczdXg2y49OIqO39rAAMwOvCP0RHwxu2Yz8US4Z5afD2E1W/M0msd8g4wCFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QfwcIHjw; arc=none smtp.client-ip=209.85.222.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ua1-f50.google.com with SMTP id a1e0cc1a2514c-7d5c514944fso871096241.1 for ; Thu, 15 Feb 2024 06:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708008752; x=1708613552; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=7P5XOQSjOOH/9SMenUqQtkrTkMFlFlHoOyp0fXtf7KI=; b=QfwcIHjwRaXbhqcNVrqfkdncs+xwfT/qFsTtEIH4H80ObaaoFb8LbB0xbuTeAmGCSU GAp5ihCDtXk9TCnye/XXOtsNq7qI/lXAa8/oFGwygMM3pNzXHlGXsmSvVy2FeKM0dWVC k2242jCvvyIi53WFdHqOn6jEMkd3sb3pjJ2tVc/H5uWetQiSVjfXPT3B/2DO/Qmx9qF8 /ybaOKMF+umaEiBHtD0XzFDzqpBfoZkMolPJmDs1g2/fEFtaqj1mSo4uETVUiSHeipIJ /LRQ6Uw7dJrrutjwxwb94/OjbKJBBBx9jLlGLp2y9yxMchreQDRT6uX4oNslGm8XUSD2 qoHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708008752; x=1708613552; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7P5XOQSjOOH/9SMenUqQtkrTkMFlFlHoOyp0fXtf7KI=; b=bY82p4lskKZBYcV8bRNoVxXAfX5iWh8EB8yo7j0vBYSOzEOCZHYQao0xXI8zFoFZSV bN7bEXOYFMWmxJJDex6Y7QcMjR1sdYit1wxH0ze/KFnppGpOxcl2LwC1qYR1P9kCKQ5B ACg4JyttB7e10nV5S8wu0d9yPYwA1viGRJSaF1xRVD/ZWNZKoY3XU/7UPqshDftG+xht nfcwjI7twUpxe0eTaNZqKRaAAdrXuWUmW7Ax++V0PItFYgzE9nL1WbCUFtuMM/phuBMf bn4xkQ8L3lmPZzvSbKP6rXgT6Dj6JIIGe+vJv+9aX4eOMBc76SpqflF41Y9WMn6CNO4c PkCw== X-Gm-Message-State: AOJu0Yw5ifuyzI2pOrYvuBFRVoYIHYkhgmunkB/4DWdV2V9sHppk16U0 5VY2qZKcKzO/NAJE1x0Y26gSOdXN04T5MLTmUoCX/ORuUO3aQV9SvaDnQxxR X-Received: by 2002:a05:6102:236d:b0:46e:ba66:f40e with SMTP id o13-20020a056102236d00b0046eba66f40emr1306553vsa.10.1708008752100; Thu, 15 Feb 2024 06:52:32 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id a21-20020a05610222d500b0046d200fe950sm192806vsh.18.2024.02.15.06.52.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 06:52:30 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v1 2/2] rfcomm-tester: Fix crash on test-basic Date: Thu, 15 Feb 2024 09:52:27 -0500 Message-ID: <20240215145227.782554-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240215145227.782554-1-luiz.dentz@gmail.com> References: <20240215145227.782554-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz This fixes to following trace caused by not initializing data->io: AddressSanitizer:DEADLYSIGNAL ================================================================= ERROR: AddressSanitizer: SEGV on unknown address (pc 0x7f199c3a01c9 bp 0x7ffc26624a10 sp 0x7ffc26624a00 T0) The signal is caused by a READ memory access. Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn . #0 0x7f199c3a01c9 in g_io_channel_unref (/lib64/libglib-2.0.so.0+0x4d1c9) #1 0x5565f82fcece in test_post_teardown tools/rfcomm-tester.c:205 #2 0x5565f83939b3 in teardown_callback src/shared/tester.c:434 --- tools/rfcomm-tester.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/rfcomm-tester.c b/tools/rfcomm-tester.c index a9adf7f0f52d..b78b50537e4a 100644 --- a/tools/rfcomm-tester.c +++ b/tools/rfcomm-tester.c @@ -30,6 +30,7 @@ #include "src/shared/tester.h" #include "src/shared/mgmt.h" +#include "src/shared/util.h" struct test_data { struct mgmt *mgmt; @@ -815,9 +816,7 @@ static void test_server(const void *test_data) #define test_rfcomm(name, data, setup, func) \ do { \ struct test_data *user; \ - user = malloc(sizeof(struct test_data)); \ - if (!user) \ - break; \ + user = new0(struct test_data, 1); \ user->hciemu_type = HCIEMU_TYPE_BREDRLE52; \ user->test_data = data; \ user->io_id = 0; \ -- 2.43.0