On Fri, 14 Mar 2025 14:12:30 GMT, Kevin Rushforth <k...@openjdk.org> wrote:
>> Hi! >> >> This is my desperate fix for what I believe to be a critical bug. Since my >> knowledge of the codebase is minimal, and the class structure is a bit >> controversial, my fix is mostly based on historical excavation. >> >> # What is the problem? >> VM started to crash after webkit 620.1 update when running simple >> [CanvasTest](https://github.com/openjdk/jfx/blob/1c3cfcb8bb4e8874406d3a5b507f38859f4c1d9b/modules/javafx.web/src/test/java/test/javafx/scene/web/CanvasTest.java#L125). >> Running with `-Xcheck:jni ` reveals invalid object is passed to JNI >> [call](https://github.com/openjdk/jfx/blob/0555fb25a16b6b6705a42c6d8592cf1c6ddccc67/modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/NativeImageJava.cpp#L56): >> expected is`WCImageFrame` but provided is `RTImage` (an descendant of >> `WCImage`). The latter has no `getSize` method. >> Stack trace >> >> frame #4: 0x0000000101a36094 >> libjvm.dylib`checked_jni_CallObjectMethodV(env=0x0000000124a89cb0, >> obj=0x000000012310f9e8, methodID=0x00006000019abde8, >> args="\xa0\U00000012\U0000001ev\U00000001") at jniCheck.cpp:1012:1 [opt] >> frame #5: 0x000000033e88ea60 >> libjfxwebkit.dylib`JNIEnv_::CallObjectMethod(this=0x0000000124a89cb0, >> obj=0x000000012310f9e8, methodID=0x00006000019abde8) at jni.h:906:18 >> frame #6: 0x00000003426fcda0 >> libjfxwebkit.dylib`WebCore::PlatformImageNativeImageBackend::size(this=0x0000600000e12790) >> const at NativeImageJava.cpp:55:48 >> frame #7: 0x000000034258d76c >> libjfxwebkit.dylib`WebCore::NativeImage::size(this=0x00000001761c2c00) const >> at NativeImage.cpp:89:23 >> frame #8: 0x00000003425723c0 >> libjfxwebkit.dylib`WebCore::ImageFrame::ImageFrame(this=0x00000001761e1270, >> nativeImage=0x000000016fdf7090) at ImageFrame.cpp:40:29 >> frame #9: 0x0000000342572420 >> libjfxwebkit.dylib`WebCore::ImageFrame::ImageFrame(this=0x00000001761e1270, >> nativeImage=0x000000016fdf7090) at ImageFrame.cpp:39:1 >> frame #10: 0x00000003425a4d7c >> libjfxwebkit.dylib`WebCore::NativeImageSource::NativeImageSource(this=0x00000001761e1260, >> nativeImage=0x000000016fdf7090) at NativeImageSource.cpp:37:7 >> frame #11: 0x00000003425a4d24 >> libjfxwebkit.dylib`WebCore::NativeImageSource::NativeImageSource(this=0x00000001761e1260, >> nativeImage=0x000000016fdf7090) at NativeImageSource.cpp:38:1 >> frame #12: 0x00000003425a4cac >> libjfxwebkit.dylib`WebCore::NativeImageSource::create(nativeImage=0x000000016fdf7090) >> at NativeImageSource.cpp:33:26 >> frame #13: 0x00000003423a6f18 libjfxwebkit.dylib`WebCore::B... > > Initial testing shows that while this does prevent the crash, it doesn't > actually render anything in the failing case. > > @jaybhaskar will add more detail on Monday. He and @Gopalora are working on > an actual fix. @kevinrushforth thank you for the review. I expected something like this. BTW, we've just found that win32 and osx-x64 crashes even with this fix. ------------- PR Comment: https://git.openjdk.org/jfx/pull/1734#issuecomment-2725303486