[build2] std::system_error: Resource temporarily unavailable

Dane Springmeyer dane at mapbox.com
Wed Feb 7 04:29:27 UTC 2018


> On Feb 6, 2018, at 7:31 AM, Boris Kolpackov <boris at codesynthesis.com> wrote:
> 
> Dane Springmeyer <dane at mapbox.com> writes:
> 
>> # logbt -- make
> 
> Neat ;-).
> 

Thanks :) It is a wrapper around `gdb/lldb --batch`: https://github.com/mapbox/logbt. Helps my team get in the habit of running the same command locally (mostly OS X machines) and in production (linux).

> 
>> #7  0x00000000005549c6 in build2::scheduler::create_helper(std::__1::unique_lock<std::__1::mutex>&) ()
> 
> I've tried a couple of things that came to mind:
> 
> 1. Built build2 from a makefile (builds fine).
> 
> 2. Checked if make overrides the stack size rlimit (not on my box).

Wow, you found it! On my system make is v3.81. With your lead I found and tried this workaround which fixes the problem: https://stackoverflow.com/a/16280013

> Also, if you want to check whether make overrides the stack size on
> your platforms, here is a test program:
> 
> https://codesynthesis.com/~boris/tmp/stacksize.c
> 

Permissions error prevents me from viewing that file but I figure it must do something like this?

size_t stksize;
pthread_attr_t atr;
pthread_attr_getstacksize(&atr, &stksize);
printf("Current stack size - > %d\n", stksize);

If I run that within make I see:

Current stack size - > 2097152

And outside of make:

Current stack size - > 8388608


> For some background on this stack size issue, see create_helper()
> (starts at line 450):
> 
> https://git.build2.org/cgit/build2/tree/build2/scheduler.cxx

Ah, thanks for sharing that. Definitely looks like the spot.

Thanks for the help here. Happy with working around on my side.

Dane


More information about the users mailing list