From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 30 21:22:09 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96E3F1065700 for ; Wed, 30 Jun 2010 21:22:09 +0000 (UTC) (envelope-from sfourman@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4EE638FC22 for ; Wed, 30 Jun 2010 21:22:08 +0000 (UTC) Received: by gwj16 with SMTP id 16so869078gwj.13 for ; Wed, 30 Jun 2010 14:22:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=rAXnIRHYe+uErhS5RxenjS7J9pwe+ZrkWSVl0JfjHME=; b=QuMRr0b6c44gCzRYllqdaN7io2mRO1UNUvjY88MR/0SJXT6TKVSRj9FWbTeErWCVPu FXItP1kIG3fvT9nNsZyubZSOt39Bt26+LTg1TTV3CyVe+pYmdSFVNXEjw8YpXvCBCiD2 fR/oHlW1tYDqzlqQRBnrttijKOnGbswfBQB9E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=N2pslCWwJBDLmMc15pUp8Qdli5AusONOoIs01xnWLTWevHrxv62DpoUNqk7Bq+gMRG TITAUwZEGnTY2OwMf7QlDy2PRKOn9f63Sos0nc8CX4S4kSWOp2YI+zG/gh/flSNgOrtv lxdV+ftdtgU+dAWJl94MpOKKHg8Qie8k3HtPw= MIME-Version: 1.0 Received: by 10.229.221.72 with SMTP id ib8mr5511330qcb.0.1277932922264; Wed, 30 Jun 2010 14:22:02 -0700 (PDT) Received: by 10.229.41.203 with HTTP; Wed, 30 Jun 2010 14:22:02 -0700 (PDT) In-Reply-To: References: <20100630105027.GJ13238@deviant.kiev.zoral.com.ua> Date: Wed, 30 Jun 2010 16:22:02 -0500 Message-ID: From: "Sam Fourman Jr." To: Garrett Cooper Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Kostik Belousov , freebsd-hackers@freebsd.org Subject: Re: kernel patch needed for wine? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jun 2010 21:22:09 -0000 On Wed, Jun 30, 2010 at 11:26 AM, Garrett Cooper wrote= : > On Wed, Jun 30, 2010 at 8:43 AM, Sam Fourman Jr. wro= te: >>> Which patch ? icebp generates the SIGTRAP on latest 8-stable, verified >>> by the following trivival assembler program: >>> =A0 =A0 =A0 =A0.text >>> =A0 =A0 =A0 =A0.globl =A0main >>> main: >>> =A0 =A0 =A0 =A0.byte =A0 0xf1 >>> =A0 =A0 =A0 =A0xorl =A0 =A0%edi,%edi >>> =A0 =A0 =A0 =A0call =A0 =A0exit >>> >> Here is the C program that the linux people used as a test case. *************************************************************** #include #include void trap_handler(int sig) { printf("trapped\n"); } /* * icebp * ret */ char icebp_func[] =3D "\xf1\xc3"; typedef void (*icebp_call)(void); int main(int argc, char **argv) { icebp_call func =3D (icebp_call)icebp_func; signal(SIGTRAP, trap_handler); func(); return 0; } *************************************************************** My question is why doe the above code not print trapped on amd64? FreeBSD 8.1 i386 this code prints "Trapped" as intended FreeBSD 8.1 amd64 this code prints "Segmentation fault: 11" FreeBSD 8.1 amd64 chrooted to 32bit prints "Segmentation fault" I did verify that from Linux amd64 this works and prints "Trapped" uname -a Linux workstation 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 08:03:28 UTC 2010 x86_64 GNU/Linux Thank you much for everyones help Sam Fourman Jr. Fourman Networks http://www.fourmannetworks.com