NetBSD Problem Report #55669

From leot@netbsd.org  Sat Sep 19 15:34:54 2020
Return-Path: <leot@netbsd.org>
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 852D91A9239
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 19 Sep 2020 15:34:54 +0000 (UTC)
Message-Id: <20200919153454.335FA84D66@mail.netbsd.org>
Date: Sat, 19 Sep 2020 15:34:53 +0000 (UTC)
From: Leonardo Taccari <leot@NetBSD.org>
Reply-To: leot@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: backtrace(3) SIGSEGVs on NetBSD/evbarm on netbsd-9
X-Send-Pr-Version: 3.95

>Number:         55669
>Category:       port-evbarm
>Synopsis:       backtrace(3) SIGSEGVs on NetBSD/evbarm on netbsd-9
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-evbarm-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 19 15:35:00 +0000 2020
>Last-Modified:  Sat Sep 19 18:25:01 +0000 2020
>Originator:     Leonardo Taccari
>Release:        NetBSD 9.0_STABLE
>Organization:
The NetBSD Foundation
>Environment:
System: NetBSD armv7 9.0_STABLE NetBSD 9.0_STABLE (GENERIC) #0: Tue Jun 30 18:49:17 UTC 2020 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC evbarm
Architecture: earmv7hf
Machine: evbarm
>Description:
	On NetBSD/evbarm (at least earmv7hf)
>How-To-Repeat:
	Probably the easiest way to reproduce it is by manually running
	tests/lib/libexecinfo/t_backtrace, e.g.:

	% /usr/tests/lib/libexecinfo/t_backtrace backtrace_fmt_basic
	t_backtrace: WARNING: Running test cases without atf-run(1) is unsupported
	t_backtrace: WARNING: No isolation nor timeout control is being applied; you may get unexpected failures; see atf-test-case(4)
	[1]   Segmentation fault (core dumped) /usr/tests/lib/libexecinfo/t_backtrace backtrace_fmt_basic
	% gdb -core t_backtrace.core /usr/tests/lib/libexecinfo/t_backtrace
	GNU gdb (GDB) 8.3
	[...]
	Reading symbols from /usr/tests/lib/libexecinfo/t_backtrace...
	Reading symbols from /usr/libdata/debug//usr/tests/lib/libexecinfo/t_backtrace.debug...
	[New process 1]
	Core was generated by `t_backtrace'.
	Program terminated with signal SIGSEGV, Segmentation fault.
	#0  0x6206f698 in _Unwind::LocalAddressSpace::get32 (this=0x620c7b7c, addr=4294967256)
	    at /usr/src/sys/lib/libunwind/AddressSpace.hpp:85
	85      /usr/src/sys/lib/libunwind/AddressSpace.hpp: No such file or directory.
	(gdb) bt
	#0  0x6206f698 in _Unwind::LocalAddressSpace::get32 (this=0x620c7b7c, addr=4294967256)
	    at /usr/src/sys/lib/libunwind/AddressSpace.hpp:85
	#1  _Unwind::LocalAddressSpace::getP (this=0x620c7b7c, addr=4294967256) at /usr/src/sys/lib/libunwind/AddressSpace.hpp:97
	#2  _Unwind::DwarfInstructions<_Unwind::LocalAddressSpace, _Unwind::Registers_arm32>::getSavedRegister (addressSpace=...,
	    registers=..., cfa=cfa@entry=4, savedReg=...) at /usr/src/sys/lib/libunwind/DwarfInstructions.hpp:72
	#3  0x6206f900 in _Unwind::DwarfInstructions<_Unwind::LocalAddressSpace, _Unwind::Registers_arm32>::stepWithDwarf (addressSpace=...,
	    pc=<optimized out>, fdeStart=<optimized out>, registers=..., ctx=ctx@entry=0x7ff821c0)
	    at /usr/src/sys/lib/libunwind/DwarfInstructions.hpp:143
	#4  0x61f8b680 in _Unwind::UnwindCursor<_Unwind::LocalAddressSpace, _Unwind::Registers_arm32>::stepWithDwarfFDE (this=0x7ff821c0)
	    at /usr/src/sys/lib/libunwind/UnwindCursor.hpp:84
	#5  _Unwind::UnwindCursor<_Unwind::LocalAddressSpace, _Unwind::Registers_arm32>::step (this=0x7ff821c0)
	    at /usr/src/sys/lib/libunwind/UnwindCursor.hpp:55
	#6  _Unwind_Backtrace (callback=0x62140a00 <tracer>, ref=ref@entry=0x7ff8235c) at /usr/src/sys/lib/libunwind/libunwind.cxx:310
	#7  0x62140a88 in backtrace (arr=<optimized out>, len=<optimized out>) at /usr/src/lib/libexecinfo/unwind.c:69
	#8  0x01fd0d48 in myfunc3 (ncalls=12) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:80
	#9  0x01fd1190 in myfunc2 (ncalls=<optimized out>) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:119
	#10 0x01fd11e8 in myfunc1 (origcalls=<optimized out>, ncalls=1) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:131
	#11 0x01fd1214 in myfunc1 (origcalls=<optimized out>, ncalls=2) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:129
	#12 0x01fd1214 in myfunc1 (origcalls=<optimized out>, ncalls=3) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:129
	#13 0x01fd1214 in myfunc1 (origcalls=<optimized out>, ncalls=4) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:129
	#14 0x01fd1214 in myfunc1 (origcalls=<optimized out>, ncalls=5) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:129
	#15 0x01fd1214 in myfunc1 (origcalls=<optimized out>, ncalls=6) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:129
	#16 0x01fd1214 in myfunc1 (origcalls=<optimized out>, ncalls=7) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:129
	#17 0x01fd1214 in myfunc1 (origcalls=<optimized out>, ncalls=8) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:129
	#18 0x01fd1214 in myfunc1 (origcalls=<optimized out>, ncalls=9) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:129
	#19 0x01fd1214 in myfunc1 (origcalls=<optimized out>, ncalls=10) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:129
	#20 0x01fd1214 in myfunc1 (origcalls=<optimized out>, ncalls=11) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:129
	#21 0x01fd1214 in myfunc1 (origcalls=<optimized out>, ncalls=12) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:129
	#22 0x01fd1238 in myfunc (ncalls=<optimized out>) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:140
	#23 0x01fd127c in atfu_backtrace_fmt_basic_body (tc=<optimized out>) at /usr/src/tests/lib/libexecinfo/t_backtrace.c:155
	#24 0x620e83f8 in atf_tc_run (tc=0x1fe1af0 <atfu_backtrace_fmt_basic_tc>, resfile=<optimized out>)
	    at /usr/src/external/bsd/atf/dist/atf-c/tc.c:1024
	#25 0x620e5484 in atf_tp_run (tp=tp@entry=0x7ff82674, tcname=tcname@entry=0x61f00000 "backtrace_fmt_basic", resfile=<optimized out>)
	    at /usr/src/external/bsd/atf/dist/atf-c/tp.c:205
	#26 0x620e4ef0 in run_tc (exitcode=<synthetic pointer>, p=0x7ff82680, tp=0x7ff82674)
	    at /usr/src/external/bsd/atf/dist/atf-c/detail/tp_main.c:510
	#27 controlled_main (exitcode=<synthetic pointer>, add_tcs_hook=0x1fd0c40 <atfu_tp_add_tcs>, argv=<optimized out>,
	    argc=<optimized out>) at /usr/src/external/bsd/atf/dist/atf-c/detail/tp_main.c:580
	#28 atf_tp_main (argc=<optimized out>, argv=<optimized out>, add_tcs_hook=0x1fd0c40 <atfu_tp_add_tcs>)
	    at /usr/src/external/bsd/atf/dist/atf-c/detail/tp_main.c:610
	#29 0x01fd0b70 in ___start ()
	#30 0x6dbc4544 in _rtld_exclusive_exit (mask=0x7ff83ff0) at /usr/src/libexec/ld.elf_so/rtld.c:1784
	#31 _rtld (sp=<optimized out>, relocbase=<optimized out>) at /usr/src/libexec/ld.elf_so/rtld.c:787
	Backtrace stopped: Cannot access memory at address 0xfffffffc
>Fix:
	N/A, sorry!

	Please note though that *only* netbsd-9 is affected, both netbsd-8 and
	NetBSD-current are not affected.

>Audit-Trail:
From: "Leonardo Taccari" <leot@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55669 CVS commit: pkgsrc/net/tor
Date: Sat, 19 Sep 2020 18:22:01 +0000

 Module Name:	pkgsrc
 Committed By:	leot
 Date:		Sat Sep 19 18:22:01 UTC 2020

 Modified Files:
 	pkgsrc/net/tor: Makefile
 Added Files:
 	pkgsrc/net/tor: hacks.mk

 Log Message:
 tor: disable backtrace(3) support on netbsd-9 evbarm

 backtrace(3) does not work on netbsd-9 ending up in a SIGSEGV and tor
 process hanging forever (a simple way to reproduce without configuring
 tor is just invoking tor via `tor --version').

 Workaround for PR port-evbarm/55669.

 PKGREVISION++


 To generate a diff of this commit:
 cvs rdiff -u -r1.156 -r1.157 pkgsrc/net/tor/Makefile
 cvs rdiff -u -r0 -r1.1 pkgsrc/net/tor/hacks.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

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.