--- run-command.c.orig +++ run-command.c @@ -637,11 +637,19 @@ async->proc_in = proc_in; async->proc_out = proc_out; { - int err = pthread_create(&async->tid, NULL, run_thread, async); + int err; + pthread_attr_t attr; + size_t stacksize; + pthread_attr_init(&attr); + pthread_attr_getstacksize(&attr, &stacksize); + if (stacksize < 131072) stacksize = 131072; + pthread_attr_setstacksize(&attr, stacksize); + err = pthread_create(&async->tid, &attr, run_thread, async); if (err) { error("cannot create thread: %s", strerror(err)); goto error; } + pthread_attr_destroy(&attr); } #endif return 0;