Skip to content
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

i#4347: Fix macOS build OOM on Travis #4348

Closed
wants to merge 11 commits into from

Conversation

abhinav92003
Copy link
Contributor

@abhinav92003
Copy link
Contributor Author

I noticed that the xcode version in the logs is 9.4.1 instead of the updated 12 or even the previous 11.3. xcode9.4 is the default version as per https://docs.travis-ci.com/user/reference/osx/#macos-version.


InstalledDir: /Applications/Xcode-9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
...

-- Check for working C compiler: /Applications/Xcode-9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode-9.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works

Logs show that the default version of xcode is being used currently. This is possibly because osx_image needs to be configured here instead.
@derekbruening
Copy link
Contributor

I put in the 11.3 upgrade in February and it certainly took effect back then as you can see in PR #4096 https://travis-ci.com/github/DynamoRIO/dynamorio/jobs/287132339

InstalledDir: /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

There were failures with the default, so you would think we'd notice if it regressed at some point back to 9.4.

xcode12 raised some new errors, and we've seen xcode11.3 work before in #4096 https://travis-ci.com/github/DynamoRIO/dynamorio/jobs/287132339. For some reason, we now need to set xcode version in job config.
@derekbruening
Copy link
Contributor

I checked a few builds and it looks like Travis made some change which caused the regression between our #4149 and #4150 on Mar 1-2:

@abhinav92003
Copy link
Contributor Author

abhinav92003 commented Jul 1, 2020

We're really using xcode11.3.1 now.

InstalledDir: /Applications/Xcode-11.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

But the initial OOM error is also back: https://travis-ci.com/github/DynamoRIO/dynamorio/jobs/356568480

====> FAILURE in debug-internal-64 <====
debug-internal-64: **** 7 build errors ****
	critical: /.../dynamorio/core/arch/x86/x86.asm:2517: out of memory!
	make[2]: *** [core/CMakeFiles/unit_tests.dir/arch/x86/x86.asm.o] Error 2
	make[1]: *** [core/CMakeFiles/unit_tests.dir/all] Error 2
	critical: /.../dynamorio/core/arch/x86/x86.asm:2517: out of memory!
	make[2]: *** [core/CMakeFiles/dynamorio.dir/arch/x86/x86.asm.o] Error 2
	make[1]: *** [core/CMakeFiles/dynamorio.dir/all] Error 2
	make: *** [all] Error 2
====> FAILURE in release-external-64 <====
release-external-64: **** 7 build errors ****
	critical: /.../dynamorio/core/arch/x86/x86.asm:2517: out of memory!
	make[2]: *** [core/CMakeFiles/unit_tests.dir/arch/x86/x86.asm.o] Error 2
	make[1]: *** [core/CMakeFiles/unit_tests.dir/all] Error 2
	critical: /.../dynamorio/core/arch/x86/x86.asm:2517: out of memory!
	make[2]: *** [core/CMakeFiles/dynamorio.dir/arch/x86/x86.asm.o] Error 2
	make[1]: *** [core/CMakeFiles/dynamorio.dir/all] Error 2
	make: *** [all] Error 2

Comparing with previous successful build with xcode11.3 at #4149, this setting is missing now.
It seems that xcode 11.6 and 12 are in beta. We saw some new errors with 12. 11.5 is the latest Golden release, so it's worth trying that out
@abhinav92003
Copy link
Contributor Author

Update on the attempts to fix this OOM so far.

We expected that we were using xcode11.3 for all builds, but we were actually using the default xcode9.4 due to some missing Travis configs which I added in f3b896b. This didn't fix the OOM though.

I tried using the latest xcode12 which is in beta right now (see 7467174), and also xcode11.5 which is the latest Golden release (see dcebe86). In both cases, we're seeing new errors as @derekbruening observed in #4344.

I also tried adding some missing options in Travis config that were there in last successful build with xcode11.3 (see 5a2056e), but that didn't help either.

dmesg is not producing any output to help debug the OOM (see 674997b)

@derekbruening Do you think it's worth fixing #4344 and hoping the new xcode resolves the OOM too?

@abhinav92003 abhinav92003 changed the title i#4347: Upgrade to xcode12 to fix macOS build OOM. i#4347: Fix macOS build OOM on Travis Jul 2, 2020
Saw some old threads where switching to xcode8.3 was helpful in resolving OOM issues in newer versions: https://developer.apple.com/forums/thread/87562, davisking/dlib#289 (comment).
Not sure if we want to revert to such an old version of xcode. But wanted to check if this helps.
@abhinav92003
Copy link
Contributor Author

Tried xcode8.3 as it was documented to help with OOM issues in some newer versions (see b2221c5). Not sure if we want to use such an old xcode, but it helps to some extent. The build does proceed further than before, but fails due to a different reason: https://travis-ci.com/github/DynamoRIO/dynamorio/jobs/357032530
/.../dynamorio/core/arch/x86_code_test.c:171:5: error: invalid output constraint '=v' in asm

For some reason xcode8.3 helped with the OOM issue, but it introduced a new issue with asm code.
At this point, I'm just trying out xcode versions to see if some works
@derekbruening
Copy link
Contributor

We expected that we were using xcode11.3 for all builds, but we were actually using the default xcode9.4 due to some missing Travis configs which I added in f3b896b. This didn't fix the OOM though.

Is that config documented by Travis? Any idea why we did not need it initially when xcode11.3 was in fact being used?

@derekbruening Do you think it's worth fixing #4344 and hoping the new xcode resolves the OOM too?

Yes, our own machines are going to have recent versions so we'll have to solve it anyway. If you would like to take over #4344 please go ahead. I will put notes there on what little I have tried so far.

It seems that the OOM issue has resolved itself. I'm seeing Travis macOS builds succeeding on previously failing PRs: https://travis-ci.com/github/DynamoRIO/dynamorio/jobs/356922047.
@abhinav92003
Copy link
Contributor Author

Travis macOS builds have started passing again, of their own accord. All of the following were failing previously.

Green on latest submitted PR in master: https://travis-ci.com/github/DynamoRIO/dynamorio/jobs/356922047
Green on one of my pending PR #4341: https://travis-ci.com/github/DynamoRIO/dynamorio/jobs/357179016
Green on this PR: https://travis-ci.com/github/DynamoRIO/dynamorio/jobs/357182309

I think 7467174 is still relevant so that we use a more recent version of xcode. I'll send it in a separate PR.

Is that config documented by Travis? Any idea why we did not need it initially when xcode11.3 was in fact being used?

It's the same osx_image option but in the jobs section. https://docs.travis-ci.com/user/multi-os/#example-multi-os-build-matrix shows a build matrix example with osx_image.

@abhinav92003
Copy link
Contributor Author

Also see #4354 for an experiment that shows macOS builds passing on reverting last 3 commits and re-committing them one at a time. These commits were failing on master when they were submitted.

@abhinav92003 abhinav92003 deleted the i4347-fix-mac-build-oom branch July 2, 2020 23:43
@derekbruening
Copy link
Contributor

Is that config documented by Travis? Any idea why we did not need it initially when xcode11.3 was in fact being used?

It's the same osx_image option but in the jobs section. https://docs.travis-ci.com/user/multi-os/#example-multi-os-build-matrix shows a build matrix example with osx_image.

OK, I saw a commit go by with sthg like group: stable and that was what I thought was undocumented.

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.

CRASH (8.0.0) Travis MacOS build failing due to OOM
2 participants