NetBSD Problem Report #54087

From martin@duskware.de  Fri Mar 29 13:10:35 2019
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-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 BDA587A15D
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 29 Mar 2019 13:10:35 +0000 (UTC)
Message-Id: <20190329125328.0202C5CC86C@emmas.aprisoft.de>
Date: Fri, 29 Mar 2019 13:53:28 +0100 (CET)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: ubsan mutex issue on sparc
X-Send-Pr-Version: 3.95

>Number:         54087
>Notify-List:    gson@gson.org
>Category:       lib
>Synopsis:       ubsan mutex issue on sparc
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 29 13:15:00 +0000 2019
>Closed-Date:    Sun May 15 01:22:46 +0000 2022
>Last-Modified:  Sun May 15 01:22:46 +0000 2022
>Originator:     Martin Husemann
>Release:        NetBSD 8.99.36
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD nelly.aprisoft.de 8.99.36 NetBSD 8.99.36 (NELLY) #26: Fri Mar 29 12:03:13 CET 2019 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/sparc64/compile/NELLY sparc
Architecture: sparc
Machine: sparc
>Description:

Running ubsan tests does not work on sparc. The tests time out. Attaching
gdb before that happens shows:

[Switching to LWP 1 of process 2323]
0x200824c4 in __sanitizer::StaticSpinMutex::LockSlow (this=this@entry=0x204e87d0 <__sanitizer::report_file_mu>)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:53
53      /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h: No such file or directory.
(gdb) bt
#0  0x200824c4 in __sanitizer::StaticSpinMutex::LockSlow (this=this@entry=0x204e87d0 <__sanitizer::report_file_mu>)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:53
#1  0x2007c8c4 in __sanitizer::StaticSpinMutex::Lock (this=0x204e87d0 <__sanitizer::report_file_mu>)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:30
#2  __sanitizer::GenericScopedLock<__sanitizer::StaticSpinMutex>::GenericScopedLock (mu=0x204e87d0 <__sanitizer::report_file_mu>, 
    this=<synthetic pointer>) at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:177
#3  __sanitizer::ReportFile::Write (this=0x200a3eb0 <__sanitizer::report_file>, 
    buffer=0xffffce90 "==2323==Sanitizer CHECK failed: /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:42 ((atomic_load(&state_, memory_order_relaxed))) == ((1)) (255, 1)\n", length=181)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix.cc:324
#4  0x20075a38 in __sanitizer::SharedPrintfCode (append_pid=append_pid@entry=true, 
    format=format@entry=0x2008b450 "Sanitizer CHECK failed: %s:%d %s (%lld, %lld)\n", args=args@entry=0xffffd0d0)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_printf.cc:278
#5  0x20075b8c in __sanitizer::Report (format=0x2008b450 "Sanitizer CHECK failed: %s:%d %s (%lld, %lld)\n")
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_printf.cc:304
#6  0x20071b90 in __sanitizer::CheckFailed (file=0x20088900 "/work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h", 
    line=line@entry=42, cond=0x200888c8 "((atomic_load(&state_, memory_order_relaxed))) == ((1))", v1=255, v2=<optimized out>)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_termination.cc:79
#7  0x2007ebd8 in __sanitizer::StaticSpinMutex::CheckLocked (this=<optimized out>)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:42
#8  __sanitizer::ReportFile::ReopenIfNecessary (this=this@entry=0x200a3eb0 <__sanitizer::report_file>)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_common.cc:36
#9  0x2007c8cc in __sanitizer::ReportFile::Write (this=0x200a3eb0 <__sanitizer::report_file>, 
    buffer=0xffffd228 "==2323==Sanitizer CHECK failed: /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:42 ((atomic_load(&state_, memory_order_relaxed))) == ((1)) (255, 1)\n", length=181)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix.cc:327
#10 0x20075a38 in __sanitizer::SharedPrintfCode (append_pid=append_pid@entry=true, 
    format=format@entry=0x2008b450 "Sanitizer CHECK failed: %s:%d %s (%lld, %lld)\n", args=args@entry=0xffffd468)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_printf.cc:278
#11 0x20075b8c in __sanitizer::Report (format=0x2008b450 "Sanitizer CHECK failed: %s:%d %s (%lld, %lld)\n")
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_printf.cc:304
#12 0x20071b90 in __sanitizer::CheckFailed (file=0x20088900 "/work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h", 
    line=line@entry=42, cond=0x200888c8 "((atomic_load(&state_, memory_order_relaxed))) == ((1))", v1=255, v2=<optimized out>)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_termination.cc:79
#13 0x2006d74c in __sanitizer::StaticSpinMutex::CheckLocked (this=<optimized out>)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:42
#14 __ubsan::Diag::~Diag (this=0xffffd610, __in_chrg=<optimized out>) at /work/src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_diag.cc:335
#15 0x200670e0 in handleIntegerOverflowImpl<__ubsan::Value> (Data=Data@entry=0x21078, LHS=LHS@entry=1, Operator=0x200878e8 "+", RHS=..., Opts=...)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_handlers.cc:120
#16 0x20067a7c in __ubsan::__ubsan_handle_add_overflow (Data=0x21078, LHS=1, RHS=2147483647)
    at /work/src/external/gpl3/gcc/dist/libsanitizer/ubsan/ubsan_handlers.cc:133
#17 0x00010a28 in main ()


>How-To-Repeat:
cd /usr/tests/usr.bin/cc && atf-run atf-run t_ubsan_int_add_overflow

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Andreas Gustafsson <gson@gson.org>
To: gnats-bugs@NetBSD.org, martin@NetBSD.org
Cc: 
Subject: Re: lib/54087: ubsan mutex issue on sparc
Date: Fri, 29 Mar 2019 21:44:16 +0200

 > Running ubsan tests does not work on sparc. The tests time out.

 Duplicate of port-sparc/53277, which you have assigned to yourself.
 -- 
 Andreas Gustafsson, gson@gson.org

State-Changed-From-To: open->closed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Sun, 15 May 2022 01:22:46 +0000
State-Changed-Why:
gson says: Duplicate of port-sparc/53277, which you have assigned to yourself.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.