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

Compile libbacktrace with mmapio.c instead of read.c #289

Closed
Aaron1011 opened this issue Feb 15, 2020 · 1 comment · Fixed by #298
Closed

Compile libbacktrace with mmapio.c instead of read.c #289

Aaron1011 opened this issue Feb 15, 2020 · 1 comment · Fixed by #298

Comments

@Aaron1011
Copy link
Member

Currently, backtrace-sys hardcoded the compilation of src/libbacktrace/read.c:

.file("src/libbacktrace/read.c")

However, libbacktrace provides a more efficient version of read.c (which is used internally to read in chunks of memory) called mmapio.c.

backtrace-rs should either provide a feature which compiles libbacktrace with mmapio.c, or attempt to detect whether or not the mmap system call is available. Alternatively, the configure script for libbacktrace could be used instead of hard-coding paths, since [it already detects if mmap is available[(https://github.com/ianlancetaylor/libbacktrace/blob/559ab7cab4a6002124863d493bd09a376a690e76/configure.ac#L285-L303). I'm not sure if there are any issues preventing this script from being used.

This will also fix rust-lang/rust#69151, since we will no longe be hitting the bug in read.c

@alexcrichton
Copy link
Member

A PR to implement this would be most welcome! I don't think anything fancy needs to be done, mmap is available everywhere reasonable.

Aaron1011 added a commit to Aaron1011/backtrace-rs that referenced this issue Mar 2, 2020
Fixes rust-lang#289

`mmap` should be available on all platforms we support, so we can use
`libbacktrace`'s more efficient mmap-based code.
Aaron1011 added a commit to Aaron1011/backtrace-rs that referenced this issue Mar 2, 2020
Fixes rust-lang#289

`mmap` should be available on all platforms we support (except Windows),
so we can use `libbacktrace`'s more efficient mmap-based code.
alexcrichton pushed a commit that referenced this issue Mar 3, 2020
#298)

Fixes #289

`mmap` should be available on all platforms we support (except Windows),
so we can use `libbacktrace`'s more efficient mmap-based code.
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 a pull request may close this issue.

2 participants