From owner-freebsd-arm@freebsd.org Fri Jan 29 05:12:01 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48CC7A70F34 for ; Fri, 29 Jan 2016 05:12:01 +0000 (UTC) (envelope-from peter.garshtja@ambient-md.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC9AA1C2E for ; Fri, 29 Jan 2016 05:12:00 +0000 (UTC) (envelope-from peter.garshtja@ambient-md.com) Received: by mail-wm0-x233.google.com with SMTP id p63so52669249wmp.1 for ; Thu, 28 Jan 2016 21:12:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ambient-md-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CogeRLM2P9X4Hs76MEfS2B8Zx8g1slD7u1k/5DWEqMo=; b=NrwJ/fmJp9gS0dy6oijbOCn7Ae6jOx6FmXbi3CgCAEG25eNeG26LmlXYie3x7xs+6r PhzFWEE8ttaOSXw2M2vDRp2bVTL+89T8W4iW/9NsUUr0ugHqSufFMvWS145mI6czIh8c 8TBIWSWnjLF2UAx4p9TsJ/VzJIwIPLmO/6fVY7g3xz620gKBqfTdwFZ5+zLqnWI3hpn/ BzPJm8wexXkzzJMOJEK8ZJRluuUsHzZTckspyR0t4QsPaS/dALUj2Qn/68OBm8PqexT+ qOMFH+T64b8X8kipHffxlbfaGKpOQ0gSMdrLmh+CrS3hIElXHT1MN5kp3Z4QLLTtMSMF 7pNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=CogeRLM2P9X4Hs76MEfS2B8Zx8g1slD7u1k/5DWEqMo=; b=IYKBcrMnAF3kEJovz0GyiUbSMUzMBPy4GJbu+n0t0xoG81OPFI5fDzn9xzfr+n/vll K/mRwyNGwFnh2oX/DymghDnsIsJ4dbvvUw3g4jE0hdKQqInMltWS2KzfQlcXy7qxNrN6 G/mCzTzSCMgxDvIryt4dTeEWV22Bve2sIOz/gXo1Xv8NJCdkUnN5CUWa1L5lX8n+5V8S qLAByoSGRBOL88bJaWjWcvJ0bTcUPGQRi6g6aVAhKUu61RXdJr4jdLHO0Xok2l0e108H KEPQ5Uk/u1Ik4QpX9Gd/W7tPgGzVD+b9wFYBFgP8DGMqi/8VjHAa0bRlLAq+fp/OfQ1z 9QRg== X-Gm-Message-State: AG10YOSk7t5X+rka6+6lL/kg3txSSjaO3tZZyA+JDQPisIM8C+l1KjfZigU3MjBEmAVFIh5YoyJeEA+6jnt4fg== MIME-Version: 1.0 X-Received: by 10.194.250.39 with SMTP id yz7mr7424169wjc.92.1454044319336; Thu, 28 Jan 2016 21:11:59 -0800 (PST) Received: by 10.27.157.71 with HTTP; Thu, 28 Jan 2016 21:11:59 -0800 (PST) X-Originating-IP: [69.17.234.186] In-Reply-To: References: <1453862939.42081.25.camel@freebsd.org> <1453867724.42081.28.camel@freebsd.org> <1453903433.42081.30.camel@freebsd.org> Date: Fri, 29 Jan 2016 00:11:59 -0500 Message-ID: Subject: Re: [Bug 206658] Bus error for pfctl -sa on rpi2 r294499 snap From: peter garshtja To: Jov Cc: Guy Yur , "freebsd-pf@freebsd.org" , freebsd-arm , Ian Lepore Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 05:12:01 -0000 Much appreciated for your effort. I have been waiting for this fix over 3months. Regards On Thursday, January 28, 2016, Jov wrote: > This patch works=EF=BC=8Cthanks very much ! > > will these patches to be commited to the offical svn? I add freebsd-pf ML= . > > > Jov > blog: http:amutu.com/blog > > 2016-01-29 5:26 GMT+08:00 Guy Yur >: > > > Hi, > > > > On Thu, Jan 28, 2016 at 2:06 PM, Jov > > wrote: > > > bus error at the similar position: > > > > > > Program received signal SIGBUS, Bus error. > > > 0x00021614 in print_host (addr=3D0x2065111a, port=3D15268, af=3D2 '\0= 02', > > > opts=3D1024) at /usr/src/sbin/pfctl/pf_print_state.c:178 > > > warning: Source file is more recent than executable. > > > > > > 178 memcpy(&aw.v.a.addr, addr, sizeof(aw.v.a.addr)); > > > Current language: auto; currently minimal > > > (gdb) p addr > > > $1 =3D (struct pf_addr *) 0x2065111a > > > ... > > > > > > Jov > > > > The compiler optimizes the memcpy to a series of ldr and str > > instructions and since addr is unaligned you still get SIGBUS. > > > > I encountered the same problem on a BeagleBone Black. > > https://lists.freebsd.org/pipermail/freebsd-arm/2014-January/007237.htm= l > > > > non-intrustive patch with changes only in print_state() > > pfsync_state is __packed so the keys can be copied safely to > > stack variables which will be aligned (and addr inside it). > > > > > https://github.com/guyyur/freebsd-src_patches/blob/master/pfctl_arm_segbu= s__ver1_part1.patch > > > > Bug report with patch to separate pfsync and pfioc state > > structures but breaks backward compatibility: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D185617 > > > > -- Guy > > > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org > "