Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6532213rwr; Mon, 24 Apr 2023 23:05:26 -0700 (PDT) X-Google-Smtp-Source: AKy350ZlA/3HOgiCEXcx0OnPVMRKq088cTBb2jdWGkrGn/Jlm1ianVESxOcoRWSETbJzD3KC+F0T X-Received: by 2002:a05:6a21:998d:b0:f2:2185:8575 with SMTP id ve13-20020a056a21998d00b000f221858575mr16817075pzb.23.1682402725400; Mon, 24 Apr 2023 23:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682402725; cv=none; d=google.com; s=arc-20160816; b=BntFAmh/Vkzq+18DpwNTtChhcsdzgot2Bbv1O9zinswK2U7LwuTtIWL2OO0iwnT30y IARhGjUb+YGwTJ6Pwsr/EqHXC4Oi0Sq4bRrrBuatxFnpyaICswdoqm9RDW/JEkDE/zID a/aFXw2xcxY9c7XsrLfEcNUcTzbOSpdX84ZlNIDiHzebA+ETHw2VclvYrt36MnFeWALy f1CWWHUDv0JGNvcgl99AH8ggan22bG7L/td/7byMtCfxct5kGRKCiSoqoMKRiIvSrxVH KZ/SHkHZCeQ27bXfrDOqMBXMKiIQ7EJYaQwH7gGl36LpCGoCur8iY2GaOcGlYst/oX7t 6NAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=HWo/gOxkBPD0P8qzaEzNbYdButIHwcxlfat7U9CFsNc=; b=r8ntc5jwaCUXThnGfjWxhKV7lsdXJBEyZfQtHkKfp6oFksVXa82hcReqFRwVQo4wwP gezIr3efuAeZ8XjxckdkCPH4M1B7U5Jw+FakxcfrnrwvKnL1Pp/xiQL7SIJYj9R+nzHU E68HapVKm5+7VU9Lohgao+RS6VB9kHMVRmPoaJxKAL4l0ktwSB0ZP4x2VIa8/rLE44p8 /M/0EfDXgGae5Gbw6Jze7DkuDDCmyuf9HtGTVJ8q2kg3pV0cxfgGqHG+TbxGwO3KcZhZ IJsF12oMB8raGPGdjW7rgRuHcPbSzeimPs2qFHarJ5dhu+cLTkUax/3BBMSeoGcm6zxS rmUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=mep0ZBl2; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020aa78f18000000b0062a450c329dsi12970018pfr.93.2023.04.24.23.05.12; Mon, 24 Apr 2023 23:05:25 -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=@gmail.com header.s=20221208 header.b=mep0ZBl2; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233341AbjDYGCO (ORCPT + 99 others); Tue, 25 Apr 2023 02:02:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232823AbjDYGCL (ORCPT ); Tue, 25 Apr 2023 02:02:11 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56591768A; Mon, 24 Apr 2023 23:02:10 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-63d4595d60fso33110034b3a.0; Mon, 24 Apr 2023 23:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682402530; x=1684994530; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=HWo/gOxkBPD0P8qzaEzNbYdButIHwcxlfat7U9CFsNc=; b=mep0ZBl2QlhfndGTH4hOH/b4on9TzyF1daOHf8HYG2fKBubEcyZo9qqNpHRV/YMAhu ePYQiiyv8pdRVCk9SWZ+SLABKFK5Jl8txTVyu036SFpKVMsa3PRxFD78UwGYz1a121WH xPdjVClJUI9gSK/ppK5zz1u50+KW6I00fpl7eGJJK4gR4wRsHrfucxvpEdOLmnh1YVqB 2f22MpTzZzYA+C+DgxeRkc5U2EtAoIh9pBV2PnPJ6DdZY+ZocT3norUY4ANlA2RaQvmS MmX1rZwZYyFDNKw9LwHsyM1LlkJWJGUHzOQBdeKCQzi45stjBHHtL9b8w7yU+h8gZPwW njMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682402530; x=1684994530; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HWo/gOxkBPD0P8qzaEzNbYdButIHwcxlfat7U9CFsNc=; b=Y9xOH8iMka7aGWyTAcJ1C2/hkhUEygv2NbgITGfFgUXER8kd+2jBXKdRuOb13ELH1F OZIJA8aDJ4I+scId4xZvHs+DHJS3PnXsYf42IMGKRjGu1VO9HqEExuqsrdBlyDrzI2To tkHGn4nqwt8Us/8ChKLc55mQB6N0egoBLAv5e9REPi3s6jErGCELSOLiaZfPf58r7n5z 4YtvOqKDvky+PE1ScX2zdRbMOYGKRoumCl/qNFdpdHAu9Ny4Ijzq10Nv7Y9ye2a+GxKO TfAfSWtXA8r3nGH7In3sHsw7ze8pSham4+kC/B3FY0mu11VmjVlQuWUChAK6D/C420+L NEtQ== X-Gm-Message-State: AAQBX9e5L7MNS49dN5KTOP/Qwk18RAbfK/Op4JfXR0pt0dZZ/cQG896e S0yL2/ZcLzA264OGw8WHcVfyhJIP7W/gVi3zu60= X-Received: by 2002:a17:90a:6002:b0:246:865d:419a with SMTP id y2-20020a17090a600200b00246865d419amr22555648pji.6.1682402529664; Mon, 24 Apr 2023 23:02:09 -0700 (PDT) MIME-Version: 1.0 References: <87cz3tylwx.fsf@mail.concordia> In-Reply-To: <87cz3tylwx.fsf@mail.concordia> From: Zhouyi Zhou Date: Tue, 25 Apr 2023 14:01:58 +0800 Message-ID: Subject: Re: BUG : PowerPC RCU: torture test failed with __stack_chk_fail To: Michael Ellerman Cc: linuxppc-dev , rcu , linux-kernel , lance@osuosl.org, "Paul E. McKenney" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NORMAL_HTTP_TO_IP, NUMERIC_HTTP_ADDR,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 hi On Tue, Apr 25, 2023 at 6:07=E2=80=AFAM Michael Ellerman wrote: > > Zhouyi Zhou writes: > > Dear PowerPC and RCU developers: > > During the RCU torture test on mainline (on the VM of Opensource Lab > > of Oregon State University), SRCU-P failed with __stack_chk_fail: > ... > > by debugging, I see the r10 is assigned with r13 on c000000000226eb4, > > but if there is a context-switch before c000000000226edc, a false > > positive will be reported. > > > > [1] http://154.220.3.115/logs/0422/configformainline.txt > > Says: > > CONFIG_CC_VERSION_TEXT=3D"powerpc64le-linux-gnu-gcc-10 (Ubuntu 10.4.0-4ub= untu1~22.04) 10.4.0" > > Do you see the same issue with a newer GCC? On PPC vm of Oregon State University (I can grant rsa-pub key ssh access if you are interested), I build and install the gcc from git, then use the newly built gcc to compile the kernel, the bug disappears, I don't know why. Following is what is do: 1) git clone git://gcc.gnu.org/git/gcc.git git rev-parse --short HEAD f0eabc52c9a 2) mkdir gcc/build 3) cd gcc/build 4) ../configure --disable-bootstrap --prefix=3D/home/ubuntu/gcc-install 5) make -j 4 //my VM has limited memory ;-) 6) make install 7) cd linux-dir git rev-parse --short HEAD 61d325dcbc05 8) export PATH=3D/home/ubuntu/gcc-install/bin:$PATH 9) make vmlinux -j 8 10) ./whilebash.sh [1] From the assembly code of srcu_gp_start_if_needed [2], I found stack protec= tor is operated directly on r13: c000000000225098: 30 00 0d e9 ld r8,48(r13) c00000000022509c: 08 00 3c e9 ld r9,8(r28) c0000000002250a0: 14 42 29 7d add r9,r9,r8 c0000000002250a4: ac 04 00 7c hwsync c0000000002250a8: 10 00 7b 3b addi r27,r27,16 c0000000002250ac: 14 da 29 7d add r9,r9,r27 c0000000002250b0: a8 48 00 7d ldarx r8,0,r9 c0000000002250b4: 01 00 08 31 addic r8,r8,1 c0000000002250b8: ad 49 00 7d stdcx. r8,0,r9 c0000000002250bc: f4 ff c2 40 bne- c0000000002250b0 c0000000002250c0: 28 00 01 e9 ld r8,40(r1) c0000000002250c4: 78 0c 2d e9 ld r9,3192(r13) c0000000002250c8: 79 4a 08 7d xor. r8,r8,r9 c0000000002250cc: 00 00 20 39 li r9,0 c0000000002250d0: 90 03 82 40 bne c000000000225460 console.log is attached at [3]. [1] 140.211.169.189/0425/whilebash.sh [2] http://140.211.169.189/0425/srcu_gp_start_if_needed.txt [3] http://140.211.169.189/0425/console.log I am very glad to cooperate if there is anything else I can do ;-) Cheers Zhouyi > > There's 12.2.0 here: > https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/12= .2.0/ > https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/ppc64le/1= 2.2.0/ > > Or if you can build in a Fedora 38 system or container, it has GCC 13. > > cheers