From patchwork Thu Aug 9 15:03:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 955696 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-483461-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="FV3KMHH6"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41mWjm0L6zz9ryt for ; Fri, 10 Aug 2018 01:03:55 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:cc:date:message-id:mime-version:content-type; q=dns; s=default; b=fvHiXIWroHLNvcmT4anxl1f3WHH+8DS3YEU42gjOQYXImyxnMq Q/07EtEqWk0k70orfx8mCYoYgclNj59l2IqaqLT1VoggiDvNFIoN0QdMrVw3yY3G jc8hdMAMtw7mX4AOTjP5X/cqtUJMVs7knA2shai1+4Hi0IllviB6ajiQs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:cc:date:message-id:mime-version:content-type; s= default; bh=V+6D4t04F57P6EgYFcYegV9PObA=; b=FV3KMHH6YacMlv1m84qu d/4WA49HeHQ/oacayZhg8tDZPSNGt4Tt9vAnRZ7PQrLNl7dUUbWq2BxJepqyTMCG PT8O2xJZ8AOWFBG++asFNTTB0jR6036+gALng2PSDOmNVOUaPpO0ihWQRAoZPMxI hlr4OvakwcCWniDZTh6CkF8= Received: (qmail 119085 invoked by alias); 9 Aug 2018 15:03:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 119068 invoked by uid 89); 9 Aug 2018 15:03:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=spurious X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Aug 2018 15:03:46 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6F73AAE82; Thu, 9 Aug 2018 15:03:44 +0000 (UTC) From: Andreas Schwab To: ian@airs.com Subject: libgo: fix spurious test failure in libgo/runtime/pprof CC: gcc-patches@gcc.gnu.org X-Yow: All I can think of is a platter of organic PRUNE CRISPS being trampled by an army of swarthy, Italian LOUNGE SINGERS... Date: Thu, 09 Aug 2018 17:03:43 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 TestMemoryProfiler uses a too restrictive pattern that fails to match backtraces that contain two tabs after the function address. That can happen when the formatted addresses are of different length: 0: 0 [1: 2097152] @ 0x1746c 0x134a00 0x13450e 0x134fd8 0x84396 0x84892 0x17526 0x17628 0xf863a 0xbe3d8 # 0x1746b pprof.allocateReflectTransient+0x21 /suse/schwab/src/gcc/n-riscv64/riscv64-suse-linux/libgo/gotest32110/test/mprof_test.go:48 # 0x1349ff ffi_call_asm+0x51 ../../../gcc/libffi/src/riscv/sysv.S:124 # 0x13450d ffi_call_int+0xf7 ../../../gcc/libffi/src/riscv/ffi.c:372 # 0x134fd7 reflect.call+0xab ../../../gcc/libgo/runtime/go-reflect-call.c:232 # 0x84395 reflect.Value.call+0x58d ../../../gcc/libgo/go/reflect/value.go:458 # 0x84891 reflect.Value.Call+0x4b ../../../gcc/libgo/go/reflect/value.go:306 # 0x17525 pprof.allocateReflect+0x4b /suse/schwab/src/gcc/n-riscv64/riscv64-suse-linux/libgo/gotest32110/test/mprof_test.go:53 # 0x17627 runtime_pprof.TestMemoryProfiler+0xf7 /suse/schwab/src/gcc/n-riscv64/riscv64-suse-linux/libgo/gotest32110/test/mprof_test.go:75 # 0xf8639 testing.tRunner+0x89 ../../../gcc/libgo/go/testing/testing.go:777 Andreas. diff --git a/libgo/go/runtime/pprof/mprof_test.go b/libgo/go/runtime/pprof/mprof_test.go index 5d77a1d898..ffa0591de2 100644 --- a/libgo/go/runtime/pprof/mprof_test.go +++ b/libgo/go/runtime/pprof/mprof_test.go @@ -86,26 +86,26 @@ func TestMemoryProfiler(t *testing.T) { tests := []string{ fmt.Sprintf(`%v: %v \[%v: %v\] @ 0x[0-9,a-f x]+ -# 0x[0-9,a-f]+ pprof\.allocatePersistent1K\+0x[0-9,a-f]+ .*/mprof_test\.go:40 -# 0x[0-9,a-f]+ runtime_pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/mprof_test\.go:74 +# 0x[0-9,a-f]+ +pprof\.allocatePersistent1K\+0x[0-9,a-f]+ .*/mprof_test\.go:40 +# 0x[0-9,a-f]+ +runtime_pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/mprof_test\.go:74 `, 32*memoryProfilerRun, 1024*memoryProfilerRun, 32*memoryProfilerRun, 1024*memoryProfilerRun), fmt.Sprintf(`0: 0 \[%v: %v\] @ 0x[0-9,a-f x]+ -# 0x[0-9,a-f]+ pprof\.allocateTransient1M\+0x[0-9,a-f]+ .*/mprof_test.go:21 -# 0x[0-9,a-f]+ runtime_pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/mprof_test.go:72 +# 0x[0-9,a-f]+ +pprof\.allocateTransient1M\+0x[0-9,a-f]+ .*/mprof_test.go:21 +# 0x[0-9,a-f]+ +runtime_pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/mprof_test.go:72 `, (1<<10)*memoryProfilerRun, (1<<20)*memoryProfilerRun), // This should start with "0: 0" but gccgo's imprecise // GC means that sometimes the value is not collected. fmt.Sprintf(`(0|%v): (0|%v) \[%v: %v\] @ 0x[0-9,a-f x]+ -# 0x[0-9,a-f]+ pprof\.allocateTransient2M\+0x[0-9,a-f]+ .*/mprof_test.go:27 -# 0x[0-9,a-f]+ runtime_pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/mprof_test.go:73 +# 0x[0-9,a-f]+ +pprof\.allocateTransient2M\+0x[0-9,a-f]+ .*/mprof_test.go:27 +# 0x[0-9,a-f]+ +runtime_pprof\.TestMemoryProfiler\+0x[0-9,a-f]+ .*/mprof_test.go:73 `, memoryProfilerRun, (2<<20)*memoryProfilerRun, memoryProfilerRun, (2<<20)*memoryProfilerRun), // This should start with "0: 0" but gccgo's imprecise // GC means that sometimes the value is not collected. fmt.Sprintf(`(0|%v): (0|%v) \[%v: %v\] @( 0x[0-9,a-f]+)+ -# 0x[0-9,a-f]+ pprof\.allocateReflectTransient\+0x[0-9,a-f]+ .*/mprof_test.go:48 +# 0x[0-9,a-f]+ +pprof\.allocateReflectTransient\+0x[0-9,a-f]+ .*/mprof_test.go:48 `, memoryProfilerRun, (2<<20)*memoryProfilerRun, memoryProfilerRun, (2<<20)*memoryProfilerRun), }