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

Segfault on Android since #19011 #19058

Closed
paulrouget opened this issue Oct 30, 2017 · 7 comments
Closed

Segfault on Android since #19011 #19058

paulrouget opened this issue Oct 30, 2017 · 7 comments

Comments

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Oct 30, 2017

Happens at startup. Managed to bisect to #19011

/cc @SimonSapin @mbrubeck

I don't have much information. I'm struggling to get a backtrace.

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Oct 30, 2017

I don't use the "official" Android build mechanism. So I might be missing something about the allocator.

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Oct 30, 2017

I think that part of the problem is that we need to define a extern fn ft_free(mem: FT_Memory, ptr: *mut c_void) function that deallocates without knowing what size was used to allocate that pointer. The standard Rust APIs require a size to be known during deallcation, and using malloc_usable_size of that seems suspicious.

I’m working on a PR to make freetype/font_context.rs use C-level jemalloc functions directly. (Platforms where we use FreeType also happen to be platforms where we use jemalloc.) Hopefully that will help with that segfault.

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Oct 30, 2017

Is there a way for me to confirm that this is indeed the issue?

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Oct 30, 2017

Without a backtrace, I don’t know.

SimonSapin added a commit that referenced this issue Oct 30, 2017
Instead use C-level malloc()/free() so that the size doesn’t need
to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes #19058
bors-servo added a commit that referenced this issue Oct 30, 2017
FreeType: don’t use usable_size() as deallocation size

Instead use C-level malloc()/free() so that the size doesn’t need to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes #19058

Depends on gnzlbg/jemallocator#21
@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Oct 30, 2017

@paulrouget Try with #19061 ?

SimonSapin added a commit that referenced this issue Oct 30, 2017
Instead use C-level malloc()/free() so that the size doesn’t need
to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes #19058
bors-servo added a commit that referenced this issue Oct 30, 2017
FreeType: don’t use usable_size() as deallocation size

Instead use C-level malloc()/free() so that the size doesn’t need to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes #19058

Depends on gnzlbg/jemallocator#21

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19061)
<!-- Reviewable:end -->
SimonSapin added a commit that referenced this issue Oct 30, 2017
Instead use C-level malloc()/free() so that the size doesn’t need
to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes #19058
SimonSapin added a commit that referenced this issue Oct 30, 2017
Instead use C-level malloc()/free() so that the size doesn’t need
to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes #19058
bors-servo added a commit that referenced this issue Oct 30, 2017
FreeType: don’t use usable_size() as deallocation size

Instead use C-level malloc()/free() so that the size doesn’t need to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes #19058

Depends on gnzlbg/jemallocator#21

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19061)
<!-- Reviewable:end -->
@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Oct 30, 2017

Oops, before actually closing this, @paulrouget can you confirm if this segfault still happens?

@SimonSapin SimonSapin reopened this Oct 30, 2017
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 31, 2017
…on size (from servo:ft-alloc); r=mbrubeck

Instead use C-level malloc()/free() so that the size doesn’t need to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes servo/servo#19058

Depends on gnzlbg/jemallocator#21

Source-Repo: https://github.com/servo/servo
Source-Revision: f18099118a5be17b5b1d6fdcc3352a98a1499e6a

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 8087ee658a0ca822c6cdc85c00cfc8984b1fa668
@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Oct 31, 2017

43a4f01 doesn't crash. Thank you so much :)

@paulrouget paulrouget closed this Oct 31, 2017
xeonchen pushed a commit to xeonchen/gecko-cinnabar that referenced this issue Oct 31, 2017
…on size (from servo:ft-alloc); r=mbrubeck

Instead use C-level malloc()/free() so that the size doesn’t need to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes servo/servo#19058

Depends on gnzlbg/jemallocator#21

Source-Repo: https://github.com/servo/servo
Source-Revision: f18099118a5be17b5b1d6fdcc3352a98a1499e6a
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 2, 2019
…on size (from servo:ft-alloc); r=mbrubeck

Instead use C-level malloc()/free() so that the size doesn’t need to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes servo/servo#19058

Depends on gnzlbg/jemallocator#21

Source-Repo: https://github.com/servo/servo
Source-Revision: f18099118a5be17b5b1d6fdcc3352a98a1499e6a

UltraBlame original commit: 7f574eb1f99cc0561b58c045a8cba0552e7ee930
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 2, 2019
…on size (from servo:ft-alloc); r=mbrubeck

Instead use C-level malloc()/free() so that the size doesn’t need to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes servo/servo#19058

Depends on gnzlbg/jemallocator#21

Source-Repo: https://github.com/servo/servo
Source-Revision: f18099118a5be17b5b1d6fdcc3352a98a1499e6a

UltraBlame original commit: 7f574eb1f99cc0561b58c045a8cba0552e7ee930
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 2, 2019
…on size (from servo:ft-alloc); r=mbrubeck

Instead use C-level malloc()/free() so that the size doesn’t need to be known during deallocation, since FreeType doesn’t provide it.

Hopefully fixes servo/servo#19058

Depends on gnzlbg/jemallocator#21

Source-Repo: https://github.com/servo/servo
Source-Revision: f18099118a5be17b5b1d6fdcc3352a98a1499e6a

UltraBlame original commit: 7f574eb1f99cc0561b58c045a8cba0552e7ee930
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.