Re: bus error on octeon

2021-09-16 Thread Peter J. Philipp
On Wed, Sep 15, 2021 at 01:04:07PM +, Visa Hankala wrote: [cut] > > No bus errors again, though I don't know if it's the right approach. The > > nonces in the tcpdump were sequential counting up from 1 as my wireguard > > hardware was rebooting. I think I control-c'ed by 218 nonce or so. >

Re: bus error on octeon

2021-09-15 Thread Visa Hankala
On Tue, Sep 14, 2021 at 07:31:33PM +0200, Peter J. Philipp wrote: > On Tue, Sep 14, 2021 at 10:48:44AM -0600, Theo de Raadt wrote: > > Mark Kettenis wrote: > > > > > To be honest, I do think that adding __packed is a reasonable way to > > > handle protocol structs like this where performance

Re: bus error on octeon

2021-09-14 Thread Theo de Raadt
This looks right to me. Peter J. Philipp wrote: > On Tue, Sep 14, 2021 at 10:48:44AM -0600, Theo de Raadt wrote: > > Mark Kettenis wrote: > > > > > To be honest, I do think that adding __packed is a reasonable way to > > > handle protocol structs like this where performance doesn't really > >

Re: bus error on octeon

2021-09-14 Thread Peter J. Philipp
On Tue, Sep 14, 2021 at 10:48:44AM -0600, Theo de Raadt wrote: > Mark Kettenis wrote: > > > To be honest, I do think that adding __packed is a reasonable way to > > handle protocol structs like this where performance doesn't really > > matter. This translates into __attribute__((packed)) and

Re: bus error on octeon

2021-09-14 Thread Theo de Raadt
Mark Kettenis wrote: > To be honest, I do think that adding __packed is a reasonable way to > handle protocol structs like this where performance doesn't really > matter. This translates into __attribute__((packed)) and both GCC and > LLVM started treating that in a way to signal that the data

Re: bus error on octeon

2021-09-14 Thread Mark Kettenis
> Date: Tue, 14 Sep 2021 13:29:05 + > From: Visa Hankala > > On Tue, May 04, 2021 at 07:29:20AM +0200, Peter J. Philipp wrote: > > > Index: print-wg.c > > > === > > > RCS file: /cvs/src/usr.sbin/tcpdump/print-wg.c,v > > >

Re: bus error on octeon

2021-09-14 Thread Theo de Raadt
In tcpdump, we have generally used the "extract" approach rather than __packed, for various reasons including potential encapculation cases where compiler generated code has been insufficiently cynical -- meaning, __packed doesn't mean "must access everything as bytes". Visa Hankala wrote: > On

Re: bus error on octeon

2021-09-14 Thread Peter J. Philipp
On Tue, Sep 14, 2021 at 01:29:05PM +, Visa Hankala wrote: > On Tue, May 04, 2021 at 07:29:20AM +0200, Peter J. Philipp wrote: [some of my earlier mail cut] > data->nonce is the (most) offending variable because it needs 8-byte > alignment. > > An alternative to memcpy() is to use tcpdump's

Re: bus error on octeon

2021-09-14 Thread Visa Hankala
On Tue, May 04, 2021 at 07:29:20AM +0200, Peter J. Philipp wrote: > > Index: print-wg.c > > === > > RCS file: /cvs/src/usr.sbin/tcpdump/print-wg.c,v > > retrieving revision 1.6 > > diff -u -p -u -r1.6 print-wg.c > > --- print-wg.c

Re: bus error on octeon

2021-05-03 Thread Peter J. Philipp
> I produced a patch for you, but it's not complete but works around the SIGBUS: > > Index: print-wg.c > === > RCS file: /cvs/src/usr.sbin/tcpdump/print-wg.c,v > retrieving revision 1.6 > diff -u -p -u -r1.6 print-wg.c > ---

Re: bus error on octeon

2021-05-03 Thread Peter J. Philipp
On Mon, May 03, 2021 at 09:42:10AM -0600, Theo de Raadt wrote: > You didn't use a -g binary as I suggested, then gdb will show more. Apologies, I did compile with -g but since I cherry picked the source over to the router (which is extremely low on space) it installed the binary in the wrong spot

Re: bus error on octeon

2021-05-03 Thread Theo de Raadt
You didn't use a -g binary as I suggested, then gdb will show more. Peter J. Philipp wrote: > On Mon, May 03, 2021 at 08:27:57AM -0600, Theo de Raadt wrote: > > Can you reproduce this, and capture core files? > > Yes after a reboot I could reproduce it, I didn't even have to cycle the >

Re: bus error on octeon

2021-05-03 Thread Peter J. Philipp
On Mon, May 03, 2021 at 08:27:57AM -0600, Theo de Raadt wrote: > Can you reproduce this, and capture core files? Yes after a reboot I could reproduce it, I didn't even have to cycle the interfaces. I got a coredump like you descriped for me. See below: > Since our tcpdump is a privsep program,

Re: bus error on octeon

2021-05-03 Thread Peter J. Philipp
Yup I'll try. Give me bit of time to find results. Best Regards, -peter On Mon, May 03, 2021 at 08:27:57AM -0600, Theo de Raadt wrote: > Can you reproduce this, and capture core files? > > Since our tcpdump is a privsep program, getting a core is a bit harder. > > mkdir /var/crash/tcpdump >

Re: bus error on octeon

2021-05-03 Thread Theo de Raadt
Can you reproduce this, and capture core files? Since our tcpdump is a privsep program, getting a core is a bit harder. mkdir /var/crash/tcpdump echo kern.nosuidcoredump=3 >> /etc/sysctl.conf reboot You could recompile tcpdump with -g or -ggdb, to gain better symbols. If you manage to create a

bus error on octeon

2021-05-03 Thread pjp
>Synopsis: Encountered bus error on tcpdumping a cycled interface >Category: system >Environment: System : OpenBSD 6.9 Details : OpenBSD 6.9 (GENERIC.MP) #551: Sun Apr 18 03:06:59 MDT 2021