From owner-freebsd-hackers Thu Mar 23 10:29:58 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id DC71037C4EB for ; Thu, 23 Mar 2000 10:29:54 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id KAA02591; Thu, 23 Mar 2000 10:29:52 -0800 (PST) (envelope-from dillon) Date: Thu, 23 Mar 2000 10:29:52 -0800 (PST) From: Matthew Dillon Message-Id: <200003231829.KAA02591@apollo.backplane.com> To: Jim Mercer Cc: hackers@FreeBSD.ORG Subject: Doh, compiler bug... (was Re: possible bug in kernel/if_ether.c) References: <20000322225639.T983@reptiles.org> <200003230515.VAA96507@apollo.backplane.com> <20000323054731.W983@reptiles.org> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 : cmpl $0x7,0xc(%ebx) :0xc0199798 : ja 0xc01997c8 :0xc019979a : pushl $0x8 :0xc019979c : pushl %ebx (m = m_pullup(m, sizeof(struct arphdr)) == NULL)) { :0xc019979d : call 0xc016e4b8 :0xc01997a2 : addl $0x8,%esp :0xc01997a5 : testl %eax,%eax :0xc01997a7 : sete %al :0xc01997aa : movzbl %al,%ebx BING BING BING! :0xc01997ad : 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 : je 0xc01997c8 :0xc01997b1 : pushl $0xc024bae0 :0xc01997b6 : pushl $0x3 :0xc01997b8 : call 0xc015f524 :0xc01997bd : addl $0x8,%esp :0xc01997c0 : jmp 0xc0199731 :0xc01997c5 : leal 0x0(%esi),%esi :0xc01997c8 : movl 0x8(%ebx),%ecx <------------ :0xc01997cb : movzwl (%ecx),%eax :0xc01997ce : xchgb %ah,%al :0xc01997d0 : cmpw $0x1,%ax To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message