bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug located (was: Re: gdb, libio, readline


From: Marcus Brinkmann
Subject: bug located (was: Re: gdb, libio, readline
Date: Sun, 31 Mar 2002 01:59:56 +0100
User-agent: Mutt/1.3.27i

Hi,

ok, here is some hard data.  It turns out that the comparison:
   *(int *) &msg.error.err_type == *(int *) &inttype

is failing, with the correct number 268509186 on the left hand and a bogus
number 65536 on the right hand.

So it seems that this construct doesn't work with inttype, which is:
          const mach_msg_type_t inttype =
            { MACH_MSG_TYPE_INTEGER_T, sizeof (MACH_MSG_TYPE_INTEGER_T) * 8,
              1, 1, 0, 0 };

The 65536 comes from $ecx, and I couldn't find out where this is loaded.  I
guess that this is optimized and merged with other constants with the same
value, so it is pretty obscure.  Anyway, I am attaching a tar file
containing my modified source (just split up the if condition), and all
intermediate files .i, .s and the produces shared object so you have all
data that might be relevant.  A gdb dump of the important run time data is
below.  Is this a gcc bug?

Thanks,
Marcus

Breakpoint 1, _hurd_select (nfds=1, pollfds=0x81dbba0, readfds=0x0, 
writefds=0x0, exceptfds=0x0,
    timeout=0x0, sigmask=0x0) at hurdselect.c:312
312                     if (*(int *) &msg.error.err_type == *(int *) &inttype)
(gdb) print msg
$16 = {head = {msgh_bits = 4352, msgh_size = 40, msgh_remote_port = 0, 
msgh_local_port = 121,
    msgh_seqno = 0, msgh_id = 21112}, error = {head = {msgh_bits = 4352, 
msgh_size = 40,
      msgh_remote_port = 0, msgh_local_port = 121, msgh_seqno = 0, msgh_id = 
21112}, err_type = {
      msgt_name = 2, msgt_size = 32, msgt_number = 1, msgt_inline = 1, 
msgt_longform = 0,
      msgt_deallocate = 0, msgt_unused = 0}, err = 0}, success = {head = 
{msgh_bits = 4352,
      msgh_size = 40, msgh_remote_port = 0, msgh_local_port = 121, msgh_seqno = 
0,
      msgh_id = 21112}, err_type = {msgt_name = 2, msgt_size = 32, msgt_number 
= 1,
      msgt_inline = 1, msgt_longform = 0, msgt_deallocate = 0, msgt_unused = 
0}, err = 0,
    result_type = {msgt_name = 2, msgt_size = 32, msgt_number = 1, msgt_inline 
= 1,
      msgt_longform = 0, msgt_deallocate = 0, msgt_unused = 0}, result = 1}}
(gdb) x/2i $eip
0x10b811d <_hurd_select+2901>:  cmp    %ecx,0xffffff70(%ebp)
0x10b8123 <_hurd_select+2907>:  jne    0x10b80c7 <_hurd_select+2815>
(gdb) info reg
eax            0x10000  65536
ecx            0x10000  65536
edx            0x28     40
ebx            0x11fcac4        18860740
esp            0x1024670        0x1024670
ebp            0x1024828        0x1024828
esi            0x1100   4352
edi            0x0      0
eip            0x10b811d        0x10b811d
eflags         0x206    518
cs             0x17     23
ss             0x1f     31
ds             0x1f     31
es             0x1f     31
fs             0x1f     31
gs             0x1f     31
fctrl          0x0      0
fstat          0x0      0
ftag           0x0      0
fiseg          0x0      0
fioff          0x0      0
foseg          0x0      0
fooff          0x0      0
fop            0x0      0
(gdb) print *(int *) ($ebp + (int)0xffffff70)
$20 = 268509186
(gdb) print (*(int *) &msg.error.err_type)
$54 = 268509186

BTW: 26509186 == 0x10012002

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de

Attachment: hurdselect.tgz
Description: GNU Unix tar archive


reply via email to

[Prev in Thread] Current Thread [Next in Thread]