Skip to content

Increase the stack size limit for running llvm codegen threads to 8MB #23102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

aschwaighofer
Copy link
Contributor

Without this compilation may fail in llvm because we run out of stack space. The
limit for the main thread is 8MB on mac osx but 512KB for other threads.

rdar://47787344

Without this compilation may fail in llvm because we run out of stack space. The
limit for the main thread is 8MB on mac osx but 512KB for other threads.

rdar://47787344
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 5, 2019

Build failed
Swift Test OS X Platform
Git Sha - 38063aa

@aschwaighofer
Copy link
Contributor Author

Did we run out of disk space ...

fatal error: error in backend: Unexpected end of file
12:30:19 clang-7: error: clang frontend command failed with exit code 70 (use -v to see invocation)

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please smoke test OS X platform

@aschwaighofer aschwaighofer merged commit f6aaf8a into swiftlang:master Mar 6, 2019
Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this relevant on Linux too?

pthread_attr_destroy(&stackSizeAttribute);
#else
for (auto &thread : threads) {
thread.thread = new std::thread(runThread, &thread);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it need to be heap-allocated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not.
#23214

@aschwaighofer
Copy link
Contributor Author

The default stack size for pthread_create on linux is not as low as on Mac OS: 2MB not 512Kb.

We could also increase this to 8MB.

@ergunkocak
Copy link

Is this shipped with latest xcode 10.2 ?

@ergunkocak
Copy link

My problem was Cache library i used : hyperoslo/Cache#238

@jrose-apple
Copy link
Contributor

This would not have made it into Xcode 10.2, sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants