BrowserWorks / Waterfox-Classic

The Waterfox Classic repository, for legacy systems and customisation.
https://classic.waterfox.net
Mozilla Public License 2.0
175 stars 34 forks source link

Several issues with Waterfox Classic. #94

Closed Peacock365 closed 1 year ago

Peacock365 commented 2 years ago

@MrAlex94 @adamp01 @aeiouaeiouaeiouaeiouaeiouaeiou @dbsoft

I have found three issues while using Waterfox Classic on macOS recently, one of them is a general Sync issue though:

1) When hitting the green maximize button at the top left of the window on macOS, Waterfox Classic immediately crashes.

2) The user agent is not correct at all, for me it says "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.0; rv:68.0) Gecko/20100101 Firefox/68.0 Waterfox/56.6.2022.02", but actually I am using macOS Big Sur. The operating system version is wrong.

3) One can no longer set up Sync. about:preferences#sync --> Sign in results in a CSP error. The URL where the error occurs: about:accounts?action=signup&entrypoint=preferences

I have reported the first two issues to @dbsoft before but no fix occured. I realise that Waterfox Classic only gets security fixes and fixes for breakage-inducing bugs, the latter is the case here.

Waterfox Classic 2022.02, macOS 11.6.5 Big Sur

Killogy commented 2 years ago

@Peacock365 To set up Sync, you can sign in by visiting https://accounts.firefox.com/?context=fx_desktop_v3&entrypoint=preferences&action=email&service=sync

adamp01 commented 2 years ago

Thanks @Killogy - I'm updating the about:accounts page to redirect here instead.

Peacock365 commented 2 years ago

Many thanks to @Killogy for the hint and to @adamp01 for fixing the issue.

Regarding the crash on Big Sur, here is a related issue, here is the discussion I was having with @dbsoft:

https://github.com/WaterfoxCo/Waterfox/pull/1820

Hopefully this will help @adamp01 in resolving issues (1) and (2) which I consider user experience-breaking.

Peacock365 commented 2 years ago

@adamp01, can you reproduce the crash on Monterey?

Peacock365 commented 2 years ago

@adamp01

Please respond. I know it was the Easter holidays, and I left you to your own devices because of that, but I feel this issue is fairly high priority. It breaks my ability to use Waterfox Classic on macOS, perhaps you can resolve this once you've read the discussion I was having with @dbsoft.

adamp01 commented 2 years ago

@Peacock365 - I did try to resolve this many months ago when you first raised the issue (or it first came to my attention, at least), attempting to resolve with a similar fix that dbsoft did. As far as I got was converting the crashing to beachballing. What makes this challenging for us is that nobody on the team has quite the right expertise to resolve this in a vaguely timely manner, and so prioritisation becomes very difficult as we cannot guarantee that we will be able to resolve it. Once my workload quietens down for a few days I'll take another look to see if I can make any progress, as well as making a PR for other contributors to look at.

Peacock365 commented 2 years ago

@adamp01

Hm, I see. Did you identify the code segment that causes the crash? If yes, then perhaps you can compare this segment to the same code segment of White Star: https://github.com/dbsoft/White-Star

White Star is the Pale Moon build of @dbsoft for macOS. This Pale Moon build does not crash even though it is forked from an even older codebase.

adamp01 commented 2 years ago

I did not identify anything in particular causing the crash, although I was using White Star as a reference.

I'll tackle it again as soon as I can and detail what I've done this time, then maybe dbsoft can fill in the blanks if I can't get it working.

dbsoft commented 2 years ago

Sorry I have been busy with White Star... I've finished the transition to Apple Silicon there, so should have some time to look at this again.

dbsoft commented 1 year ago

The fullscreen crash appears to be related to drawing in the titlebar... which we don't do in White Star anymore.... which may explain why Waterfox Classic crashes and White Star doesn't... it is really complicated to figure out since the issue occurs so far out of Waterfox code.... but I'm looking into it.

dbsoft commented 1 year ago

Echoing what I posted in the pull request, can people test this fix and see if it works without causing other issues?

If you can't compile your own and want to test, you can download the build I am using here: https://dbsoft.org/whitestar/waterfox-classic-2022.08.en-US.mac.dmg

This build should fix transparent windows on Ventura and report the correct MacOS version.

Peacock365 commented 1 year ago

@dbsoft

Your build has fixed the wrong user agent for me (macOS 12.6.1 Monterey here). Can't test the Ventura issue because my Mac is not compatible with it.

Your Waterfox Classic build still crashes upon hitting the green maximize button, it crashes immediately when e10s is enabled and hangs, then crashes when e10s is disabled. I did not make a clean install by the way, I installed your build for my existing profile as I would do it if I upgraded (to make it realistic).

dbsoft commented 1 year ago

@Peacock365 I have not found the full screen problem yet, this build is only to fix the version reporting and transparent windows on Ventura. I'll let you know when I have a fix for the fullscreen crash.

Also I haven't messed with e10s, I am not a fan of it, that is one of the reasons I like White Star/Pale Moon and Waterfox Classic... I was asked to also look at Seamonkey crashing at startup on Ventura, so... it might be a bit before I get to looking at e10s. Seamonkey and the fullscreen crashes currently take precedence. Will look into that other stuff later when I have time.

dbsoft commented 1 year ago

I figured out what is causing the fullscreen crash.

The "FrameView__wantsFloatingTitlebar" code in widget/cocoa/nsCocoaWindow.mm.

I don't have that in the White Star/Pale Moon UXP code... the comments say it is to work around glitchy behavior but I don't know what that behavior is. I can attempt to make the code conditional based on MacOS versions or the code can just be removed if the glitchy behavior is less of a problem. Do any of you have any idea which versions of MacOS are affected by the glitchy behavior or the fullscreen crashes?

To partially answer my own question... it seems to fix glitches on 10.13, but cause crashes on later versions: https://hg.mozilla.org/mozilla-central/rev/2ea9c4738449

This is the changeset where this eventually removed from the Mozilla codebase completely: https://hg.mozilla.org/mozilla-central/rev/fbab3b7be09261b604148655537ba0ff90d2a9fb

Going to assume it is safe to have this code active through 10.15 and disable it 11.0 and above... see if that fixes it.

I've made a build with a potential fix... testing it on all my Macs... if other people can test too and give me the results that would be great: https://dbsoft.org/whitestar/waterfox-classic-2022.08.en-US.mac.dmg

Peacock365 commented 1 year ago

@dbsoft

The crash happened for me on both macOS Big Sur and macOS Monterey, I have no memory of earlier versions sorry. I can confirm it happens for these two. I think you can run older macOS versions in VirtualBox, the installers for these macOS versions can be downloaded for free. In case you need to test.

EDIT: Your build fixes the issue for me! macOS 12.6.1 here!

dbsoft commented 1 year ago

@Peacock365 Ah great to hear! I have tested on every MacOS I had easily accessibly... 13 Ventura, 12 Monterey, 10.15 Catalina, 10.11 El Capitan, 10.7 Lion... I have 10.13 High Sierra on the same computer as 10.15 Catalina, but I can't reboot it right now while some important software is running on it.

I disabled the code on 11 and above and it seems to have worked on those, since neither 12 or 13 is crashing... The code should still be running on earlier versions and I did not see any glitches in the basic browsing and window resizing testing I did on all the systems I was able to run it on. However I am also not entirely sure what I am looking for... but since basic testing worked I'll create a pull request for this change and the review can be done there.

dbsoft commented 1 year ago

@adamp01 I see that you are in the process of releasing a new version of Waterfox Classic, but the Mac version is not available yet. I would request that the review of this change be expedited in the hope it might make it into the new release.

adamp01 commented 1 year ago

@dbsoft - Greatly appreciate your work on these issues, will get this pulled in before releasing.

dbsoft commented 1 year ago

@adamp01 You are welcome! Thank you for the quick response!

dbsoft commented 1 year ago

Just a note, about that last patch... I sent it to the Seamonkey team too since they have the same issue, but they use a later SDK. If Waterfox Classic moves to a later SDK you might require a change to the code to something like:

  if(nsCocoaFeatures::OnBigSurOrLater()) {
    if([super respondsToSelector:@selector(FrameView__wantsFloatingTitlebar)]) {
      return [super FrameView__wantsFloatingTitlebar];
    }
    return YES;
  } 

Or maybe might need to use the IMP to call it to avoid the warning... apparently it compiles with the 11 SDK just warns it might not respond to it... (but it does). That is the trouble with using these undocumented methods.

Or maybe just return YES instead of calling the superclass method.

dbsoft commented 1 year ago

@adamp01 I see the new build it up and it is functional on Ventura with no fullscreen crashes! Awesome! Thank you!

@Peacock365 Think this issue can be closed now?

Peacock365 commented 1 year ago

@dbsoft

OK, I will close this issue now since all original points are now resolved. Something one could look at if there is time though:

dbsoft commented 1 year ago

@Peacock365 I mean he just does a monthly release and each month he checks to see if any of the Mozilla fixes that Mozilla applied to their codebase also applies to UXP... there are usually at least a few each month that do... going back over years through all Mozilla's releases would be a lot of work... I am not really up for that. Sorry.

Peacock365 commented 1 year ago

@dbsoft

going back over years through all Mozilla's releases would be a lot of work... I am not really up for that. Sorry.

I did not mean that in particular. Moonchild has already evaluated which fixes apply to the codebase and which don't. His release notes read something like this:

Fixed a potential heap Use-After-Free risk in Expat. (CVE-2022-40674)

Security fixes: CVE-2022-40956 and CVE-2022-40958.

I meant porting these fixes that are already patched in UXP, is that possible?

dbsoft commented 1 year ago

I mean doing current ones maybe, but he doesn't list them as the security fixes in the commits... so going back in time and pulling in old ones would be challenging.

Edit: Just to clarify, I don't really have time to do that... I am happy to fill in with the Mac fixes since some of it is replicated work that I've already done in my own White Star project... if people want me to do extra stuff... I might do it for donations. I have my hands full with my own projects, White Star, Dynamic Windows and the projects that actually make me money.