Re: SIGBUS on octeon for my program

2019-11-29 Thread David Higgs
Be warned that __packed doesn't do quite what you think it does. void func(int *p) { *p = 0; } If you pass an unaligned pointer into this function on a strict-alignment platform, your program will likely crash. I am unaware of any attribute that can inform the compiler that 'p' may be

Re: SIGBUS on octeon for my program

2019-11-28 Thread Peter J. Philipp
On Thu, Nov 28, 2019 at 11:44:07PM -0700, Theo de Raadt wrote: > Half the cpu platforms fault on unaligned access. > > There are strategies for handling this. Your code must use them. > > It is kind of boring, actually. I took a look at how libasr does it, and I have similar code ie. pack8(),

Re: SIGBUS on octeon for my program

2019-11-28 Thread Theo de Raadt
Half the cpu platforms fault on unaligned access. There are strategies for handling this. Your code must use them. It is kind of boring, actually. Peter J. Philipp wrote: > On Wed, Nov 27, 2019 at 03:30:23PM +0100, Peter J. Philipp wrote: > > Hi David, > > > > I'm going to upgrade to

Re: SIGBUS on octeon for my program

2019-11-28 Thread Peter J. Philipp
On Wed, Nov 27, 2019 at 03:30:23PM +0100, Peter J. Philipp wrote: > Hi David, > > I'm going to upgrade to -current and then report back.. it'll take me a few > days to do that (I'm super slow). > > ... > I'll see if this sort of issue repeats after I upgrade the octeon router > to -current. > >

Re: SIGBUS on octeon for my program

2019-11-27 Thread Peter J. Philipp
On Wed, Nov 27, 2019 at 09:16:51AM -0500, David Higgs wrote: > I don't speak ktrace but looks like alignment problems with a stack > variable. What does gdb report? > > --david Hi David, I'm going to upgrade to -current and then report back.. it'll take me a few days to do that (I'm super

Re: SIGBUS on octeon for my program

2019-11-27 Thread Peter J. Philipp
On Wed, Nov 27, 2019 at 03:13:19PM +0100, Janne Johansson wrote: > There was a fix recently for the stack getting unaligned committed just > recently, do you have that? > If not, test on current. Ok it'll take me a bit to test on current, as I don't have that fix yet. Thanks a lot! I'll come

Re: SIGBUS on octeon for my program

2019-11-27 Thread David Higgs
I don't speak ktrace but looks like alignment problems with a stack variable. What does gdb report? --david On Wed, Nov 27, 2019 at 8:48 AM Peter J. Philipp wrote: > Hi, > > My DNS program gets a SIGBUS when I execute it. I have ktraced it, upped > limits and searched in the mips64 source

Re: SIGBUS on octeon for my program

2019-11-27 Thread Janne Johansson
There was a fix recently for the stack getting unaligned committed just recently, do you have that? If not, test on current. Den ons 27 nov. 2019 kl 14:48 skrev Peter J. Philipp : > Hi, > > My DNS program gets a SIGBUS when I execute it. I have ktraced it, upped > limits and searched in the