firefox-devtools / profiler

Firefox Profiler — Web app for Firefox performance analysis
https://profiler.firefox.com
Mozilla Public License 2.0
1.19k stars 390 forks source link

Crashing in FF v103 caputing profile data #4164

Open LomaxRK opened 2 years ago

LomaxRK commented 2 years ago

Hello,

I've been having some trouble with Twitch recently and have been attempting to capture some profiler data to help out with debugging and each time I try to capture anything the profile either crashes Firefox outright or it loads the profile page then fails to load the actual profile details. I did load another profile back in April and that went OK so not sure what's changed.

Details: Firefox v103.0 64bit Win 10 21H1 19043.1826 Addons - uBlock Origin, PrivacyBadger Profiler set to default Media settings

The error coming out when the page does load is: Error: DataCloneError: JSWindowActorParent.sendAsyncMessage: JSWindowActorParent serialization error: data too large, in actor 'WebChannel'

Thanks

┆Issue is synchronized with this Jira Task

julienw commented 2 years ago

Hey @LomaxRK, I believe this is kind of expected because the media setting generates a lot of data and indeed we're not good at handling all this data yet. As workarounds you can try capturing during a shorter amount of time, you can also try increasing the interval value in about:profiling. Please tell us how it goes with these workarounds!

julienw commented 2 years ago

@squelart also reminded me about this bug https://bugzilla.mozilla.org/show_bug.cgi?id=1777890 that was just fixed in v104, that could trigger this issue. If you can try your workload with firefox beta or nightly and report to us whether this is working, that would be wonderful!

squelart commented 2 years ago

Or in the meantime until you can get Firefox 104, you could try a much lower "Buffer size" in the Profiler settings. Please let us know if that helps or not.

LomaxRK commented 2 years ago

Hey Julie, Squelart,

Many thanks for the really quick response!

I've tried the profiler via the mosregression GUI using what I'm assuming is the latest Nightly and dropping the buffer size to around 128mb definitely helped with the crashing but it still came up with the "data too large" after about a minutes capture. Something around 20-30s seemed to be fine though. I'll need to try sitting around capturing/canceling a bunch of times as the issue I'm currently having is on a reasonably regular basis but also somewhat random time within a couple of minutes time frame.

Thanks again for the help and creating such a great tool.

mstange commented 2 years ago

the issue I'm currently having is on a reasonably regular basis but also somewhat random time within a couple of minutes time frame

For this issue, having the ability to set a profiling "duration" (i.e. sliding window size) would be useful. This is implemented in the platform code but not exposed in the UI.

laundmo commented 2 years ago

I'm running into this too, trying to figure out why some requests are stuck "waiting" for minutes at a time (my gut says its a addon causing it, no issue without addons)

Due to the page load taking minutes, i cant help but run into this almost no matter what settings i choose. I'd really like a solution that works outside of making the profile smaller, ideally one where i could capture a profile over many minutes without issue.

julienw commented 2 years ago

the issue I'm currently having is on a reasonably regular basis but also somewhat random time within a couple of minutes time frame

For this issue, having the ability to set a profiling "duration" (i.e. sliding window size) would be useful. This is implemented in the platform code but not exposed in the UI.

My understanding is that we don't expose it in the UI because this is how it works by default with the configured memory usage, and I even think we don't have the duration-based window now. @squelart should know?

julienw commented 2 years ago

I'm running into this too, trying to figure out why some requests are stuck "waiting" for minutes at a time (my gut says its a addon causing it, no issue without addons)

Due to the page load taking minutes, i cant help but run into this almost no matter what settings i choose. I'd really like a solution that works outside of making the profile smaller, ideally one where i could capture a profile over many minutes without issue.

This looks like it's another issue than the one here. Would you please file another issue, for example in bugzilla? If this is an addon issue it would be a good idea to try to find which addon triggers the problem by disabling them one by one.

laundmo commented 2 years ago

This looks like it's another issue than the one here. Would you please file another issue, for example in bugzilla? If this is an addon issue it would be a good idea to try to find which addon triggers the problem by disabling them one by one.

i can, but i don't see how it's different - i get the same error message with the same symptoms, and to close this issue would require a fix which allows the loading of profiles regardless of size...

julienw commented 2 years ago

This looks like it's another issue than the one here. Would you please file another issue, for example in bugzilla? If this is an addon issue it would be a good idea to try to find which addon triggers the problem by disabling them one by one.

i can, but i don't see how it's different - i get the same error message with the same symptoms, and to close this issue would require a fix which allows the loading of profiles regardless of size...

Because you don't have the problem without addons, this hints to another problem.

laundmo commented 2 years ago

Because you don't have the problem without addons, this hints to another problem.

I have the problem without any extensions active, in a private window, too. The original issue i was trying to debug is caused by extensions, true, but i get the same error on large/long profiles without the extensions.

Besides that: IMO a profiler like this should be able to show traces from buggy, spammy, extensions because being able to see which extension is being buggy in the profiler is very useful. maybe a that should be a different issue, true, but i am experiencing this issue too

julienw commented 2 years ago

If you're using Firefox v103, you should know that we had a nasty bug that prevented the "sliding window size" feature from working properly, and as a result we got too big profile data. This was fixed in v104. Note that this bug was present for ~march or april, so this may also be the root cause for this issue, and the addon thing could have been a red herring.

It would be good it you both can try again with v104 (this is the current stable version), and report if you still have a problem. Thanks!