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

Update libbacktrace #24344

Merged
merged 2 commits into from
Apr 13, 2015
Merged

Update libbacktrace #24344

merged 2 commits into from
Apr 13, 2015

Conversation

timbertson
Copy link
Contributor

On linux, certain crashes can cause rust's backtrace generation code to consume huge amounts of memory (multiple gigabytes) when trying to generate a backtrace (e.g. servo/servo#5340).

I tracked this down to a bug in libbacktrace's allocation strategy when processing large binaries, and thankfully it's already been fixed upstream.

The change which fixes this specific issue is r210256, and is discussed here:
https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00547.html

I assume we'd prefer to update libbacktrace wholesale, rather than cherry-picking individual patches, so this PR updates libbacktrace to the latest code from svn://gcc.gnu.org/svn/gcc/trunk/libbacktrace (r220112).

I've copied the upstream code and reapplied the parts of the following commits which touch src/libbacktrace:

I have not reapplied f576579 or d51047d, as those are both cosmetic cleanups applied to the entire codebase. For this directory, it seems worthwhile diverging as little as possible from upstream, to reduce the effort of future updates. But I can add them as well if preferred.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see CONTRIBUTING.md for more information.

@jdm
Copy link
Contributor

jdm commented Apr 12, 2015

Fantastic!

@jdm
Copy link
Contributor

jdm commented Apr 12, 2015

This should solve #24231.

@pnkfelix
Copy link
Member

wow, skimming over this, seems like very little actually changed, apart from the aforementioned memory-usage fix, and the addition of a specialized sort routine.

@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 12, 2015

📌 Commit 10073c2 has been approved by pnkfelix

@bors
Copy link
Contributor

bors commented Apr 12, 2015

⌛ Testing commit 10073c2 with merge 00c24ee...

@bors
Copy link
Contributor

bors commented Apr 13, 2015

💔 Test failed - auto-mac-64-nopt-t

@timbertson
Copy link
Contributor Author

I'm assuming the mac test failure above is just sporadic, as this component is only used on linux.

@sfackler
Copy link
Member

@bors: retry

yep, looks like.

@semarie
Copy link
Contributor

semarie commented Apr 13, 2015

@gfxmonk libbacktrace isn't used only on Linux.

The src/test/run-pass/backtrace.rs test is run successfully on other platform (it only ignore windows platform).

and under libstd/sys/unix/backtrace.rs the libbacktrace API is used for #[cfg(not(any(target_os = "macos", target_os = "ios")))]

but yes, the mac test failure seems to be unrelated :)

@bors
Copy link
Contributor

bors commented Apr 13, 2015

⌛ Testing commit 10073c2 with merge 3cac76b...

bors added a commit that referenced this pull request Apr 13, 2015
On linux, certain crashes can cause rust's backtrace generation code to consume huge amounts of memory (multiple gigabytes) when trying to generate a backtrace (e.g. servo/servo#5340).

I tracked this down to a bug in libbacktrace's allocation strategy when processing large binaries, and thankfully it's already been fixed upstream.

The change which fixes this specific issue is r210256, and is discussed here:
https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00547.html

I assume we'd prefer to update libbacktrace wholesale, rather than cherry-picking individual patches, so this PR updates libbacktrace to the latest code from svn://gcc.gnu.org/svn/gcc/trunk/libbacktrace (r220112).

I've copied the upstream code and reapplied the parts of the following commits which touch src/libbacktrace:

 - cd8f317
 - fcb30a0

I have not reapplied f576579 or d51047d, as those are both cosmetic cleanups applied to the entire codebase. For this directory, it seems worthwhile diverging as little as possible from upstream, to reduce the effort of future updates. But I can add them as well if preferred.
@bors bors merged commit 10073c2 into rust-lang:master Apr 13, 2015
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.

8 participants