Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Mar 2000 10:29:52 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Jim Mercer <jim@reptiles.org>
Cc:        hackers@FreeBSD.ORG
Subject:   Doh, compiler bug... (was Re: possible bug in kernel/if_ether.c)
Message-ID:  <200003231829.KAA02591@apollo.backplane.com>
References:  <20000322225639.T983@reptiles.org> <200003230515.VAA96507@apollo.backplane.com> <20000323054731.W983@reptiles.org>

next in thread | previous in thread | raw e-mail | index | archive | help
    Ok, lets see what we have here.  %ebx is NULL at the point the code fails.
    (the <------ below at c01997c8)

    %ebx is the 'm' pointer.


    if (m->m_len < sizeof(struct arphdr) &&

:0xc0199794 <arpintr+104>:       cmpl   $0x7,0xc(%ebx)
:0xc0199798 <arpintr+108>:       ja     0xc01997c8 <arpintr+156>
:0xc019979a <arpintr+110>:       pushl  $0x8
:0xc019979c <arpintr+112>:       pushl  %ebx


      (m = m_pullup(m, sizeof(struct arphdr)) == NULL)) {

:0xc019979d <arpintr+113>:       call   0xc016e4b8 <m_pullup>
:0xc01997a2 <arpintr+118>:       addl   $0x8,%esp
:0xc01997a5 <arpintr+121>:       testl  %eax,%eax
:0xc01997a7 <arpintr+123>:       sete   %al
:0xc01997aa <arpintr+126>:       movzbl %al,%ebx		BING BING BING!
:0xc01997ad <arpintr+129>:       testl  %ebx,%ebx

     The compiler is screwed.  The call to m_pullup returns the new 'm'
     pointer in %eax.  This should be copied to %ebx verbatim.

     What the frig is this 'sete' instruction?  And the movzbl ?  Move byte
     to long?

     No wonder %ebx is screwed!  The compiler is producing shit for code!
     Can one of the compiler gurus take a look at this?

     Jim, what C flags is make using when you compile up your kernel?  Are
     you trying to do weird optimizations?  I don't see anything in your
     kernel config, do you have anything weird in your /etc/make.conf[.local]?

					-Matt

:0xc01997af <arpintr+131>:       je     0xc01997c8 <arpintr+156>
:0xc01997b1 <arpintr+133>:       pushl  $0xc024bae0
:0xc01997b6 <arpintr+138>:       pushl  $0x3
:0xc01997b8 <arpintr+140>:       call   0xc015f524 <log>
:0xc01997bd <arpintr+145>:       addl   $0x8,%esp
:0xc01997c0 <arpintr+148>:       jmp    0xc0199731 <arpintr+5>
:0xc01997c5 <arpintr+153>:       leal   0x0(%esi),%esi
:0xc01997c8 <arpintr+156>:       movl   0x8(%ebx),%ecx		<------------
:0xc01997cb <arpintr+159>:       movzwl (%ecx),%eax
:0xc01997ce <arpintr+162>:       xchgb  %ah,%al
:0xc01997d0 <arpintr+164>:       cmpw   $0x1,%ax




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200003231829.KAA02591>