-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Some weird issue exposed by Font::FreeType #2706
Comments
I've uploaded Font::FreeType 0.1.4 which addresses t/30render.t. I think this was caused by a bug in the module. The Font::FreeType object getting DESTROYed and freeing c-structs that were still being referenced by Font::FreeType::Face and other objects. Hopefully now fixed. Still seeing the t/10metrics*.t errors on the blead. Which I guess has a different cause. I notice these tests seem to be flapping. |
Reproduced; it goes away with |
Actually: |
Tracked it down to the JIT hunk of MoarVM/MoarVM@efdf568975cf38c2 |
Digging further: it seems that change enabled JIT compilation of a wider range of native calls, and may have exposed an existing bug with regard to |
Indeed. Just running all the tests of t/04-nativecall/15-rw-args.t in a loop { } makes the SetChar test fail at some point |
Even weirder. It's the first JIT compiled test in that loop that will fail. When I remove the SetChar tests, the SetShort tests start to fail (0 instead of 387). When I remove that one it's the SetLong tests and so on. It will skip the SetFloat and SetDouble tests as we don't JIT compile those and continue with SetUChar. |
Here's a slightly golfed version of t/04-nativecall/15-rw-args.t. There will be test failures almost 100% of the time the script is run:
however removing the last line will make the bug vanish |
We seem to have an issue with rw args to native calls, when the JIT fails to compile the call graph the nativeinvoke_o is in. Happens for example because we're missing the case for MVM_OP_getlexref_u8. optimize_getarg works on the assumption that the JIT compiler will not emit any code for the corresponding arg_* ops for a nativeinvoke and instead the values will be taken from the WORK register. But in our case, the JIT bails and the arg_i is still there. So the address of the arg buffer is passed to the native function and this is where the set value ends up in. But optimize_getarg has turned the getarg_i op into a set from the WORK register, ignoring the value in the arg buffer. In other words: we handle the interpreted version and the speshed + JIT compiled version but not the only speshed version. So the obvious solution is to just improve the JITs coverage of our ops to 100 %. |
What happens on platforms where we don't have JIT support? |
Following jnthn++'s suggestion, I moved the getarg_* handling into the JIT to avoid the "speshed but not JITed" case. The cost is just a missing set elimination optimization, but that's completely drowned by the noise when trying to measure it. Also in the future, the expr JIT optimizer may recover it anyway. MoarVM/MoarVM@ac07819 fixes the issues with rw args that I discovered. However, I have never been able to reproduce the Font::FreeType issue. @AlexDaniel can you please re-test with latest MoarVM? |
@dwarring can you check? Also, fwiw, I don't think this module works with the latest libfreetype6-dev debian package (debian testing). |
@AlexDaniel now passing for me on blead. [Btw, Also seeing the failures on latest freetype, thanks] |
OK |
Bisected: ee2238f
The text was updated successfully, but these errors were encountered: