NetBSD Problem Report #53090

From www@NetBSD.org  Mon Mar 12 02:19:48 2018
Return-Path: <www@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 8339C7A1C9
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 12 Mar 2018 02:19:48 +0000 (UTC)
Message-Id: <20180312021947.91F2C7A1CE@mollari.NetBSD.org>
Date: Mon, 12 Mar 2018 02:19:47 +0000 (UTC)
From: venture37@geeklan.co.uk
Reply-To: venture37@geeklan.co.uk
To: gnats-bugs@NetBSD.org
Subject: lib/libc/gen/t_fpsetmask test cases panic
X-Send-Pr-Version: www-1.0

>Number:         53090
>Category:       port-cobalt
>Synopsis:       lib/libc/gen/t_fpsetmask test cases panic
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-cobalt-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 12 02:20:00 +0000 2018
>Last-Modified:  Tue Dec 25 11:25:01 +0000 2018
>Originator:     Sevan Janiyan
>Release:        8.0_BETA 201803082300Z
>Organization:
>Environment:
NetBSD 8.0_BETA cobalt mipsel
>Description:
When running the test suite, the system panics when running the lib/libc/gen/t_fpsetmask tetsts on NetBSD/cobalt.


bt
pcu_save+9c
mips_emul_fp+205c
mips_fpu_intr+c8
trap+6ac
mips3_user_gen_exception+d8

show panic
Panic string: (null)
>How-To-Repeat:
Run the NetBSD testsuite on NetBSD/cobalt
>Fix:

>Audit-Trail:
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: port-cobalt-maintainer@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org
Subject: Re: port-cobalt/53090: lib/libc/gen/t_fpsetmask test cases panic
Date: Mon, 12 Mar 2018 11:31:08 +0100

 On Mon, Mar 12, 2018 at 02:20:01AM +0000, venture37@geeklan.co.uk wrote:
 > >Description:
 > When running the test suite, the system panics when running the lib/libc/gen/t_fpsetmask tetsts on NetBSD/cobalt.
 > 
 > 
 > bt
 > pcu_save+9c
 > mips_emul_fp+205c
 > mips_fpu_intr+c8
 > trap+6ac
 > mips3_user_gen_exception+d8

 I guess pcu_save() is actuually called via fpu_save(), which is called
 from mips/fp.S.
 But fp.S looks broken in here. fpu_save() expects a lwp pointer in a0
 (probably curlwp in this case), but I can't see where a0 would contain a
 lwp pointer here. It looks like a0 has the emulated instruction.

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Sevan Janiyan <venture37@geeklan.co.uk>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-cobalt/53090: lib/libc/gen/t_fpsetmask test cases panic
Date: Sun, 16 Dec 2018 02:49:40 +0000

 Also an issue on sgimips using latest daily build from HEAD.
 See port-sgimips/53791.


 Sevan

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53090 CVS commit: src/sys/arch/mips/mips
Date: Wed, 19 Dec 2018 15:10:46 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Wed Dec 19 15:10:46 UTC 2018

 Modified Files:
 	src/sys/arch/mips/mips: fp.S

 Log Message:
 Load curlwp into a0 to call fpu_save(curlwp), not fpu_save(garbage).

 The lwp argument to fpu_save was added by chuq in revision 1.14 of
 mips_fpu.c, but this call was not updated to pass it.  This is the
 correct lwp to pass because we are in the middle of executing a
 kernel-emulated fp instruction, so curlwp must own the fpu state, and
 we are trying to write the fp registers to memory so we can adjust
 them there when ctc1 would fail.

 Fixes PR port-cobalt/53090, PR port-sgimips/53791.


 To generate a diff of this commit:
 cvs rdiff -u -r1.48 -r1.49 src/sys/arch/mips/mips/fp.S

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

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53090 CVS commit: [netbsd-8] src/sys/arch/mips/mips
Date: Tue, 25 Dec 2018 11:22:43 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue Dec 25 11:22:43 UTC 2018

 Modified Files:
 	src/sys/arch/mips/mips [netbsd-8]: fp.S

 Log Message:
 Pull up following revision(s) (requested by sevan in ticket #1143):

 	sys/arch/mips/mips/fp.S: revision 1.49

 Load curlwp into a0 to call fpu_save(curlwp), not fpu_save(garbage).

 The lwp argument to fpu_save was added by chuq in revision 1.14 of
 mips_fpu.c, but this call was not updated to pass it.  This is the
 correct lwp to pass because we are in the middle of executing a
 kernel-emulated fp instruction, so curlwp must own the fpu state, and
 we are trying to write the fp registers to memory so we can adjust
 them there when ctc1 would fail.

 Fixes PR port-cobalt/53090, PR port-sgimips/53791.


 To generate a diff of this commit:
 cvs rdiff -u -r1.48 -r1.48.6.1 src/sys/arch/mips/mips/fp.S

 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.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.