🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #2087

Problem with 4.18 on sparc running suse-linux

#2087
From: Jeff Graham
Date: Mon, 06 May 2002 23:17
146 lines
5854 bytes
This is a multi-part message in MIME format.

------=_NextPart_000_0045_01C1F519.76442710
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi I am looking for a fix for a problem we are seeing with SuSE 7.3
sparc.  It occurs on the package that comes with SuSE 7.3 iso images
(4.18)

I am attaching a sample source file for recreating the problem.  I am
looking for a fix or work around.

Below, please see a description of the issue.

Here is the text describing the bug (this is also included in the source

comments):

Sample program that shows a bug in gdb.  The bug is described from a C
language perspective as well as from a machine language perspective (the
latter will help the implementor in isolating the cause of the problem)

The bug in terms of "C":
Single stepping through this statement (val1 == 
0x00000200):

      byte = (val1 & 0x00007f00) >> 8;

causes byte to be assigned the incorrect value of 0x00 when it should
have been assigned 0x02.


The bug in terms of Sparc machine code:
Single stepping on a Shift Right Logical overwrites %o0 -
the "srl %o0, 8, %o1" instruction changes the value of %o0
(to 0) during srl execution, resulting in both %o0 and %o1
to contain 0 (they should contain 0x0200 and 0x2 respectively).


Conditions for the bug:

1) this behavior is manifested only when single stepping through the
line described (step or next)

2) this only happens if the value being shifted is 0x0200!!! Try any
other value (single step ok) and it works..

compiled with "gcc -g gbug.c"

-- 
Jeff Graham <jgraham@silverbacksystems.com> Manager IT   (408) 376-1350
Silverback Systems
695 Campbell Technology Parkway, Suite 150
Campbell, CA 95008


------=_NextPart_000_0045_01C1F519.76442710
Content-Type: text/x-vcard;
	name="Jeffery A. Graham.vcf"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="Jeffery A. Graham.vcf"

BEGIN:VCARD
VERSION:2.1
N:Graham;Jeffery;A.
FN:Jeffery A. Graham
ORG:Silverback Systems;IT
TITLE:Manager IT
TEL;WORK;VOICE:(408) 376-1350
TEL;CELL;VOICE:(650) 814-6676
TEL;WORK;FAX:(408) 376-1399
ADR;WORK;ENCODING=3DQUOTED-PRINTABLE:;;695 Campbell Technology =
Parkway=3D0D=3D0ASuite 150;Campbell;CA;95008;United St=3D
ates of America
LABEL;WORK;ENCODING=3DQUOTED-PRINTABLE:695 Campbell Technology =
Parkway=3D0D=3D0ASuite 150=3D0D=3D0ACampbell, CA 95008=3D0D=3D
=3D0AUnited States of America
URL;WORK:http://www.silverbacksystems.com
EMAIL;PREF;INTERNET:jgraham@silverbacksystems.com
REV:20020123T215401Z
END:VCARD

------=_NextPart_000_0045_01C1F519.76442710
Content-Type: application/octet-stream;
	name="gbug.c"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="gbug.c"

// Sample program that shows a bug in gdb.  The bug is described=0A=
// from a C language perspective as well as from a machine=0A=
// language perspective (the latter will help the implementor=0A=
// in isolating the cause of the problem)=0A=
//=0A=
// The bug in terms of "C"=0A=
// Single stepping through this statement:=0A=
//      byte =3D (val1 & 0x00007f00) >> 8;=0A=
// causes byte to be assigned the incorrect value of 0x00 when it=0A=
// should have been assigned 0x02.=0A=
//=0A=
// The bug in terms of sparc machine code:=0A=
// Single stepping on a Shift Right Logical overwrites %o0 -=0A=
// the "srl %o0, 8, %o1" instruction changes the value of %o0=0A=
// to 0 during srl execution, resulting in both %o0 and %o1 =0A=
// to contain 0 (they should contain 0x0200 and 0x2 respectively).=0A=
//=0A=
// Conditions for the bug:=0A=
//=0A=
// 1) this behavior is manifested only when single stepping=0A=
// thru the program (step or next)=0A=
//=0A=
// 2) this only happens if the value being shifted is 0x0200!!!=0A=
// Try any other value (single step ok) and it works..=0A=
//=0A=
// compiled with "gcc -g gbug.c"=0A=
//=0A=
=0A=
#include "stdio.h"=0A=
=0A=
int main(int argc, char* argv[])=0A=
{=0A=
    unsigned long   val1 =3D 0x00000200;      // we want to extract 02 - =
fails=0A=
    unsigned long   val2 =3D 0x00001200;      // we want to extract 12 - =
works!=0A=
    unsigned char   byte;=0A=
=0A=
    byte =3D 0;=0A=
=0A=
    /*************start-line-that-fails-if-single-stepping**********/=0A=
    byte =3D (val1 & 0x00007f00) >> 8;=0A=
    /***************end-line-that-fails-if-single-stepping*********/=0A=
=0A=
    printf("byte =3D %02x\n", byte);=0A=
=0A=
    byte =3D (val2 & 0x00007f00) >> 8;=0A=
    printf("byte =3D %02x\n", byte);=0A=
=0A=
    return 0;=0A=
}=0A=
=0A=

------=_NextPart_000_0045_01C1F519.76442710--
Technical Details
Message-ID: <004401c1f554$22a2ff10$1d10000a@corp.silverbacksystems.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,891225e18f0a193a,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 2002-05-06 16:17:15 PST
x-uunet-gateway: mr0.ash.ops.us.uu.net from bug-gdb to gnu.gdb.bug; Mon, 6 May 2002 23:17:14 GMT
From: "Jeff Graham" <jgraham@silverbacksystems.com>
Subject: Problem with 4.18 on sparc running suse-linux
Date: Mon, 6 May 2002 16:17:04 -0700
Message-ID: <004401c1f554$22a2ff10$1d10000a@corp.silverbacksystems.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="----=_NextPart_000_0045_01C1F519.76442710"
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.3416
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Approved: bug-gdb-request@mail.gnu.org
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb
Sender: bug-gdb-request@mail.gnu.org
Lines: 147