From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 4B545384F030 for ; Wed, 9 Nov 2022 07:43:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4B545384F030 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1667979785; bh=b8wiV3J4x70MtiR5dqf+20is53Sz3gpYQmVdiz7p5aA=; h=Subject:From:To:Cc:Date:From; b=kQpAV6fmascBpvicjK38enYsAwU8psyx9n1dJ3d9OznAK89AiBZm3AAkEtZrlPlo6 EjEfq9FoTBm47GjIGbJFORJZFvAL4xoq3t0BRPVkVhJRhnsYUWjBaaPJCpTyQDI4RD 0pINQjQUrGdPRWBaFiRUKkyPRUxpRRAlDGeFYKcg= Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 59FBC66836; Wed, 9 Nov 2022 02:43:04 -0500 (EST) Message-ID: <2e88c9803e5b57aa3f320c9722dcb700b6a47420.camel@xry111.site> Subject: "random" segment faults in expect running GCC regression test on LoongArch From: Xi Ruoyao To: gcc@gcc.gnu.org Cc: Lulu Cheng , Wang Xuerui , Chenghua Xu Date: Wed, 09 Nov 2022 15:43:02 +0800 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.0 MIME-Version: 1.0 X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD,FROM_SUSPICIOUS_NTLD_FP,LIKELY_SPAM_FROM,PDS_OTHER_BAD_TLD,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, This is a "help wanted" message. When I run GCC regression test on loongarch64-linux-gnu, expect occasionally crashes with a segment fault. The stack backtrace is like: Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007ffff0a35910 in TclpAlloc () from /usr/lib/libtcl8.6.so [Current thread is 1 (Thread 0x7ffff05d8420 (LWP 9228))] (gdb) bt #0 0x00007ffff0a35910 in TclpAlloc () from /usr/lib/libtcl8.6.so #1 0x00007ffff08b0ed4 in sortins () from /usr/lib/libtcl8.6.so #2 0x00007ffff08b18d0 in mergeins () from /usr/lib/libtcl8.6.so #3 0x00007ffff08b3654 in fixempties () from /usr/lib/libtcl8.6.so #4 0x00007ffff08b2564 in optimize () from /usr/lib/libtcl8.6.so #5 0x00007ffff08aa9a0 in nfanode () from /usr/lib/libtcl8.6.so #6 0x00007ffff08aa8a4 in nfatree () from /usr/lib/libtcl8.6.so #7 0x00007ffff08aa894 in nfatree () from /usr/lib/libtcl8.6.so #8 0x00007ffff08aa894 in nfatree () from /usr/lib/libtcl8.6.so #9 0x00007ffff08aa894 in nfatree () from /usr/lib/libtcl8.6.so #10 0x00007ffff08a6c00 in TclReComp () from /usr/lib/libtcl8.6.so #11 0x00007ffff0a2155c in CompileRegexp () from /usr/lib/libtcl8.6.so #12 0x00007ffff0a20e74 in Tcl_GetRegExpFromObj () from /usr/lib/libtcl8.6.s= o #13 0x00007ffff08ebe48 in Tcl_RegsubObjCmd () from /usr/lib/libtcl8.6.so #14 0x00007ffff08c6e64 in Dispatch () from /usr/lib/libtcl8.6.so #15 0x00007ffff08c6f10 in TclNRRunCallbacks () from /usr/lib/libtcl8.6.so #16 0x00007ffff08c6650 in Tcl_EvalObjv () from /usr/lib/libtcl8.6.so #17 0x00007ffff08c8f7c in TclEvalEx () from /usr/lib/libtcl8.6.so #18 0x00007ffff09f1270 in Tcl_FSEvalFileEx () from /usr/lib/libtcl8.6.so #19 0x00007ffff09f0f00 in Tcl_FSEvalFile () from /usr/lib/libtcl8.6.so #20 0x00007ffff09ef26c in Tcl_EvalFile () from /usr/lib/libtcl8.6.so #21 0x00007ffff0afc658 in exp_interpret_cmdfilename () from /usr/lib/libexpect5.45.4.so #22 0x0000000120000c80 in main () The crashes happen on both my own LoongArch board and gcc401.fsffrance.org. So I don't think it was an "only me" problem. The segment fault is not deterministic. A Expect command like cd /path/to/gcc/build/gcc expect -- /usr/share/dejagnu/runtest.exp --tool gfortran dg.exp=3Dbind-c-co= ntiguous-1.f90 sometimes succeeds, sometimes immediately segfaults, sometimes prints several lines of strange error message and then exits abnormally. Usually I don't like to send "help wanted" messages, but this time I have no idea how to fix (or even triage) the problem. I don't even know which component (Tcl? Expect? GCC? Glibc? Kernel?) I should blame. So it seems I really need some help now... --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University