-
Notifications
You must be signed in to change notification settings - Fork 624
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
Python crashes when HarfBuzz.language_from_string() is used #91
Comments
I think this is about Python trying to free(?) the return value of that function perhaps. I'll take a look. |
I can avoid this by caching the languages so that I don’t call
|
It seems that just calling it more than once will cause the crash:
|
I finally understood what this comment means, and indeed it is the case. Adding |
Opened #99 for the fixes I found so far. The random shaping issue seems to be a bug in
With snippet like:
If I revert that commit all is fine (but I get the warning it was working around of course). |
Yeah thinking about it I believe I know what's wrong. Let me try to digest it all and fix it. Thanks! |
Actually this started working too. I guess my stack was bad. This is working fine with Ubuntu 14.04 now. |
Hum.. No idea what was broken before, but I reviewed and tested the code, I think it's fine. Can you please confirm? |
It stopped crashing here as well, but I still see this in valgrind output:
|
I’m also still randomly seeing that setting the buffer language making no effect if I keep calling |
humm. I definitely see the valgrind error and looks bad. debugging. I don't understand why that's happening. |
I have a guess that g-i changed how it treats types that are typedef'ed to pointers... |
Using latest gobject-introspection, I don't seem to be having this problem anymore: https://bugzilla.gnome.org/show_bug.cgi?id=707656 Removing that kludge makes language_t behave more like the way I expect it in Python. Also fixes: #91
I'm sure g-i made changes. I removed the kludge I had added for language_t and it fixed things... Even made it better. |
It seems to work fine now, though g-i is now giving the wold warning:
|
So we are back to why I added the boxed type to begin with. So, g-i handles hb_buffer_get_language() just fine, but not hb_language_get_default(). Added (transfer none) and those are happy now. |
Nice, I think we need a release now :) |
Will be out in a few minutes. |
[breaking change] Use ::std::os::raw instead of libc. This is a breaking change. Fixes issue harfbuzz#88. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-harfbuzz/91) <!-- Reviewable:end -->
After #90 I can get most of the
*_from_string()
function to work from Python, exceptlanguage_from_string()
which cases a “double free or corruption” crash. Running under valgrind shows the following:and
I can not really tell what is going on, but it looks like a mismatch between the way the string is allocated and the use of
free()
here, or a double free. May be there is a magic Introspection keyword to fix this but I don’t know what is it (I tried(transfer full)
but it made no difference).The text was updated successfully, but these errors were encountered: