Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1576564rwb; Fri, 28 Jul 2023 11:25:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlE0fRc60EirbkaJdesTR7hPOanFFWhe+39zpLsu1H4vKjwVVxAjvkHds/vG2ODWRgN9oCFO X-Received: by 2002:a17:906:208d:b0:99b:c689:3f3d with SMTP id 13-20020a170906208d00b0099bc6893f3dmr160559ejq.25.1690568708548; Fri, 28 Jul 2023 11:25:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690568708; cv=none; d=google.com; s=arc-20160816; b=VYrEnAdErNqxJ9PTvw/H1qIWCZ2OXHa2tu8U8v4ZLJ8ppNaGILmv5ZHCnZQlg9ZKyq J1L1t4nI54MlcnS6m4rwAi1bQQI5y+nmY8Lf5/a/ZkYjjk9qgoQAic8akyTG3wSHK3b1 POIw/mBWZbjMYWz283rgw6UBfnhFU/Iky5fpb3Jizmskt56XYFESk2PMhMNFqw/RrgZJ xuf3mhCd09IkrycfsjRLnpWNk4PG1dHQOe7FDPbHA8oM0fMO7MCAcT2Iv/5RIrL2mpm7 4DEs24LrvO1P6vGTROrgDtPMnxYVYWvlu1RYnEDbodT9Yth0kCVn8abjvQytnvDp63xN b0Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=aklSTLsAdsXkyztpg3+XAijGiHhtrBrXRWs6NCnGTzA=; fh=yezkxCkiqpBPr8yBRZrDQi+teCYyTP8ee6f0p0Ng5l0=; b=HanWppuZ3Q3LsdhCU+MmvC8L/vEDwcyQp95/bDns1CXAT3CNWWNzFZLXpcE0lFXuZz FvWDIlQ9UlP7ugQpxYq3lzccTYwlHZZK4r6ukQbRfJKNjcuPjD0VJnD5X72BuKh8eS4W yXFCkm2V+Q5OejVFiZYk98z2ro7CnDuZ4qQcNQ6S3/mWFOU7vQj0+Ci9Pvcm/8nXAtoN 5zKOhcZh9UXTQDBYZylbq2OO1oLcdPBk+gVQ+vHymRTR0+byz+9Yv8HS2hDFEQxIXALw lyzaGIpu2o0WJYT19zHnZy1GmSFjnL00tIFLuXkN6ETPv1MaLVnHBWXsAC9Y79eBztIR bjlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=QMjtYfC7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170906915100b009928b4e3b9esi3199699ejw.313.2023.07.28.11.24.44; Fri, 28 Jul 2023 11:25:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=QMjtYfC7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233437AbjG1ReC (ORCPT + 99 others); Fri, 28 Jul 2023 13:34:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230154AbjG1Rd7 (ORCPT ); Fri, 28 Jul 2023 13:33:59 -0400 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFBD82D7E for ; Fri, 28 Jul 2023 10:33:55 -0700 (PDT) Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-348dfefd2d6so2047145ab.1 for ; Fri, 28 Jul 2023 10:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1690565635; x=1691170435; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=aklSTLsAdsXkyztpg3+XAijGiHhtrBrXRWs6NCnGTzA=; b=QMjtYfC7c2iyLJqTyd1kyafeb3BFunFp/e0culOjRU9ewmtqiQ4hxbF1scOqd3i0Jj ZGKAYORniatq226NZVw52IdIFsPXH6D4AgOL4VxvR5HQA4k1CDjlYbf0k7yQ//pxSq+N oYHy/AKA2e9M48Te7g19hPAlbx9bQS/hl26ik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690565635; x=1691170435; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aklSTLsAdsXkyztpg3+XAijGiHhtrBrXRWs6NCnGTzA=; b=lb24ZqK+14uhsG4gxOFVUVAjiOPDgCMSnGlb4yyoQPrKNwHn6skIURNwYK5gXpdyoc 2rUpwVQohiSVAr0LtqCZZOT7/pf0nC0Z295ggoHmQCqWFBrSN8qHUfXu2tUGR6zRbkej tAmVksxsljMiU9qA5jN2UCLo0JeVVWWo0gd1An25zixQlOKMFqeisDZBZIAzqZjDKP32 cV8DxP/OcGsgW9F4ooBil/Whn5Pw5329gv8oSiu0ZR2jocY2lfrLDGui0zVBbBJ59XK6 uzrNRnmGQiqIzRwD1X0CYh/63LhEZ1MfBU27qcgnBl/0oDziqilh+CDVqLXQEmsb2dsr L1nQ== X-Gm-Message-State: ABy/qLZp1wl0YdYQAhXsDVhe2jCG9BfZhjKuMF0dw/3J/j30hEIWEJma 3R6P/Dudr70NtvCEDjXD6Zc57g== X-Received: by 2002:a92:d38d:0:b0:348:ec3f:fce1 with SMTP id o13-20020a92d38d000000b00348ec3ffce1mr247599ilo.0.1690565635234; Fri, 28 Jul 2023 10:33:55 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id p11-20020a92da4b000000b00345d00dc3fdsm1322646ilq.78.2023.07.28.10.33.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jul 2023 10:33:54 -0700 (PDT) Message-ID: Date: Fri, 28 Jul 2023 11:33:54 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: selftests: connector: proc_filter.c:48:20: error: invalid application of 'sizeof' to an incomplete type 'struct proc_input' Content-Language: en-US To: Anjali Kulkarni , Jakub Kicinski Cc: Naresh Kamboju , "open list:KERNEL SELFTEST FRAMEWORK" , open list , "lkft-triage@lists.linaro.org" , Netdev , clang-built-linux , Shuah Khan , Anders Roxell , "David S. Miller" , Liam Howlett , Shuah Khan References: <799d6088-e28f-f386-6a00-2291304171a2@linuxfoundation.org> From: Shuah Khan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/27/23 19:38, Anjali Kulkarni wrote: > > >> On Jul 27, 2023, at 5:43 PM, Shuah Khan wrote: >> >> On 7/27/23 11:34, Anjali Kulkarni wrote: >>>> On Jul 25, 2023, at 9:48 AM, Anjali Kulkarni wrote: >>>> >>>> >>>> >>>>> On Jul 25, 2023, at 6:05 AM, Naresh Kamboju wrote: >>>>> >>>>> selftests: connector: proc_filter build failed with clang-16 due to below >>>>> warnings / errors on Linux next-20230725. >>>>> >>>>> Reported-by: Linux Kernel Functional Testing >>>>> >>>>> clang --target=aarch64-linux-gnu -fintegrated-as >>>>> -Werror=unknown-warning-option -Werror=ignored-optimization-argument >>>>> -Werror=option-ignored -Werror=unused-command-line-argument >>>>> --target=aarch64-linux-gnu -fintegrated-as -Wall proc_filter.c -o >>>>> /home/tuxbuild/.cache/tuxmake/builds/1/build/kselftest/connector/proc_filter >>>>> proc_filter.c:42:12: error: invalid application of 'sizeof' to an >>>>> incomplete type 'struct proc_input' >>>>> char buff[NL_MESSAGE_SIZE]; >>>>> ^~~~~~~~~~~~~~~ >>>>> proc_filter.c:22:5: note: expanded from macro 'NL_MESSAGE_SIZE' >>>>> sizeof(struct proc_input)) >>>>> ^ ~~~~~~~~~~~~~~~~~~~ >>>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input' >>>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE' >>>>> sizeof(struct proc_input)) >>>>> ^ >>>>> proc_filter.c:48:20: error: invalid application of 'sizeof' to an >>>>> incomplete type 'struct proc_input' >>>>> hdr->nlmsg_len = NL_MESSAGE_SIZE; >>>>> ^~~~~~~~~~~~~~~ >>>>> proc_filter.c:22:5: note: expanded from macro 'NL_MESSAGE_SIZE' >>>>> sizeof(struct proc_input)) >>>>> ^ ~~~~~~~~~~~~~~~~~~~ >>>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input' >>>>> char buff[NL_MESSAGE_SIZE]; >>>>> ^ >>>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE' >>>>> sizeof(struct proc_input)) >>>>> ^ >>>>> proc_filter.c:64:14: error: invalid application of 'sizeof' to an >>>>> incomplete type 'struct proc_input' >>>>> msg->len = sizeof(struct proc_input); >>>>> ^ ~~~~~~~~~~~~~~~~~~~ >>>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input' >>>>> char buff[NL_MESSAGE_SIZE]; >>>>> ^ >>>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE' >>>>> sizeof(struct proc_input)) >>>>> ^ >>>>> proc_filter.c:65:35: error: incomplete definition of type 'struct proc_input' >>>>> ((struct proc_input *)msg->data)->mcast_op = >>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ >>>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input' >>>>> char buff[NL_MESSAGE_SIZE]; >>>>> ^ >>>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE' >>>>> sizeof(struct proc_input)) >>>>> ^ >>>>> proc_filter.c:66:31: error: incomplete definition of type 'struct proc_input' >>>>> ((struct proc_input *)pinp)->mcast_op; >>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~^ >>>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input' >>>>> char buff[NL_MESSAGE_SIZE]; >>>>> ^ >>>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE' >>>>> sizeof(struct proc_input)) >>>>> ^ >>>>> proc_filter.c:67:35: error: incomplete definition of type 'struct proc_input' >>>>> ((struct proc_input *)msg->data)->event_type = >>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ >>>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input' >>>>> char buff[NL_MESSAGE_SIZE]; >>>>> ^ >>>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE' >>>>> sizeof(struct proc_input)) >>>>> ^ >>>>> proc_filter.c:68:31: error: incomplete definition of type 'struct proc_input' >>>>> ((struct proc_input *)pinp)->event_type; >>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~^ >>>>> proc_filter.c:42:12: note: forward declaration of 'struct proc_input' >>>>> char buff[NL_MESSAGE_SIZE]; >>>>> ^ >>>>> proc_filter.c:22:19: note: expanded from macro 'NL_MESSAGE_SIZE' >>>>> sizeof(struct proc_input)) >>>>> ^ >>>>> proc_filter.c:245:20: error: variable has incomplete type 'struct proc_input' >>>>> struct proc_input input; >>>>> ^ >>>>> proc_filter.c:245:9: note: forward declaration of 'struct proc_input' >>>>> struct proc_input input; >>>>> ^ >>>>> proc_filter.c:264:22: error: use of undeclared identifier >>>>> 'PROC_EVENT_NONZERO_EXIT' >>>>> input.event_type = PROC_EVENT_NONZERO_EXIT; >>>>> ^ >>>>> 9 errors generated. >>>>> make[4]: Leaving directory '/builds/linux/tools/testing/selftests/connector’ >>>>> >>>>> >>>> These are expected since you need to have the changes in kernel that were committed with this patch to be installed on the kernel on which this is being compiled/run on. That is what the test is for, and the check to make it run on previous kernels as well was made a runtime check. Do you expect this to compile on a kernel without the corresponding kernel changes that were committed with this patch? >>>> >>>> Anjali >>> Gentle ping - could you answer above questions? >>>> >> >> I am seeing the same on linux-next next-20230727 >> >> PROC_EVENT_NONZERO_EXIT is defined and NL_MESSAGE_SIZE >> >> Anjali, >> >> What are the dependent commits and should they be in next? >> Shouldn't this test patch go with the kernel patches it depends >> on? Can you do some testing on next and let me know why this >> test is failing to build? > > All the commits went in together - however, the kernel changes that went in this patch need to be *installed on kernel on which this is being built*. Did you do that and then try? > Building kernel and running "make headers" before building the test is what is needed. That is what Naresh and I did. How are you building this test? I sent a 3 patch series with the fix to this problem and a couple of others I found during testing. Also please check the error messages - some of them are cryptic and could use clarity. Another thing is argument check - arg == 2 - does this test require arguments? Note that without arguments the test runs - of that is default it is fine. This test could use an usage information. Please fix the above. thanks, -- Shuah