NetBSD Problem Report #57351

From www@netbsd.org  Fri Apr 14 13:07:15 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id BA38A1A9239
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 14 Apr 2023 13:07:14 +0000 (UTC)
Message-Id: <20230414130713.48BBF1A923A@mollari.NetBSD.org>
Date: Fri, 14 Apr 2023 13:07:13 +0000 (UTC)
From: jspath55@gmail.com
Reply-To: jspath55@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Automated test usr.bin/c++/t_tsan_vptr_race:vptr_race fails intermittently on an amd64 machine
X-Send-Pr-Version: www-1.0

>Number:         57351
>Category:       toolchain
>Synopsis:       Automated test usr.bin/c++/t_tsan_vptr_race:vptr_race fails intermittently on an amd64 machine
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 14 13:10:00 +0000 2023
>Closed-Date:    Wed May 08 02:15:32 +0000 2024
>Last-Modified:  Wed May 08 02:15:32 +0000 2024
>Originator:     Jim Spath
>Release:        10.0_BETA
>Organization:
>Environment:
NetBSD hi.me 10.0_BETA NetBSD 10.0_BETA (GENERIC) #0: Sun Feb 12 12:39:37 UTC 2023  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64 x86_64 AMD 686-class NetBSD

>Description:
The intermittent failures on this automated test case are similar to ones reported in PR 57345 except with a lower failure rate.

I also set this case up as a frequently running cron job. The failures occur between 5 and 10 percent of the runs.

$ grep "^tc-end" /tmp/t_race.log |  wc  -l
    1326

$ grep "^tc-end" /tmp/t_race.log | head   
tc-end: 1681397762.59026, vptr_race, passed
tc-end: 1681397821.397715, vptr_race, passed
tc-end: 1681397881.440008, vptr_race, failed, atf-check failed; see the output of the test for details
tc-end: 1681397941.472436, vptr_race, passed
tc-end: 1681398001.510849, vptr_race, passed
tc-end: 1681398061.568513, vptr_race, passed
tc-end: 1681398121.602199, vptr_race, passed
tc-end: 1681398181.643119, vptr_race, passed
tc-end: 1681398241.688494, vptr_race, passed
tc-end: 1681398301.724397, vptr_race, passed

$ grep "^tc-end" /tmp/t_race.log | grep passed | wc -l
    1264

$ grep "^tc-end" /tmp/t_race.log | grep -v passed | wc -l
      63

>How-To-Repeat:
cd /usr/tests
atf-run usr.bin/c++/t_tsan_vptr_race:vptr_race


The errors look like this:

tps-count: 1
tp-start: 1681397880.832022, usr.bin/c++/t_tsan_vptr_race, 1
tc-start: 1681397880.832053, vptr_race
tc-so:Executing command [ ./test ]
tc-se:Fail: regexp WARNING: ThreadSanitizer: data race on vptr \(ctor/dtor vs virtual call\) not in stderr
tc-se:==================
tc-se:WARNING: ThreadSanitizer: data race (pid=2988)
tc-se:  Read of size 1 at 0x7b0400000058 by main thread:
tc-se:    #0 A::~A() <null> (test+0x401303)
tc-se:    #1 B::~B() <null> (test+0x4013ef)
tc-se:    #2 B::~B() <null> (test+0x401421)
tc-se:    #3 main <null> (test+0x40112c)
tc-se:
tc-se:  Previous write of size 1 at 0x7b0400000058 by thread T1:
tc-se:    #0 A::Done() <null> (test+0x4012ab)
tc-se:    #1 Thread1(void*) <null> (test+0x401078)
tc-se:
tc-se:  Location is heap block of size 16 at 0x7b0400000050 allocated by main thread:
tc-se:    #0 operator new(unsigned long) <null> (libtsan.so.1+0x28d5f)
tc-se:    #1 __static_initialization_and_destruction_0(int, int) test.cc (test+0x4011a7)
tc-se:    #2 _GLOBAL__sub_I_barrier test.cc (test+0x401203)
tc-se:    #3 ___start <null> (test+0x400f10)
tc-se:
tc-se:  Thread T1 (tid=2734, finished) created by main thread at:
tc-se:    #0 pthread_create <null> (libtsan.so.1+0x7caa2)
tc-se:    #1 main <null> (test+0x4010e9)
tc-se:
tc-se:SUMMARY: ThreadSanitizer: data race (/tmp/atf-run.f3NGrj/./test+0x401303) in A::~A()
tc-se:==================
tc-se:ThreadSanitizer: reported 1 warnings
tc-end: 1681397881.440008, vptr_race, failed, atf-check failed; see the output of the test for details
tp-end: 1681397881.440423, usr.bin/c++/t_tsan_vptr_race
info: time.end, Thu Apr 13 14:58:01 UTC 2023

>Fix:
Unknown cause. No obvious correlations to other apps running or system load.

>Release-Note:

>Audit-Trail:
From: Jim Spath <jspath55@gmail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/57351
Date: Tue, 7 May 2024 16:51:35 -0400

 I found PR toolchain/55770 had already reported the results I found
 with intermittent tsan case failures. Meanwhile, I ran usr/tests on
 several x86/64 systems and found more failures on machines with fewer
 cores.

 6-core/12-thread AMD CPU:

 ----X---------------------X----X--------
 usr.bin/c++/t_tsan_data_race:data_race
 ----X-----------------------------------
 usr.bin/c++/t_tsan_data_race:data_race_pic
 --------------------------X----X--------
 usr.bin/c++/t_tsan_data_race:data_race_pie
 ---X-----X---X-------X---------X--------
 usr.bin/c++/t_tsan_vptr_race:vptr_race
 -------------X--------------------------
 usr.bin/c++/t_tsan_vptr_race:vptr_race_pie
 X--X----X-----------XX-X-------XX-------   usr.bin/cc/t_tsan_data_race:data_race
 ---X----X-----------X--X----------------
 usr.bin/cc/t_tsan_data_race:data_race_pic
 --------------------XX------------------
 usr.bin/cc/t_tsan_data_race:data_race_pie

 4-core/4-thread AMD CPU:

 ----X-X-XXX--X----X--XX--X------------X-
 usr.bin/c++/t_tsan_data_race:data_race
 ------X-X----X--------X--X------------X-
 usr.bin/c++/t_tsan_data_race:data_race_pic
 ----X----X---X--------------------------
 usr.bin/c++/t_tsan_data_race:data_race_pie
 -X-------------X--X---X--XX-X------X--X-
 usr.bin/c++/t_tsan_vptr_race:vptr_race
 -----------------------------------X----
 usr.bin/c++/t_tsan_vptr_race:vptr_race_pie
 -----X--X--X----------XX------X--X-----X   usr.bin/cc/t_tsan_data_race:data_race
 ----------------------XX---------X------
 usr.bin/cc/t_tsan_data_race:data_race_pic
 -----X--X--X------------------X--------X
 usr.bin/cc/t_tsan_data_race:data_race_pie

 2-core/2-thread Intel CPU:

 X-X---XX-X-X--X-XX--XXXXXXXXXXXX-X--XXX-
 usr.bin/c++/t_tsan_data_race:data_race
 ------X-------X-XX---XX-XXX-X--------X--
 usr.bin/c++/t_tsan_data_race:data_race_pic
 --X------X-------------XX-XXXXXX-----X--
 usr.bin/c++/t_tsan_data_race:data_race_pie
 -X--XXXXX--XXXXXXXXX--X-XXX--X-XX-XXXXXX
 usr.bin/c++/t_tsan_vptr_race:vptr_race
 ----XX-X---XXXXX-XXX--X-X-X--X--X-XXXXXX
 usr.bin/c++/t_tsan_vptr_race:vptr_race_pie
 -X--XXX-X-XX-XXXXXXXX-XXX---XX--X-XXX-X-   usr.bin/cc/t_tsan_data_race:data_race
 ------X----X-----XX---XXX----X--X-----X-
 usr.bin/cc/t_tsan_data_race:data_race_pic
 -X------X-XX--XX---XX-------X-----XXX---
 usr.bin/cc/t_tsan_data_race:data_race_pie

 OK to close this as a duplicate.

State-Changed-From-To: open->closed
State-Changed-By: gutteridge@NetBSD.org
State-Changed-When: Wed, 08 May 2024 02:15:32 +0000
State-Changed-Why:
Submitter requested to close as a duplicate.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.