NetBSD Problem Report #54309

From www@netbsd.org  Wed Jun 19 10:25:10 2019
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 C65687A153
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 19 Jun 2019 10:25:09 +0000 (UTC)
Message-Id: <20190619102508.D74A07A1E0@mollari.NetBSD.org>
Date: Wed, 19 Jun 2019 10:25:08 +0000 (UTC)
From: coypu@sdf.org
Reply-To: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Subject: gdb doesn't work on mips64 (32bit userland, 64bit kernel)
X-Send-Pr-Version: www-1.0

>Number:         54309
>Category:       port-mips
>Synopsis:       gdb doesn't work on mips64 (32bit userland, 64bit kernel)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-mips-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 19 10:30:00 +0000 2019
>Closed-Date:    Wed Jun 19 16:14:33 +0000 2019
>Last-Modified:  Wed Jun 19 16:14:33 +0000 2019
>Originator:     coypu
>Release:        NetBSD 8.99.45
>Organization:
>Environment:
NetBSD lite 8.99.45 NetBSD 8.99.45 (ERLITE) #0: Tue Jun 18 16:46:03 UTC 2019  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbmips/compile/ERLITE evbmips
>Description:
# ktruss -i -o /tmp/out gdb -q /usr/pkg/bin/sudo
Reading symbols from /usr/pkg/bin/sudo...
(No debugging symbols found in /usr/pkg/bin/sudo)
(gdb) r
Starting program: /usr/pkg/bin/sudo 
ptrace: Invalid argument.
(gdb) quit
A debugging session is active.

        Inferior 1 [process 29224] will be killed.

Quit anyway? (y or n) y
# kdump /tmp/out |grep ptrace
 29224      1 gdb      CALL  netbsd32_ptrace(PT_TRACE_ME,0,0,0)
 29224      1 gdb      RET   netbsd32_ptrace 0, 2013919680/0x7809f9c0
 28983      1 gdb      CALL  netbsd32_ptrace(PT_GET_PROCESS_STATE,0x7228,0x7fff6db8,8)
 28983      1 gdb      RET   netbsd32_ptrace 0, 65535/0xffff
 28983      1 gdb      CALL  netbsd32_ptrace(PT_GET_SIGINFO,0x7228,0x7fff6ed0,0x88)
 28983      1 gdb      RET   netbsd32_ptrace -1 errno 22 Invalid argument
       "ptrace: Invalid argument."
kdump: Unhandled size 168 for ktrpsig
kdump: Unhandled size 168 for ktrpsig
 28983      1 gdb      CALL  netbsd32_ptrace(PT_KILL,0x7228,0,0)
 28983      1 gdb      RET   netbsd32_ptrace 0, 8

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-mips/54309: gdb doesn't work on mips64 (32bit userland,
 64bit kernel)
Date: Wed, 19 Jun 2019 15:10:11 +0000

 gdb.old doesn't work either with the same kernel, 8.99.45.

 This is a regression since Jan 2018, when I could run a debugger for PR
 52914.

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@netbsd.org, port-mips-maintainer@netbsd.org, 
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, coypu@sdf.org
Cc: 
Subject: Re: port-mips/54309: gdb doesn't work on mips64 (32bit userland, 64bit kernel)
Date: Wed, 19 Jun 2019 11:27:56 -0400

 On Jun 19,  3:15pm, coypu@sdf.org (coypu@sdf.org) wrote:
 -- Subject: Re: port-mips/54309: gdb doesn't work on mips64 (32bit userland, 

 | The following reply was made to PR port-mips/54309; it has been noted by GNATS.
 | 
 | From: coypu@sdf.org
 | To: gnats-bugs@netbsd.org
 | Cc: 
 | Subject: Re: port-mips/54309: gdb doesn't work on mips64 (32bit userland,
 |  64bit kernel)
 | Date: Wed, 19 Jun 2019 15:10:11 +0000
 | 
 |  gdb.old doesn't work either with the same kernel, 8.99.45.
 |  
 |  This is a regression since Jan 2018, when I could run a debugger for PR
 |  52914.

 What kernel does it work with? What is the failure mode?

 Thanks,

 christos

From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-mips/54309: gdb doesn't work on mips64 (32bit userland,
 64bit kernel)
Date: Wed, 19 Jun 2019 16:03:02 +0000

 This seems to do the trick.

 diff --git a/sys/compat/sys/siginfo.h b/sys/compat/sys/siginfo.h
 index 47a1476b9c..45e4c53d6d 100644
 --- a/sys/compat/sys/siginfo.h
 +++ b/sys/compat/sys/siginfo.h
 @@ -72,6 +72,13 @@ struct __ksiginfo32 {
                         int32_t _band;
                         int _fd;
                 } _poll;
 +
 +               struct {
 +                       int     _sysnum;
 +                       int     _retval[2];
 +                       int     _error;
 +                       uint64_t _args[8]; /* SYS_MAXSYSARGS */
 +               } _syscall;
         } _reason;
  };


State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Wed, 19 Jun 2019 16:14:33 +0000
State-Changed-Why:
Fixed.


>Unformatted:

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.