kenz-gelsoft / gecko-dev

Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/setup/index.html
Other
16 stars 2 forks source link

Hit MOZ_CRASH(adding raw font failed: 0 bytes, err=85) at gfx/wr/wr_glyph_rasterizer/src/platform/unix/font.rs:399 #40

Open kenz-gelsoft opened 3 months ago

kenz-gelsoft commented 3 months ago

After opened haiku website at https://github.com/kenz-gelsoft/gecko-dev/issues/39#issuecomment-2308573895,

Navigate to "Documents" crashed entire browser (parent process crash)

[Parent 744, Socket Thread] WARNING: 'NS_FAILED(rv)', file /boot/home/src/gecko-dev/netwerk/base/nsUDPSocket.cpp:1464
[744] add_native_font=/boot/system/data/fonts/otfonts/NotoSansCJKjp-Regular.otf
[744] add_font=/boot/system/data/fonts/otfonts/NotoSansCJKjp-Regular.otf
[744] add_native_font=/boot/system/data/fonts/otfonts/NotoSansCJKjp-Regular.otf
[744] add_native_font=/boot/system/data/fonts/otfonts/NotoSansCJKjp-Regular.otf
[744] add_native_font=/boot/system/data/fonts/otfonts/NotoSansCJKjp-Regular.otf
[WARN  neqo_transport::ecn] ECN validation failed, no ECN counts in ACK frame
[744] add_native_font=/boot/system/data/fonts/otfonts/NotoSansCJKjp-Bold.otf
[744] add_font=/boot/system/data/fonts/otfonts/NotoSansCJKjp-Bold.otf
[744] add_native_font=/boot/system/data/fonts/otfonts/NotoSansCJKjp-Bold.otf
[744] add_native_font=/boot/system/data/fonts/otfonts/NotoSansCJKjp-Bold.otf
[744] add_native_font=/boot/system/data/fonts/otfonts/NotoSansCJKjp-Bold.otf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansDisplay-Bold.ttf
[744] add_font=/boot/system/data/fonts/ttfonts/NotoSansDisplay-Bold.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansDisplay-Bold.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansDisplay-Bold.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansDisplay-Bold.ttf
console.error: (new ReferenceError("WebAssembly is not defined", "resource://gre/actors/TranslationsParent.sys.mjs", 2737))
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansMono-Bold.ttf
[744] add_font=/boot/system/data/fonts/ttfonts/NotoSansMono-Bold.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansMono-Bold.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansMono-Bold.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansMono-Bold.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansMono-Medium.ttf
[744] add_font=/boot/system/data/fonts/ttfonts/NotoSansMono-Medium.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansMono-Medium.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansMono-Medium.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansMono-Medium.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansSymbols2-Regular.ttf
[744] add_font=/boot/system/data/fonts/ttfonts/NotoSansSymbols2-Regular.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansSymbols2-Regular.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansSymbols2-Regular.ttf
[744] add_native_font=/boot/system/data/fonts/ttfonts/NotoSansSymbols2-Regular.ttf
console.error: (new ReferenceError("WebAssembly is not defined", "resource://gre/actors/TranslationsParent.sys.mjs", 2737))
WaylandServer::fDisplay: 0x1012dcc44520
Error parsing B_ARGV_RECEIVED message. Message:
BMessage('_ARG') {
        argc = int32(0x12 or 18)
        argv[0] = string("/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/firefox", 53 bytes)
        argv[1] = string("-contentproc", 13 bytes)
        argv[2] = string("{7b548f93-2d21-4cc1-a073-aa1b1c5ee9af}", 39 bytes)
        argv[3] = string("744", 4 bytes)
        argv[4] = string("tab", 4 bytes)
        cwd = string("/boot/home/src/gecko-dev", 25 bytes)
}
wl_ips_client_connected
display: 0x1012dcc44520
client: 0x1012dcc03360
[Child 1310, Main Thread] WARNING: Failed to create file monitor for /boot/home/config/settings/glib-2.0/settings/keyfile: Unable to find default local file monitor type: 'glib warning', file /boot/home/src/gecko-dev/toolkit/xre/nsSigHandlers.cpp:187

(/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/firefox:1310): GLib-GIO-WARNING **: 08:26:34.357: Failed to create file monitor for /boot/home/config/settings/glib-2.0/settings/keyfile: Unable to find default local file monitor type
Fontconfig warning: ignoring en_US_POSIX.UTF-8: not a valid region tag
[Child 973, StreamTrans #9] WARNING: Failed to retrieve memory telemetry for ResidentPeak: file /boot/home/src/gecko-dev/xpcom/base/MemoryTelemetry.cpp:344
[Child 815, StreamTrans #12] WARNING: Failed to retrieve memory telemetry for ResidentPeak: file /boot/home/src/gecko-dev/xpcom/base/MemoryTelemetry.cpp:344
[Child 915, StreamTrans #12] WARNING: Failed to retrieve memory telemetry for ResidentPeak: file /boot/home/src/gecko-dev/xpcom/base/MemoryTelemetry.cpp:344
[Child 1056, StreamTrans #9] WARNING: Failed to retrieve memory telemetry for ResidentPeak: file /boot/home/src/gecko-dev/xpcom/base/MemoryTelemetry.cpp:344
[Child 1257, StreamTrans #1] WARNING: Failed to retrieve memory telemetry for ResidentPeak: file /boot/home/src/gecko-dev/xpcom/base/MemoryTelemetry.cpp:344
[Child 1310, StreamTrans #1] WARNING: Failed to retrieve memory telemetry for ResidentPeak: file /boot/home/src/gecko-dev/xpcom/base/MemoryTelemetry.cpp:344
console.error: (new ReferenceError("WebAssembly is not defined", "resource://gre/actors/TranslationsParent.sys.mjs", 2737))
Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL no display (t=3.75583) |[1][GFX1-]: glxtest: EGL test failed (t=3.75733) |[2][GFX1-]: No GPUs detected via PCI
 (t=3.75847) |[3][GFX1-]: Failed sanitizing font 77 (t=610.165) [GFX1-]: Failed sanitizing font 77
[744] Hit MOZ_CRASH(adding raw font failed: 0 bytes, err=85) at gfx/wr/wr_glyph_rasterizer/src/platform/unix/font.rs:399
console.error: (new ReferenceError("WebAssembly is not defined", "resource://gre/actors/TranslationsParent.sys.mjs", 2737))
#01: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xa957006]
#02: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xa956dff]
#03: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xa956a5c]
#04: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xb268a93]
#05: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xb25a524]
#06: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xb25a319]
#07: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xb268637]
#08: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xb28e9d3]
#09: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xa742dea]
#10: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xa7353ae]
#11: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xb1f2ad5]
#12: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xb1f03ed]
#13: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xb1ee29a]
#14: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xb1eea41]
#15: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xb26affb]
#16: pthread_exit[/boot/system/lib/libroot.so +0x4e528]
#17: ??? (???:???)
[Socket 775, IPC I/O Child] WARNING: [37A3D1D3A7823B20.B7B9491DE0808C6A]: Dropping message '<null>'; no connection to unknown peer 1.1: file /boot/home/src/gecko-dev/ipc/glue/NodeController.cpp:365
[Child 815, IPC I/O Child] WARNING: [D34104A1D6B6137D.D087F582E530F2F3]: Dropping message '<null>'; no connection to unknown peer 1.1: file /boot/home/src/gecko-dev/ipc/glue/NodeController.cpp:365
[Socket 775, Main Thread] WARNING: Shutting down Socket process early due to a crash!: file /boot/home/src/gecko-dev/netwerk/ipc/SocketProcessChild.cpp:229
[Child 1257, IPC I/O Child] WARNING: [2EEA70A8B47584BE.2E0B6AF83AF83ACA]: Dropping message '<null>'; no connection to unknown peer 1.1: file /boot/home/src/gecko-dev/ipc/glue/NodeController.cpp:365
Exiting due to channel error.
[Child 1257, RemoteLzyStream] WARNING: RemoteLazyInputStreamChild disconnected unexpectedly (1 streams remaining)! 108ec58c95a0 {97d86fec-8f81-4582-9bb5-7bdb5ba91e4c}: file /boot/home/src/gecko-dev/dom/file/ipc/RemoteLazyInputStreamChild.cpp:51
Exiting due to channel error.
[Child 1310, IPC I/O Child] WARNING: [EBE7A574DB6021B5.D3A9E892662627D2]: Dropping message '<null>'; no connection to unknown peer 1.1: file /boot/home/src/gecko-dev/ipc/glue/NodeController.cpp:365
[Child 915, IPC I/O Child] WARNING: [AAFCB811B0DCD92C.13F6D9F9863ED034]: Dropping message '<null>'; no connection to unknown peer 1.1: file /boot/home/src/gecko-dev/ipc/glue/NodeController.cpp:365
[Utility 953, IPC I/O Child] WARNING: [8E03E6BCD018F965.1AF73E5CB1F5AB36]: Dropping message '<null>'; no connection to unknown peer 1.1: file /boot/home/src/gecko-dev/ipc/glue/NodeController.cpp:365
[Child 1310, RemoteLzyStream] WARNING: RemoteLazyInputStreamChild disconnected unexpectedly (1 streams remaining)! 1012dd3a05a0 {d9636848-bc1a-4a7e-b49f-b3990a4633f2}: file /boot/home/src/gecko-dev/dom/file/ipc/RemoteLazyInputStreamChild.cpp:51
[Child 1310, RemoteLzyStream] WARNING: RemoteLazyInputStreamChild disconnected unexpectedly (1 streams remaining)! 1012dd327a60 {4f1e6bca-ac4d-4b6b-a08e-074ea322ff99}: file /boot/home/src/gecko-dev/dom/file/ipc/RemoteLazyInputStreamChild.cpp:51
[Child 1310, RemoteLzyStream] WARNING: RemoteLazyInputStreamChild disconnected unexpectedly (1 streams remaining)! 1012dd327c10 {3dc2c17a-83f6-4d1e-b6f8-198dcc1cea4b}: file /boot/home/src/gecko-dev/dom/file/ipc/RemoteLazyInputStreamChild.cpp:51
[Child 1310, RemoteLzyStream] WARNING: RemoteLazyInputStreamChild disconnected unexpectedly (1 streams remaining)! 1012dd327dc0 {cc143a6c-46b9-40bb-9d78-58430ecb7330}: file /boot/home/src/gecko-dev/dom/file/ipc/RemoteLazyInputStreamChild.cpp:51
[Utility 953, Main Thread] WARNING: Shutting down Utility process early due to a crash!: file /boot/home/src/gecko-dev/ipc/glue/UtilityProcessChild.cpp:352
[Child 973, IPC I/O Child] WARNING: [A72075E0F81DF4A6.BCACE077B7C67EBF]: Dropping message '<null>'; no connection to unknown peer 1.1: file /boot/home/src/gecko-dev/ipc/glue/NodeController.cpp:365
[Child 1056, IPC I/O Child] WARNING: [71947EBCA7FFB935.7DAB48CE444927A9]: Dropping message '<null>'; no connection to unknown peer 1.1: file /boot/home/src/gecko-dev/ipc/glue/NodeController.cpp:365
Exiting due to channel error.
[Child 1310, RemoteLzyStream] WARNING: RemoteLazyInputStreamChild disconnected unexpectedly (1 streams remaining)! 1012dd327f70 {c5eaa651-1f2b-4196-bb01-42ba5b04551f}: file /boot/home/src/gecko-dev/dom/file/ipc/RemoteLazyInputStreamChild.cpp:51
Exiting due to channel error.
Exiting due to channel error.
[Child 1056, RemoteLzyStream] WARNING: RemoteLazyInputStreamChild disconnected unexpectedly (1 streams remaining)! 11542ea5a310 {5ff796af-b180-4028-9b1c-104efb14049a}: file /boot/home/src/gecko-dev/dom/file/ipc/RemoteLazyInputStreamChild.cpp:51
[Child 1056, RemoteLzyStream] WARNING: RemoteLazyInputStreamChild disconnected unexpectedly (1 streams remaining)! 11542e9dcd80 {cb64eed2-47e4-4146-a924-135a859a7dcf}: file /boot/home/src/gecko-dev/dom/file/ipc/RemoteLazyInputStreamChild.cpp:51
[Child 1056, RemoteLzyStream] WARNING: RemoteLazyInputStreamChild disconnected unexpectedly (1 streams remaining)! 11542e9dcf30 {01034972-5d4b-4165-ab4f-e9272842e59b}: file /boot/home/src/gecko-dev/dom/file/ipc/RemoteLazyInputStreamChild.cpp:51
[Child 1056, RemoteLzyStream] WARNING: RemoteLazyInputStreamChild disconnected unexpectedly (1 streams remaining)! 11542e9dd0e0 {30866ceb-4c4c-435e-9c43-9f33ea59378e}: file /boot/home/src/gecko-dev/dom/file/ipc/RemoteLazyInputStreamChild.cpp:51
[Child 1056, RemoteLzyStream] WARNING: RemoteLazyInputStreamChild disconnected unexpectedly (1 streams remaining)! 11542e9dd290 {8f0fcdd3-a67d-4676-a1ca-d7cf7896bb5b}: file /boot/home/src/gecko-dev/dom/file/ipc/RemoteLazyInputStreamChild.cpp:51
Exiting due to channel error.
~/src/gecko-dev> 
kenz-gelsoft commented 3 months ago

I think font sanitizing error comes from GL implementation for this log style

Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL no display (t=3.75583) |[1][GFX1-]: glxtest: EGL test failed (t=3.75733) |[2][GFX1-]: No GPUs detected via PCI
 (t=3.75847) |[3][GFX1-]: Failed sanitizing font 77 (t=610.165) [GFX1-]: Failed sanitizing font 77
[744] Hit MOZ_CRASH(adding raw font failed: 0 bytes, err=85) at gfx/wr/wr_glyph_rasterizer/src/platform/unix/font.rs:399
console.error: (new ReferenceError("WebAssembly is not defined", "resource://gre/actors/TranslationsParent.sys.mjs", 2737))
#01: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xa957006]
#02: XRE_GetBootstrap[/boot/home/src/gecko-dev/obj-ff-dbg/dist/bin/libxul.so +0xa956dff]
kenz-gelsoft commented 3 months ago

workaround patch

diff --git a/gfx/wr/wr_glyph_rasterizer/src/platform/unix/font.rs b/gfx/wr/wr_glyph_rasterizer/src/platform/unix/font.rs
index 5885d8f9a270..1868b4750d14 100644
--- a/gfx/wr/wr_glyph_rasterizer/src/platform/unix/font.rs
+++ b/gfx/wr/wr_glyph_rasterizer/src/platform/unix/font.rs
@@ -386,7 +396,8 @@ impl FontContext {
             let len = bytes.len();
             match FONT_CACHE.lock().unwrap().add_font(FontTemplate::Raw(bytes, index)) {
                 Ok(font) => self.fonts.insert(*font_key, font),
-                Err(result) => panic!("adding raw font failed: {} bytes, err={:?}", len, result),
+                Err(result) => None,
+//                  panic!("adding raw font failed: {} bytes, err={:?}", len, result),
             };
         }
     }
kenz-gelsoft commented 3 months ago

already patched another workaround

diff --git a/gfx/layers/wr/WebRenderBridgeParent.cpp b/gfx/layers/wr/WebRenderBridgeParent.cpp
index 0f57e9e7a98b..357dabb3df04 100644
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -451,7 +451,7 @@ static bool ReadRawFont(const OpAddRawFont& aOp, wr::ShmSegmentsReader& aReader,
   gfxOTSContext otsContext;
   if (!otsContext.Process(&output, source.begin().get(), source.length())) {
     gfxCriticalNote << "Failed sanitizing font " << aOp.key().mHandle;
-    return false;
+//    return false;
   }
   wr::Vec<uint8_t> bytes = output.forget();

@@ -588,6 +588,7 @@ bool WebRenderBridgeParent::UpdateResources(
       }
       case OpUpdateResource::TOpAddRawFont: {
         if (!ReadRawFont(cmd.get_OpAddRawFont(), reader, aUpdates)) {
+          gfxCriticalNote << "TOpAddRawFont failed";
           success = false;
         }
         break;
kenz-gelsoft commented 3 months ago

these workaround seems to cause another crash #41. just moved crash point to another.

original code doesn't allow to fail adding raw font. we need better workaround for this.

kenz-gelsoft commented 3 months ago

Crash Annotation GraphicsCriticalError: |[0][GFX1-]: glxtest: libEGL no display (t=3.75583) |[1][GFX1-]: glxtest: EGL test failed (t=3.75733) |[2][GFX1-]: No GPUs detected via PCI (t=3.75847) |[3][GFX1-]: Failed sanitizing font 77 (t=610.165) [GFX1-]: Failed sanitizing font 77 [744] Hit MOZ_CRASH(adding raw font failed: 0 bytes, err=85) at gfx/wr/wr_glyph_rasterizer/src/platform/unix/font.rs:399

this error comes from