In which Wowfunhappy and krackers talk about stuff #51
Replies: 20 comments 129 replies
-
Yes, you should just be able to use the same dyld_interpose technique on the mangled c++ name? Recall that when c++ is compiled down to code the fully qualified symbol (including namespace and type information) is mangled into a single identifier. As a result c++ code that does not have its symbols stripped can sometimes be easier to disassemble than c code because type information remains. And C and C++ are interoperable by definition. So just treat the entire mangled c++ symbol name as you would the C symbol and use that when interposing. With C++ you also have another interesting technique at your disposable which is vtable hijacking |
Beta Was this translation helpful? Give feedback.
-
Huh, I thought of using Next time I have a reason to try it, I'll ask you, and maybe you can tell me what I screwed up. 🙂 |
Beta Was this translation helpful? Give feedback.
-
@Wowfunhappy just realized (after trying for dozens of minutes to try to inject into an app that was complaining about missing This means that if the app crashes before it's recognized by the system as finished "launch" then you'll never be able to simbl inject. In that case dyld inject would be preferable. |
Beta Was this translation helpful? Give feedback.
-
MacportsLegacySupport is the best. The developer of imitone, an app I purchased years ago and haven't used much since, recently broke support for macOS 10.11 and below. He's been trying to add it back in and asked for testers. I offered because I like it when apps maintain support for old OS X, and actually I'd like to experiment with imitone again. His test builds didn't work, but I was quickly able to see the problem: the app was expecting _clock_gettime to be in libSystem.B.dylib. So I copied
Followed by a quick I told the developer all of this and even sent him a copy of the modified app. We'll see if he's okay getting an explanation from a random stranger. 🤷♂️ Of course, he probably shouldn't use this hacky method for the real release. He could presumably link |
Beta Was this translation helpful? Give feedback.
-
@Wowfunhappy Question: have you ever noticed this issue where the stack icon for chrome downloads is blank? I recently cleaned up my dock to make use of the stack, and I'm seeing this issue but I don't know if it's just something with my setup or if the referenced bug still exists. |
Beta Was this translation helpful? Give feedback.
-
@krackers So since you just helped me fix one of my biggest long-time frustrations with my OS X setup... any interest in helping with another one? 🙂 I am unduly upset that dragging an .app bundle out of the I want to stop Finder from creating aliases. I'm convinced it's something hardcoded in Finder, but I've never been able to figure out what is responsible... |
Beta Was this translation helpful? Give feedback.
-
I want to stop Finder from creating aliases..... @Wowfunhappy .....Put in the trash then move it where you want it..... |
Beta Was this translation helpful? Give feedback.
-
@Wowfunhappy Random question: do you happen to have Intel Power Gadget installed? Seems like all versions that work with 10.9 have been pulled, and I can't find any open source equivalent on github at the moment (basically needs a kext that polls the right CSR, but I'd rather have the official one if possible) |
Beta Was this translation helpful? Give feedback.
-
Since we're talking about CoreText, thought I'd dump some other notes here. 10.9 doesn't just have CoreText crashes, apparently it also contains a (rather servere) performance issue that Harfbuzz can trigger with the coretext AAT backend. Now of course as seen in harfbuzz/harfbuzz@ba4b7be as of v2.0 harfbuzz has implemented its own support for Apple AAT and it (and Chrome) no longer relies on coretext for much, but the underlying codepaths still actually exist if you use the harfbuzz coretext shaper backend directly. -- First some discussion of apple AAT fonts, since I didn't know much about typography. As seen in https://fontforge.org/docs/techref/gposgsub.html AAT fonts contain additional sections on glyph kerning, substitutions, and shaping data. I think OpenType does support many of the same things, but for whatever reason apple's fork of TrueType uses these non-standard sections instead. There's some detailed discussion by expert typographers that goes over my head in https://typedrawers.com/discussion/758/aat-in-decline-who-develops-aat-features. Also https://www.opticentre.net/FAQ/Fonts/OpenType-font/
Which apple themselves states in their whitepaper: https://web.archive.org/web/20090617063720/http://developer.apple.com/textfonts/WhitePapers/IUC15CG.pdf
Practically, the effect of AAT fonts can be easily seen with Zapfino on mac (https://thatkeith.com/articles/zapfino-the-typeface-with-built-in-magic/), but even system fonts such as Helvetica rely on the AAT kerning sections (morx) as opposed to OpenType ones (GPOS?) for things like kerning numbers or slight baseline adjustment. (There are probably opentype versions of Zapfino and Helvetica though, so I'm not sure if there's anything practical that AAT can do that OpenType currently doesn't... maybe AAT font variations [dynamic width/height], which seem to only recently have an opentype equivalent) With that background on AAT out of the way, there's a curious bug that persisted for about a year, all the way through until support for mavericks was officially discontinued (since 68 was the last to officially run on mavericks, while the harfbuzz AAT replacement happened at 72 or something): if you load pages with a lot of CJK text that have a "complex" layout, rendering can take on the order of 10 seconds, and fontd will have heavy CPU usage. Bisecting I found a "good" chrome version is 53.0.2767.6 and the issue was introduced somehwere around "54.0.2803.7" What happened in between these versions? Well the chrome bug tracker and harfbuzz source give us the full story, and it is in fact related to the emoji crashes that I originally started this GH thread with. We start with https://issues.chromium.org/issues/40441917 which mentions a commit r355800 (https://chromium.googlesource.com/chromium/src/+/9f6a2b03ccb7091804f173b70b5facff7dffbd61) which I don't quite understand but apparently causes shaping to be invoked a lot more than it used to be. In particular it seems to invoke the shaper once per specified font (e.g. in CSS if you specify 3 different possible fonts it will try to shape with each). CoreText also has its own font fallback logic though, so the two seem to interact poorly, resulting in quadratic behavior. If you list 5 different fonts, but none except the last exist, you can make on the order of 5^2 calls into coretext. Now the rub is that CoreText shaper is only invoked for AAT fonts anyway, and AAT shaping takes extra long. If you disable coretext shaping using the obscure The clever chromium folks tried to fix the issue and avoid the quadratic behavior by telling CoreText not to try any fallback fonts. So far so good, and if you try a build with this fix in things work as expected. But on 10.9 apparently things are not so good: disabling the fallback/cascade logic ends up causing crashes for certain symbols. https://issues.chromium.org/issues/40475517. So they decided to keep this fallback logic for 10.9, which brings back the performance issue for these platforms. And I guess the cherry is that there's another issue where not disabling the cascade reconfiguration logic causes crashes on certain emoji which is the issue I created this discussion about. TL;DR coretext on 10.9(+?) is quite cursed, no wonder they wanted add a native AAT backend in harfbuzz just to avoid using it. Also that you should ideally try avoid too many fallback fonts when making pages, e.g. it's strictly more performant to have a separate class for japanese text (using japanese font) and english text, rather than having one selector with fallback. |
Beta Was this translation helpful? Give feedback.
-
I'm trying not to clogger up the issue thread for #125 (especially since it has become high traffic), but re: Firefox Dynasty
|
Beta Was this translation helpful? Give feedback.
-
On Saturday October 26 2024 18:26:57 Jonathan wrote:
@RJVB @krackers
I'm trying not to clogger up the issue thread for #125 (especially since it has become high traffic), but re: Firefox Dynasty
I hear you about side-tracking #125 so I'll chime in here:
- I've only tried it a bit. It definitely feels snappier in launching and I have seen none of the UI/graphical glitches that are common with CL. The UI also looks as it should, with less wasting of precious vertical space.
- But: it scores a lot lower on the Antutu html5 benchmark despite smoother/faster rendering of some tests. There are some JS errors in CL though so maybe the final score isn't trustworthy
- A bigger but: it won't play most videos on Instagram. Like not at all, just a "sorry" message. I don't know if those depend on Widevine, e.g. but it'd be a dealbreaker if video playback is broken on other sites too.
(- And: not sure if I'm happy they didn't call it FF Dallas instead ;) )
|
Beta Was this translation helpful? Give feedback.
-
On Sunday October 27 2024 05:22:11 Jonathan wrote:
When did you download your copy? i3roly [pushed a build to fix video playback](i3roly/firefox-dynasty#13 (comment)) at 10:04pm EDT last night. Do the videos on the homepage of nytimes.com work for you?
Thanks, I dl'ed my copy in the late afternoon in Europe so it can't have that fix yet.
It definitely loads/renders pages a bit more slowly than Chromium Legacy, although I find that to be true for upstream Firefox vs Chromium as well.
Yeah, each browser has its own strengths. Overall I find FF friendlier on less powerful systems (and thus also older ones).
> There are some JS errors in CL though
That's interesting! In real-world use I've never experienced a website compatibility issue in Chromium Legacy, except for things like WebGPU.
https://antutu.com/html5
I get an error dialog at the end and the placement of the local score relative to known scores isn't displayed. I can't recall seeing JS error popup dialogs elsewhere so this one must be triggered by the benchmarking code - and it begs the question if there are other incompatibilities that aren't flagged but still lead to skewed results (e.g. a test that does nothing and thus terminates way too quickly).
|
Beta Was this translation helpful? Give feedback.
-
When did you download your copy? i3roly [pushed a build to fix video playback](i3roly/firefox-dynasty#13 (comment)) at 10:04pm EDT last night.
You do mean the 132.0 release?
Stupid github doesn't update the timestamps of the releases when a new asset is pushed!
|
Beta Was this translation helpful? Give feedback.
-
On Sunday October 27 2024 13:08:44 Jonathan wrote:
I believe 133a01 and 132.0 were both updated.
Looks like the were, indeed.
In releases, you can see that the assets for these were updated "18 hours ago" as of this writing. But yes I'm using 132.0.
I noticed that, but I had to go monkey curious and click on the assets expander triangle thingy or else I wouldn't have noticed
|
Beta Was this translation helpful? Give feedback.
-
Well, I just filed my 1st issue for FF-D. Its XUL helper tries to use `pthread_chdir_np()` which 10.9 doesn't have, and after seeing the dyld message about this the browser b'balls.
|
Beta Was this translation helpful? Give feedback.
-
On Sunday October 27 2024 05:22:11 Jonathan wrote:
It definitely loads/renders pages a bit more slowly than Chromium Legacy, although I find that to be true for upstream Firefox vs Chromium as well.
I have used both now for a bit for extremely useful things "browsing socials and watching stories" (with uBlock Origin installed as well as FB Purity in TamperMonkey) which are pretty good browser benchmarks in my experience. If FFD is slower than CL in terms of rendering than that's compensated at least in part by a snappier GUI. FFD has noticeably more problems playing hires videos than CL has (also the case on Linux) but cycling between stories on IG feels a bit faster (and is definitely more stable).
|
Beta Was this translation helpful? Give feedback.
-
Forking https://github.com/i3roly/firefox-dynasty/issues/20
It will still have a combined title bar! Basically, look at this. I'm planning to make my own CSS (not a standard theme, which have more limited capabilities) except targeting the look of Mavericks-era Safari instead of Big Sur-era Safari. It should make the UI more compact overall, because Aqua apps (Finder, Safari, etc) use smaller tabs than Firefox does. (I'm not necessarily trying to copy Safari exactly, but Safari is a strong model for "what would a web browser that followed Apple's design guidelines look like?"). |
Beta Was this translation helpful? Give feedback.
-
On Friday November 08 2024 15:23:20 Jonathan wrote:
...how annoying is it to build Firefox? It sucks,
Have you tried? I'm not sure I'm very keen on figuring out how many days it's going to take on my system!
but I think it might be best to show that the patch works, since i3roly seems very uninterested. (And if he stays uninterested we could theoretically maintain a branch.)
I suppose you could attach the updated patch if you don't get banned yourself for showing support (appreciated btw, and yes, I felt I had to be polite ... maybe that's even what caused the knee-jerk reaction).
I didn't even know github allows banning so I did type an answer with the new patch, pointing out that the extension triggering the issue is a quite popular and useful one.
Or, could we use code injection since this is a polyfill?
Yup, I already followed up on your remark about MacPorts legacy-support library: https://trac.macports.org/ticket/71265 ;)
But ... it looks like the entire repository has disappeared?! Would he really do that everyone who was enjoying the browser?!
|
Beta Was this translation helpful? Give feedback.
-
On Friday November 08 2024 15:23:20 Jonathan wrote:
Or, could we use code injection since this is a polyfill?
Just FWIW, the pthread_wrapper functions work as they should on 10.9 and link without issues. Not that I expected otherwise...
|
Beta Was this translation helpful? Give feedback.
-
On Friday November 08 2024 11:56:35 krackers wrote:
> flat tab in the 3D title bar?
That's effectively how chrome looked pre-MD design?
I honestly can't remember, plus I think I set it to use the system titlebar.
|
Beta Was this translation helpful? Give feedback.
-
Continued from: #44 (comment)
Once I got a modern macOS VM set up bluebox's scripts pretty much just worked. Builds take a long time though, I basically can only do them overnight. Which is why I haven't done more with the code base. (Granted, I'm doing this in a Big Sur VM running on top of Mavericks running on a 4790K, it's no slouch but it's far from the fastest hardware available in 2022.)
I have written SIMBL plugins (GreenFullscreen), but it depends on what I'm doing and it's kind of an "aesthetic" decision. I don't want the Chromium Downloader Preference Pane to require users to install SIMBL, for example.
For non-Chromium stuff...
So yeah, there's probably more I'm forgetting, but I often have a reason to not use SIMBL.
I assume they figure that everyone on 10.11+ is "protected" by SIP anyway.
Actually, while I have you—I'm able to very easily replace Objective-C methods via ZKSwizzle, and I'm able to replace C functions via DYLD_INTERPOSE, but do you know if there's a similarly-easy way to replace C++ methods? (I have a feeling there's not.)
Objective-C swizzling is really fun, it makes it so damn easy to tell apps to just do whatever I want. 😈
Edit: It occurred to me that the conversation title is a bit exclusionary. Please feel free to join in regardless of your internet handle. 🙂
Beta Was this translation helpful? Give feedback.
All reactions