-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Qt: remove macOS launch-at-startup when compiled with > macOS 10.11, fix memory missmanagement #15208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
utACK 8441c90af88fb0f08762cf56e508803ed4b47d4c modulo typo |
doc/release-notes.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in --> is ?
|
utACK |
|
Compiling 8441c90 on macOS However, when passing I'm still seeing the same segfault behaviour as #15142: |
|
@fanquake: your right. There is something wrong with our implementation... I'll fix that soon. |
33ebd96 to
541d287
Compare
|
Current macOS launch at login code does release an item which belongs to an array that gets release later (double release) which causes a crash on certain macOS versions. I added a commit that fixes the memory mismanagement. |
hebasto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested 541d287b805ecaad1d9810b5a776d2e0d8b87233 on macOS 10.13.6.
doc/release-notes.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/qt/guiutil.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function declaration seems unnecessary. Could it be removed?
src/qt/guiutil.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
res is a bool already. Could the comment be removed?
541d287 to
35f5cb7
Compare
|
Fixed @hebasto findings |
|
tACK 35f5cb791de6bd47b62e031a74d885f00efd2585 (macOS 10.13.6 + Qt 5.11.2)
Note: official v0.17.1 is affected. |
35f5cb7 to
da60118
Compare
|
utACK da60118 |
… macOS 10.11, fix memory missmanagement da60118 Fix macOS launch-at-startup memory issue (Jonas Schnelli) 516437a Qt: remove macOS launch-at-startup option when compiled with > macOS 10.11 (Jonas Schnelli) Pull request description: The launch-at-startup API Bitcoin Core uses on macOS where removed in macOS 10.11 leading to a segmentation-fault due to the weak-linking when not actively compiled against SDK 10.11 (`-mmacosx-version-min=10.11`) This PR removes the launch-at-startup feature on macOS when compiled with macOS min version > 10.11 (the default is always the macOS version you compile on). **The depends built binaries (Gitian) are not affected since we are building with min macOS 10.10.** Users self compiling on macOS > 10.11 can re-enable the feature by compiling with min version <= 10.11 (`CXXFLAGS="-mmacosx-version-min=10.11" CFLAGS="-mmacosx-version-min=10.11" ./configure`) **Isn't there a new API from Apple?** Yes, [there is](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/CreatingLoginItems.html). It will require to create a helper application which needs to be embedded in the .app folder (needs code signing as well). Developers willing to go down that rabbit hole are welcome. Fixes #15142 Tree-SHA512: fa9cc4e39d5a2d2559919b7e22b7766f5e0269a361719294d4a4a2df2fd9d955e5b23b5907e68023fdeee297f652f844f3c447904bf18f9c1145348ad101c432
The macOS startup item code was disabled for builds targeting macOS > 10.11 in bitcoin#15208. Now that we require macOS 10.12 as a minimum, bitcoin#17550, we can remove the startup item code entirely, as the API we were using was removed in macOS 10.12.
27d82b6 gui: remove macOS start on login code (fanquake) Pull request description: The macOS startup item code was disabled for builds targeting macOS > `10.11` in #15208. Now that we require macOS `10.12` as a minimum (#17550), we can remove the startup item code entirely. The API we were using, `LSSharedFileListItemCopyResolvedURL`, `LSSharedFileListCopySnapshot` etc, was removed in macOS `10.12` SDK. ACKs for top commit: jonasschnelli: utACK 27d82b6 jonasschnelli: Tested ACK 27d82b6 - successfully compiled on 10.15.1 Tree-SHA512: 7420757b91c7820e6a63280887155394547134a9cebcf3721af0284da23292627f94cd431241e033075b3fd86d79ace3ebf1b25d17763acbf71e07a742395409
27d82b6 gui: remove macOS start on login code (fanquake) Pull request description: The macOS startup item code was disabled for builds targeting macOS > `10.11` in bitcoin#15208. Now that we require macOS `10.12` as a minimum (bitcoin#17550), we can remove the startup item code entirely. The API we were using, `LSSharedFileListItemCopyResolvedURL`, `LSSharedFileListCopySnapshot` etc, was removed in macOS `10.12` SDK. ACKs for top commit: jonasschnelli: utACK 27d82b6 jonasschnelli: Tested ACK 27d82b6 - successfully compiled on 10.15.1 Tree-SHA512: 7420757b91c7820e6a63280887155394547134a9cebcf3721af0284da23292627f94cd431241e033075b3fd86d79ace3ebf1b25d17763acbf71e07a742395409
The macOS startup item code was disabled for builds targeting macOS > 10.11 in bitcoin#15208. Now that we require macOS 10.12 as a minimum, bitcoin#17550, we can remove the startup item code entirely, as the API we were using was removed in macOS 10.12.
Summary: > The macOS startup item code was disabled for builds targeting macOS > > 10.11 in #15208. Now that we require macOS 10.12 as a minimum, #17550, > we can remove the startup item code entirely, as the API we were using > was removed in macOS 10.12. We have `OSX_MIN_VERSION=10.12` set in `depends/hosts/darwin.mk` This is a backport of [[bitcoin/bitcoin#15208 | PR15208]] and [[bitcoin/bitcoin#17567 | PR17567]] All code modified in `src/qt/guituil.cpp` in [[bitcoin/bitcoin#15208 | PR15208]] is removed in [[bitcoin/bitcoin#17567 | PR17567]], including everything related to *fix memory missmanagement*. Test Plan: I do not have a Mac to test this, so I rely on CI cross compilation tests. `ninja all check-all` Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Subscribers: Fabien Differential Revision: https://reviews.bitcoinabc.org/D8280
27d82b6 gui: remove macOS start on login code (fanquake) Pull request description: The macOS startup item code was disabled for builds targeting macOS > `10.11` in bitcoin#15208. Now that we require macOS `10.12` as a minimum (bitcoin#17550), we can remove the startup item code entirely. The API we were using, `LSSharedFileListItemCopyResolvedURL`, `LSSharedFileListCopySnapshot` etc, was removed in macOS `10.12` SDK. ACKs for top commit: jonasschnelli: utACK 27d82b6 jonasschnelli: Tested ACK 27d82b6 - successfully compiled on 10.15.1 Tree-SHA512: 7420757b91c7820e6a63280887155394547134a9cebcf3721af0284da23292627f94cd431241e033075b3fd86d79ace3ebf1b25d17763acbf71e07a742395409
The macOS startup item code was disabled for builds targeting macOS > 10.11 in #15208. Now that we require macOS 10.12 as a minimum, #17550, we can remove the startup item code entirely, as the API we were using was removed in macOS 10.12.
2896a48 GUI: remove macOS start on login (furszy) 300d752 scripted-diff: prefer MAC_OSX over __APPLE__ (furszy) 7467c9f gui: remove macOS ProgressBar workaround (fanquake) c7575ac gui: remove SubstituteFonts (fanquake) 15ed388 Use window() instead of obsolete topLevelWidget() (Hennadii Stepanov) d6e1383 Fix macOS launch-at-startup memory issue (Jonas Schnelli) 233b156 Qt: remove macOS launch-at-startup option when compiled with > macOS 10.11 (Jonas Schnelli) d787b25 Cleanup: Remove unused TableViewLastColumnResizingFixer and DHMSTableWidgetItem from guiutil.h/cpp (furszy) Pull request description: Straightforward update for the `guiutil` files. First commit removes unused `TableViewLastColumnResizingFixer` and `DHMSTableWidgetItem` from `guiutil.h/cpp`. Second and third commit comes from bitcoin#15208. Fourth commit comes from bitcoin#14801. ACKs for top commit: random-zebra: re-utACK 2896a48 Fuzzbawls: utACK 2896a48 Tree-SHA512: b66920006007017a7fc9de06405627ab968d0d5fb2aab97d7131af6b044b34bbf370ebc47b87e3d088a83a1596d056b02e41d929e5180902ed6da4529e179f6d


The launch-at-startup API Bitcoin Core uses on macOS where removed in macOS 10.11 leading to a segmentation-fault due to the weak-linking when not actively compiled against SDK 10.11 (
-mmacosx-version-min=10.11)This PR removes the launch-at-startup feature on macOS when compiled with macOS min version > 10.11 (the default is always the macOS version you compile on).
The depends built binaries (Gitian) are not affected since we are building with min macOS 10.10.
Users self compiling on macOS > 10.11 can re-enable the feature by compiling with min version <= 10.11 (
CXXFLAGS="-mmacosx-version-min=10.11" CFLAGS="-mmacosx-version-min=10.11" ./configure)Isn't there a new API from Apple?
Yes, there is.
It will require to create a helper application which needs to be embedded in the .app folder (needs code signing as well). Developers willing to go down that rabbit hole are welcome.
Fixes #15142