From owner-freebsd-pf@freebsd.org Fri Jan 29 04:20:06 2016 Return-Path: Delivered-To: freebsd-pf@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 D737DA728B5 for ; Fri, 29 Jan 2016 04:20:06 +0000 (UTC) (envelope-from amutu@amutu.com) Received: from mail-yk0-x233.google.com (mail-yk0-x233.google.com [IPv6:2607:f8b0:4002:c07::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 935D915B5 for ; Fri, 29 Jan 2016 04:20:06 +0000 (UTC) (envelope-from amutu@amutu.com) Received: by mail-yk0-x233.google.com with SMTP id r207so12876825ykd.2 for ; Thu, 28 Jan 2016 20:20:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amutu-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=IOQPgvIevE77/UBBpBRk/cNAfLYag8FQZgdVSr8/K2Q=; b=0rZD7v2liO8cvHteIBTl1Ee+Wsq7FNm3hui57NNx08UNZXtiGWBeK6eoIyrh5Uziry vXjfXBE/lpZrQNx5MpaKwVrJwNNwnXGKNU8WFTg56nZPtt/ECFE5apWCYvRGOsShdqcq +9p6aCFjuv7m1Vy/MQUuaCi7/Me/69OMAY4hee6bZUzMpls04v9GQ+49U0qEKYASO0/8 OYI2RZMc4pOEGgnROGA2cmZYU+0TnBmzMbhEIl9am5ItNkII3zu1AUmNXL0Iid+pwawF on3MaXWJTaodVXjuCN6q1DDGLj6WoXa/yVM3+jCOcDN05398Io/lQp3RQK2jRxGM+Qcm 7p7w== 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:from:date :message-id:subject:to:cc:content-type; bh=IOQPgvIevE77/UBBpBRk/cNAfLYag8FQZgdVSr8/K2Q=; b=h5LgYYrDo0tAIChmFXsPb9GBLQTD1VBA4vbiBcgPP0B9vcyU/hHqxOHfKQXk7oJhaj IZM2rTAuT9GreKrYdOl8fxbeB/oJXAX07WZ1mXovnawY7I5ss12TprjbONo/aEn79/YU RRosG50nqDg9wmu6qQhhZZkgYWNFtrpF7tJuS4clTKJaFYTj56Fqk7UlUTGkaingyTgQ LMU7okWu2jg6nGandIwBFtmSZoVom+W8mIWu0u7B67pTn4pFma2UsCQjeZVzOnZYZHta vwuudsorHOZnEFjIR/D0RmWUlCwM8/QoDGfXXmXxdU2c05xuXOddr4KbXXpRlb+4/4nf qyvg== X-Gm-Message-State: AG10YOS3P97OfviGsF/EnOKLF+8f3780cjm4f12Uqe3/HaJ8k7oKq4T5CM2XwzxxQ9WziQ== X-Received: by 10.129.4.131 with SMTP id 125mr3370048ywe.253.1454041205090; Thu, 28 Jan 2016 20:20:05 -0800 (PST) Received: from mail-yk0-f169.google.com (mail-yk0-f169.google.com. [209.85.160.169]) by smtp.gmail.com with ESMTPSA id p63sm10986901ywf.8.2016.01.28.20.20.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2016 20:20:04 -0800 (PST) Received: by mail-yk0-f169.google.com with SMTP id r207so12876382ykd.2; Thu, 28 Jan 2016 20:20:03 -0800 (PST) X-Received: by 10.129.91.132 with SMTP id p126mr3510772ywb.188.1454041203768; Thu, 28 Jan 2016 20:20:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.79.6 with HTTP; Thu, 28 Jan 2016 20:19:44 -0800 (PST) In-Reply-To: References: <1453862939.42081.25.camel@freebsd.org> <1453867724.42081.28.camel@freebsd.org> <1453903433.42081.30.camel@freebsd.org> From: Jov Date: Fri, 29 Jan 2016 12:19:44 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [Bug 206658] Bus error for pfctl -sa on rpi2 r294499 snap To: Guy Yur , freebsd-pf@freebsd.org Cc: Ian Lepore , freebsd-arm Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 04:20:06 -0000 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 '\002= ', > > 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.html > > 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 > From owner-freebsd-pf@freebsd.org Fri Jan 29 05:12:02 2016 Return-Path: Delivered-To: freebsd-pf@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 147F5A70F39 for ; Fri, 29 Jan 2016 05:12:02 +0000 (UTC) (envelope-from peter.garshtja@ambient-md.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (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 9CE441C30 for ; Fri, 29 Jan 2016 05:12:01 +0000 (UTC) (envelope-from peter.garshtja@ambient-md.com) Received: by mail-wm0-x22c.google.com with SMTP id p63so52943092wmp.1 for ; Thu, 28 Jan 2016 21:12:01 -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=cTSDDNEeLnt1btSwOS6RP5rPHeMuDxJOpuy+jeolBZpZB2vvw5tFrAsTQgviobTeI4 ri0RwcLOn+aw/uoDuOYCMEpMfS0xCnrjJjSXtJCJQSHq06ra5DB/9s+BaSC8VZ6pse+b 9Py89JdnwrIJzw/FgorTDHhvMsHjbxCOPhb/7x5kxRJPgF0aOBeESu+1M/Qkyw7ZPLh/ 1LNATdIq6HFq2Uv8WxOV0q30m8YXahiLM5HR5mAP5Fhpo79aGK+cGcJDHc1w5+BDq8DR Q5s1UorczRGHPh/fjXAygrqWO/TTWcs1pIzIglnYBgcVBHCrU99YPCqWb7ARniwpnwMF 50xA== X-Gm-Message-State: AG10YOQJAdZ4uzoRrvqY1LlqwuysKmW1i2bKM9ApxSqi6EkfrXX+y13LZVcBIMA+jnmByFTju8nlOq5toVFD8w== 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-pf@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2016 05:12:02 -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 > " From owner-freebsd-pf@freebsd.org Sat Jan 30 22:03:31 2016 Return-Path: Delivered-To: freebsd-pf@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 4CF17A737CE for ; Sat, 30 Jan 2016 22:03:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E58D99E for ; Sat, 30 Jan 2016 22:03:31 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UM3VZw086237 for ; Sat, 30 Jan 2016 22:03:31 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-pf@FreeBSD.org Subject: [Bug 185617] pfctl(8): armv6: "pfctl -s state" crashes on BeagleBone Black due to unaligned access Date: Sat, 30 Jan 2016 22:03:31 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@freebsd.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-pf@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 22:03:31 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D185617 --- Comment #3 from commit-hook@freebsd.org --- A commit references this bug: Author: ian Date: Sat Jan 30 22:03:15 UTC 2016 New revision: 295086 URL: https://svnweb.freebsd.org/changeset/base/295086 Log: Make pfctl(8) work on strict-alignment platforms, by copying a pair of embedded structures out of a packed, unaligned struct into local copies on the stack which are aligned. The original patch to do this was submitted by Guy Yur , and this is conceptually the same change, but restructured with the #ifndef __NO_STRICT_ALIGNMENT wrapper, similar to how the same issue is handled in the kernel pf code. PR: 185617 PR: 206658 Changes: head/sbin/pfctl/pf_print_state.c --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-pf@freebsd.org Sat Jan 30 22:09:41 2016 Return-Path: Delivered-To: freebsd-pf@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 1A27EA73983 for ; Sat, 30 Jan 2016 22:09:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B6CAC2C for ; Sat, 30 Jan 2016 22:09:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u0UM9edG094644 for ; Sat, 30 Jan 2016 22:09:40 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-pf@FreeBSD.org Subject: [Bug 185617] pfctl(8): armv6: "pfctl -s state" crashes on BeagleBone Black due to unaligned access Date: Sat, 30 Jan 2016 22:09:41 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: ian@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-pf@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 22:09:41 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D185617 Ian Lepore changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ian@FreeBSD.org --- Comment #4 from Ian Lepore --- While r295086 fixes the crash on strict-alignment platforms, I am not going= to close this bug. Instead, I leave it to the networking gurus to evaluate the patch referenced in comment #2. I don't know enough about pf and networkin= g in general to evaluate the tradeoffs in restructuring the, umm, structures. --=20 You are receiving this mail because: You are the assignee for the bug.= From owner-freebsd-pf@freebsd.org Sat Jan 30 22:14:24 2016 Return-Path: Delivered-To: freebsd-pf@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 D0783A73B7B for ; Sat, 30 Jan 2016 22:14:24 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4CECEB7 for ; Sat, 30 Jan 2016 22:14:24 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sat, 30 Jan 2016 22:15:20 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u0UMEG21002051; Sat, 30 Jan 2016 15:14:16 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1454192055.32550.8.camel@freebsd.org> Subject: Re: [Bug 206658] Bus error for pfctl -sa on rpi2 r294499 snap From: Ian Lepore To: peter garshtja , Jov Cc: freebsd-arm , "freebsd-pf@freebsd.org" Date: Sat, 30 Jan 2016 15:14:15 -0700 In-Reply-To: References: <1453862939.42081.25.camel@freebsd.org> <1453867724.42081.28.camel@freebsd.org> <1453903433.42081.30.camel@freebsd.org> Content-Type: text/plain; charset="iso-2022-jp" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jan 2016 22:14:25 -0000 FYI, I've committed r295086, which is conceptually the patch submitted by Guy Yur, but restructured with an #ifndef __NO_STRICT_ALIGNMENT wrapper, and in general more like the corresponding code on the kernel side for handling this. Could somebody who uses pf please give this a test and let me know if it works right? (It *looks* right, but... you know.) If it works I should get it MFC'd before the 10.3 release. -- Ian On Fri, 2016-01-29 at 00:11 -0500, peter garshtja wrote: > 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,thanks 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=0x2065111a, port=15268, af=2 > > > > '\002', > > > > opts=1024) 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 = (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/0072 > > > 37.html > > > > > > 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 > > _segbus__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=185617 > > > > > > -- 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 > > " > _______________________________________________ > 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 > " >