NetBSD Problem Report #54233

From www@netbsd.org  Sun May 26 12:58:02 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 CEE147A159
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 26 May 2019 12:58:01 +0000 (UTC)
Message-Id: <20190526125801.0045A7A1E0@mollari.NetBSD.org>
Date: Sun, 26 May 2019 12:58:00 +0000 (UTC)
From: coypu@sdf.org
Reply-To: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Subject: 32bit compat gdb works poorly
X-Send-Pr-Version: www-1.0

>Number:         54233
>Category:       toolchain
>Synopsis:       32bit compat gdb works poorly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mgorny
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 26 13:00:00 +0000 2019
>Last-Modified:  Sun May 26 20:25:00 +0000 2019
>Originator:     coypu
>Release:        NetBSD 8.99.41
>Organization:
>Environment:
NetBSD plu 8.99.41 NetBSD 8.99.41 (GENERIC) #0: Thu May 23 18:48:19 IDT 2019  fly@plu:/home/fly/obj/sys/arch/amd64/compile/GENERIC amd64

>Description:
Either pkgsrc or base gdb is not very good.
It doesn't have the ability even to disassemble where it is.

> cat test8.c
#include <stdio.h>
int main() {
	printf("Hello world\n");
	return 0;
}
> gcc test8.c -m32
> gdb -q ./a.out
Reading symbols from ./a.out...(no debugging symbols found)...done.
(gdb) b main
Breakpoint 1 at 0x804887a
(gdb) r
Starting program: /home/fly/a.out 
warning: `/usr/libexec/ld.elf_so': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
warning: `/usr/libexec/ld.elf_so': Shared library architecture i386:x86-64 is not compatible with target architecture i386.
Couldn't read debug registers: No such file or directory.
(gdb) disas
No function contains program counter for selected frame.
(gdb) x/i $pc
=> 0x45e187:	Cannot access memory at address 0x45e187
(gdb) c
Continuing.
Couldn't read debug registers: No such file or directory.
(gdb) c
Continuing.
Couldn't read debug registers: No such file or directory.
(gdb) c
Continuing.

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: toolchain-manager->mgorny
Responsible-Changed-By: mgorny@NetBSD.org
Responsible-Changed-When: Sun, 26 May 2019 20:08:14 +0000
Responsible-Changed-Why:
I will attempt to fix missing compat32 code.


From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: =?utf-8?B?TWljaGHFgiBHw7Nybnk=?= <mgorny@netbsd.org>,
 toolchain-manager@netbsd.org,
 netbsd-bugs@netbsd.org,
 gnats-admin@netbsd.org,
 coypu@sdf.org
Subject: Re: toolchain/54233 (32bit compat gdb works poorly)
Date: Sun, 26 May 2019 16:11:10 -0400

 I think that the problem is partially within gdb...

 christos

 > On May 26, 2019, at 4:08 PM, mgorny@netbsd.org <mgorny@NetBSD.org> wrote:
 > 
 > Synopsis: 32bit compat gdb works poorly
 > 
 > Responsible-Changed-From-To: toolchain-manager->mgorny
 > Responsible-Changed-By: mgorny@NetBSD.org
 > Responsible-Changed-When: Sun, 26 May 2019 20:08:14 +0000
 > Responsible-Changed-Why:
 > I will attempt to fix missing compat32 code.
 > 
 > 

From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= <mgorny@gentoo.org>
To: Christos Zoulas <christos@zoulas.com>, gnats-bugs@netbsd.org
Cc: toolchain-manager@netbsd.org, netbsd-bugs@netbsd.org, 
	gnats-admin@netbsd.org, coypu@sdf.org
Subject: Re: toolchain/54233 (32bit compat gdb works poorly)
Date: Sun, 26 May 2019 22:20:40 +0200

 --=-qdsQUkJSppjCW2YioBhz
 Content-Type: text/plain; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable

 On Sun, 2019-05-26 at 16:11 -0400, Christos Zoulas wrote:
 > I think that the problem is partially within gdb...
 >=20

 It's possible.  However, I certainly do see that dbreg operations are
 commented out in compat32, so I'll try to fix at least that.

 --=20
 Best regards,
 Micha=C5=82 G=C3=B3rny


 --=-qdsQUkJSppjCW2YioBhz
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: This is a digitally signed message part
 Content-Transfer-Encoding: 7bit

 -----BEGIN PGP SIGNATURE-----

 iQGTBAABCgB9FiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAlzq9RhfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEM3
 NkE4NDUwOTQwOThEMjhDQzhCMjZDNTYzOUFEQUUyMzI5RTI0MEUACgkQY5ra4jKe
 JA6OrggAqlmcPeGN6usea9awNCoTrFCVHSPHVO6yGttorM9Gf7a0wY8xXt5qPv3X
 jbH/rr+4A/SXi4pOh6xH0fwcUFNUEGN+QmjKO5pn1vsiPNmKt69lwML3DDlfOaxw
 Vr4poLVO85TugkmDN3GRXJASX+FA3R3ERBqIsJNmWvOcPLiKafphEPruerUFAbR5
 +3ZxkIQ5mTqhYk0DM1T/TpadlzXAy9LNOTjTga5N5Z/zCGBiMTfboC5MR2qwJ2fN
 uOvWl34kOvWrPQY6XAfnGpUdEUJQRtYUA9hKHSPuv4PC04K6BQc8wbztaAgvMJ6v
 jDLvdj11SCOlPcJxjgweQx9FRweF/Q==
 =HV6k
 -----END PGP SIGNATURE-----

 --=-qdsQUkJSppjCW2YioBhz--

>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.