Re: execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread Stuart Henderson
On 2019/11/07 23:12, Theo Buehler wrote: > I was trying to debug a WIP port, so I compiled it with '-g -O0' on my > amd64 laptop. When trying to execute the binary, I got > > $ ./lean > ksh: ./lean: Cannot allocate memory Oh I have seen this too, when I was trying to get an -O0 debug buil of

Re: execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread guenther
On Thu, 7 Nov 2019, Theo Buehler wrote: ... > and other tests run as expected. It has a more decently sized random > section: > > OPENBSD_RANDOM 0x01185000 0x01185000 0x01185000 >0x7d28 0x7d28 RW 8 A 97.3% reduction in

Re: execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread Theo de Raadt
Timely fix isn't it :-) Theo Buehler wrote: > On Thu, Nov 07, 2019 at 03:10:45PM -0800, Philip Guenther wrote: > > On Thu, 7 Nov 2019, Theo Buehler wrote: > > > On Thu, Nov 07, 2019 at 03:32:48PM -0700, Theo de Raadt wrote: > > > > > kern.version=OpenBSD 6.6-current (GENERIC.MP) #433: Thu Nov

Re: execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread Theo Buehler
On Thu, Nov 07, 2019 at 03:10:45PM -0800, Philip Guenther wrote: > On Thu, 7 Nov 2019, Theo Buehler wrote: > > On Thu, Nov 07, 2019 at 03:32:48PM -0700, Theo de Raadt wrote: > > > > kern.version=OpenBSD 6.6-current (GENERIC.MP) #433: Thu Nov 7 10:41:08 > > > > MST 2019 > > > > > > That is too

Re: execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread guenther
On Thu, 7 Nov 2019, Theo Buehler wrote: > On Thu, Nov 07, 2019 at 03:32:48PM -0700, Theo de Raadt wrote: > > > kern.version=OpenBSD 6.6-current (GENERIC.MP) #433: Thu Nov 7 10:41:08 > > > MST 2019 > > > > That is too old and does not contain the solution. > > I obtained a different binary with

Re: execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread Theo Buehler
On Thu, Nov 07, 2019 at 03:32:48PM -0700, Theo de Raadt wrote: > > kern.version=OpenBSD 6.6-current (GENERIC.MP) #433: Thu Nov 7 10:41:08 MST > > 2019 > > That is too old and does not contain the solution. > I obtained a different binary with the latest sets, but still see the same problem.

Re: execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread Theo de Raadt
> kern.version=OpenBSD 6.6-current (GENERIC.MP) #433: Thu Nov 7 10:41:08 MST > 2019 That is too old and does not contain the solution.

Re: execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread Theo Buehler
On Thu, Nov 07, 2019 at 11:46:56PM +0200, Theo Buehler wrote: > > Unfortunately, the binary is stripped so there are no symbols for the > > .openbsd.randomdata segment so we can't confirm the cause. > > Sorry about that. A non-stripped binary should be available under > >

Re: execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread Theo Buehler
> Unfortunately, the binary is stripped so there are no symbols for the > .openbsd.randomdata segment so we can't confirm the cause. Sorry about that. A non-stripped binary should be available under cvs:~tb/lean/lean-nonstripped

Re: execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread guenther
On Thu, 7 Nov 2019, Theo Buehler wrote: > I was trying to debug a WIP port, so I compiled it with '-g -O0' on my > amd64 laptop. When trying to execute the binary, I got > > $ ./lean > ksh: ./lean: Cannot allocate memory > > mpi was able to pinpoint this to the following check in exec_elf.c: >

Re: execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread Theo de Raadt
1MB is the current limit, for three reasons initially, but now two remaining reason. Looking at vmcmd_randomize, you'll see it allocates all the pages up front. That is reason #1. They are not demand-allocated (and then filled with random). I had some draft uvm code for years ago but it is

execve -1 errno 12 Cannot allocate memory

2019-11-07 Thread Theo Buehler
I was trying to debug a WIP port, so I compiled it with '-g -O0' on my amd64 laptop. When trying to execute the binary, I got $ ./lean ksh: ./lean: Cannot allocate memory mpi was able to pinpoint this to the following check in exec_elf.c: 699 case PT_OPENBSD_RANDOMIZE: 700