SerenityOS / serenity

The Serenity Operating System 🐞
https://serenityos.org
BSD 2-Clause "Simplified" License
30.26k stars 3.17k forks source link

error creating TOP player instance #17204

Open JonJFineman opened 1 year ago

JonJFineman commented 1 year ago

Using ladybird on Debian.

Debian Linux laptop 6.1.0-2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.7-1 (2023-01-18) x86_64 GNU/Linux commit 609a89cfb0819126c61d49e0b3bf3be38b833c35 (HEAD -> master, origin/master, origin/HEAD)

It would be nice if the video player crashing was treating as a warning and not a fatal error.

Trying to load www.cnn.com I got the following:

(snip) Unhandled JavaScript exception: [TypeError] undefined is not a function (evaluated from 'e.play')

at https://registry.api.cnn.io/bundles/fave/4.16.3/app:1:1468 e at https://registry.api.cnn.io/bundles/fave/4.16.3/app:1:1686 p at https://registry.api.cnn.io/bundles/fave/4.16.3/app:1:1409 h at https://registry.api.cnn.io/bundles/fave/4.16.3/app:1:2516 d3b9b67cdbc6f69a5519 at https://registry.api.cnn.io/bundles/fave/4.16.3/app:1:22234 at https://registry.api.cnn.io/bundles/fave/latest-4.x/js:1:228788 c at https://registry.api.cnn.io/bundles/fave/latest-4.x/js:1:228811 t at https://registry.api.cnn.io/bundles/fave/4.16.3/app:1:23907 at https://registry.api.cnn.io/bundles/fave/4.16.3/app:1:23971 at https://registry.api.cnn.io/bundles/fave/latest-4.x/js:1:229108 at https://registry.api.cnn.io/bundles/fave/4.16.3/app:1:24031 t at https://registry.api.cnn.io/bundles/fave/latest-4.x/js:1:231614 at https://registry.api.cnn.io/bundles/fave/4.16.3/app:1:23864 at :0:0 at :0:0 at :0:0 ResourceLoader: Starting load of: "https://registry.api.cnn.io/bundles/fave/topplayer-f1aa0f04/topplayer" ResourceLoader: Starting load of: "https://registry.api.cnn.io/bundles/fave/topinstance-e1574acc/topinstance" ResourceLoader: Finished load of: "https://registry.api.cnn.io/bundles/fave/topplayer-f1aa0f04/topplayer", Duration: 581ms ResourceLoader: Finished load of: "https://registry.api.cnn.io/bundles/fave/topinstance-e1574acc/topinstance", Duration: 1997ms (js warn) FAVE -->> Deprecation Warning: The use of the Omniture component in the player configs (configs.omniture.component) has been deprecated in favor of the FAVE Library's internal Adobe Analytics component. The Adobe Analytics component is enabled, so you may safely remove the Omniture component configuration and code from your code base. (js error) FAVE -->> favePlayer: An error occurred while trying to create a TOP player instance. [object TypeError] WebContent: /home/jjf/src/serenity/AK/Optional.h:215: T& AK::Optional::value() & [with T = JS::FunctionObject*]: Assertion `m_has_value' failed. QSocketNotifier: Invalid socket 33 and type 'Read', disabling... WebContent process crashed! Gtk-Message: 11:38:58.853: Failed to load module "colorreload-gtk-module" Gtk-Message: 11:38:58.854: Failed to load module "window-decorations-gtk-module" FontDatabase::load_fonts: No such file or directory
MacDue commented 1 year ago

This crash would have to be reduced further to be of much use. Currently this can't be reproduced (possibly because the site has changed since you used it).

JonJFineman commented 1 year ago

It is still crashing for me today. Same Serenity commit. It appears to be that AK::Optional assertion causing the crash rather than the video player.

I couldn't get a gdb prompt for a backtrace. Any guidance on how to do that, beyond what is in the build page?

ResourceLoader: Finished load of: "https://www.cnn.com/data/ocs/container/coverageContainer_CF35AF62-73C4-1733-9591-89FC773A9320:list-hierarchical-horizontal-simple/views/containers/common/container-manager.html", Duration: 14136ms ResourceLoader: Finished load of: "https://www.cnn.com/data/ocs/container/coverageContainer_70CCAD23-FDEF-8E85-D427-7081AEFAB605:list-small-horizontal/views/containers/common/container-manager.html", Duration: 14520ms ResourceLoader: Starting load of: "https://cdn.cnn.com/cnnnext/dam/assets/221117142556-the-assignment-with-audie-cornish-large-169.jpg" ResourceLoader: Finished load of: "https://www.cnn.com/data/ocs/container/coverageContainer_8C4FF4C7-3E30-1ABB-5B13-C072E64EDA38:list-hierarchical-xs/views/containers/common/container-manager.html", Duration: 14752ms ResourceLoader: Starting load of: "https://cdn.cnn.com/cnnnext/dam/assets/230127163624-disney-world-magic-kingdom-park-file-restricted-large-169.jpg" ResourceLoader: Finished load of: "https://cdn.cnn.com/ads/cnn/singles/cnn_entitlement_hp_01.js", Duration: 14792ms ResourceLoader: Finished load of: "https://cdn.cnn.com/cnnnext/dam/assets/230127163624-disney-world-magic-kingdom-park-file-restricted-large-169.jpg", Duration: 516ms ResourceLoader: Finished load of: "https://cdn.cnn.com/cnnnext/dam/assets/221117142556-the-assignment-with-audie-cornish-large-169.jpg", Duration: 780ms ResourceLoader: Finished load of: "https://data.cnn.com/breaking_news/domestic.json", Duration: 5936ms WebContent: /home/jjf/src/serenity/AK/Optional.h:215: T& AK::Optional::value() & [with T = JS::FunctionObject*]: Assertion `m_has_value' failed. QSocketNotifier: Invalid socket 21 and type 'Read', disabling... WebContent process crashed!

MacDue commented 1 year ago

It's a bit tricky to get a GDB backtrace from ladybird due to it's multi process design. You have to set a breakpoint before it forks to create the WebContent process then do set follow-fork-mode child. Then you'll actually be debugging WebContent/LibWeb (rather than the Qt app or the SQL server).

Anyway, the usual way to tackle things like this is to reduce the crash down into a little HTML snippet that you can easily debug yourself, or just attach to the issue (which can take a little while to do depending on the crash).