From owner-freebsd-arm@freebsd.org Sun Jan 31 01:10:47 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 99B2AA73688 for ; Sun, 31 Jan 2016 01:10:47 +0000 (UTC) (envelope-from amutu@amutu.com) Received: from mail-yk0-x235.google.com (mail-yk0-x235.google.com [IPv6:2607:f8b0:4002:c07::235]) (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 4E32212D2 for ; Sun, 31 Jan 2016 01:10:47 +0000 (UTC) (envelope-from amutu@amutu.com) Received: by mail-yk0-x235.google.com with SMTP id z13so11662337ykd.0 for ; Sat, 30 Jan 2016 17:10:47 -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:date:message-id:subject:from:to :cc:content-type; bh=65ELIXpSJadz2NkXOz/JtajFJSntq6340Z2xkFfN+eg=; b=gVHTYaGzsiV6DS0RFMcho5NkeobxfXsGrQnajxC3m8yZcRlLeDfJUytqhx4U4Gumve 4x09TGvdjBT4sVPr7HNGR2NaHB7cKCxEgZ/ESPjglGbHvJ7ttlvmgMJux0+z3tihea2/ x9ABusY0GqdWKHILkrmItO2/FE1TzRZzZJfmm9MJO8JiClxnEqYVfjqVSHWc64aykZJ/ ylp7xk1MuKxB/+RveLwVIxwv/4iT38HTmFwszCy+Mx8tXd/gy8L37PQ68HtPDOzkJq78 z2b/+xL1aQL/2UjViKwqvqLBIE9LZnNS57FafiN04+9wc10+A+JZ6CQgdfM9mDuwgEis EffQ== 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=65ELIXpSJadz2NkXOz/JtajFJSntq6340Z2xkFfN+eg=; b=Y0Cuf0B0sxFm95mhtXRlHqUHRKli/h3ptMpjFNpWnajS03TLiotu+K/F1k+CGYizMI 5C4ciGwyo+87U408gGZakBKPu0jDd+YqVgT4Ifui6rdmnm2LP/b3GZb7KLybs3NNVUKJ bxBOIlqJ4/aLZdIwSVN6/AMTO+IDff+VRnY6cPEID7/U7a0+jdL3LPMT2cJA6dSogw7U teYk+TV6WyT1Ff5NO7jmWVzm79Tmc3exD27OHF5vtAZR8P82mJW1HRuFIFHioPVt1FUL N/ROahK1lCLdGq20+0DwwH4x0uHt66Q5EhNGjcbUd5R9e+Kufe4VmG9nzAQKDZfhrAcP BUaA== X-Gm-Message-State: AG10YOT5H4mk4KCY8HB3VQAWbbS5s3hd50lY+bUDPTuQy2rouU+foQUF3XF9aXXLLIrTcQ== X-Received: by 10.37.35.136 with SMTP id j130mr2045567ybj.40.1454202646414; Sat, 30 Jan 2016 17:10:46 -0800 (PST) Received: from mail-yk0-f174.google.com (mail-yk0-f174.google.com. [209.85.160.174]) by smtp.gmail.com with ESMTPSA id v130sm17784748ywe.24.2016.01.30.17.10.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jan 2016 17:10:45 -0800 (PST) Received: by mail-yk0-f174.google.com with SMTP id a85so110003189ykb.1; Sat, 30 Jan 2016 17:10:45 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.72.70 with SMTP id v67mr6399689ywa.156.1454202644876; Sat, 30 Jan 2016 17:10:44 -0800 (PST) Received: by 10.37.79.6 with HTTP; Sat, 30 Jan 2016 17:10:44 -0800 (PST) Received: by 10.37.79.6 with HTTP; Sat, 30 Jan 2016 17:10:44 -0800 (PST) In-Reply-To: <1454192055.32550.8.camel@freebsd.org> References: <1453862939.42081.25.camel@freebsd.org> <1453867724.42081.28.camel@freebsd.org> <1453903433.42081.30.camel@freebsd.org> <1454192055.32550.8.camel@freebsd.org> Date: Sun, 31 Jan 2016 09:10:44 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [Bug 206658] Bus error for pfctl -sa on rpi2 r294499 snap From: Jov To: Ian Lepore Cc: freebsd-pf@freebsd.org, peter garshtja , 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-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: Sun, 31 Jan 2016 01:10:47 -0000 Nice,will test it. 2016=E5=B9=B41=E6=9C=8831=E6=97=A5 6:14 AM=EF=BC=8C"Ian Lepore" =E5=86=99=E9=81=93=EF=BC=9A > 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=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/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=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 > > > " > > _______________________________________________ > > 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 > > " > > >