Skip to content

Conversation

@gmaxwell
Copy link
Contributor

Eliminate data races for strMiscWarning and fLargeWork*Found.

This moves all access to these datastructures through accessor functions and protects them with a lock.

and

Make QT runawayException call GetWarnings("gui") instead of directly access strMiscWarning.

@gmaxwell
Copy link
Contributor Author

I have not yet tested the QT part of this change.

@jonasschnelli
Copy link
Contributor

General Concept ACK but I would prefer moving the warning function in a new file (seems to be a misuse of utils.h/c).

@maflcko
Copy link
Member

maflcko commented Nov 29, 2016 via email

@gmaxwell
Copy link
Contributor Author

@MarcoFalke Can you walk me through your reason for adding a third warning context there?

@jonasschnelli
Copy link
Contributor

utACK 6ed742dcbeeb16e7e5fcc42b292bc0c43f5e219c

src/warnings.cpp Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No RPC info about pre-release build? (I know you only copied this from prev. location.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strStatusBar does that, RPC is what you get in safemode errors, effectively.

@maflcko
Copy link
Member

maflcko commented Nov 30, 2016

My initial thinking was to put all such ui related code into ui_interface, but I don't think this makes sense in the long run as the original scope of ui_interface was different. So I am fine with putting it in the new file, though I don't see why the new header needs to go into the consensus lib... I think common or server should be enough?

src/main.cpp Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe std::string to preempt silent merge conflicts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@sipa
Copy link
Member

sipa commented Dec 1, 2016

Needs rebase.

1 similar comment
@sipa
Copy link
Member

sipa commented Dec 1, 2016

Needs rebase.

@gmaxwell
Copy link
Contributor Author

gmaxwell commented Dec 2, 2016

I believe I addressed the comments from @MarcoFalke

@maflcko
Copy link
Member

maflcko commented Dec 2, 2016

utACK 0b5a146cbc04949a8eb2a3f07e53c768fb0ca7dd

…strMiscWarning.

This is a first step in avoiding racy accesses to strMiscWarning.

The change required moving GetWarnings and related globals to util.
This moves all access to these datastructures through accessor functions
 and protects them with a lock.
@gmaxwell
Copy link
Contributor Author

gmaxwell commented Dec 3, 2016

Rebased for the main murder mania.

@laanwj
Copy link
Member

laanwj commented Dec 19, 2016

Makes sense. utACK 749be01

@laanwj laanwj merged commit 749be01 into bitcoin:master Dec 19, 2016
laanwj added a commit that referenced this pull request Dec 19, 2016
…QT runawayException use GetWarnings

749be01 Move GetWarnings() into its own file. (Gregory Maxwell)
e3ba0ef Eliminate data races for strMiscWarning and fLargeWork*Found. (Gregory Maxwell)
c63198f Make QT runawayException call GetWarnings instead of directly access strMiscWarning. (Gregory Maxwell)
codablock pushed a commit to codablock/dash that referenced this pull request Jan 18, 2018
…, make QT runawayException use GetWarnings

749be01 Move GetWarnings() into its own file. (Gregory Maxwell)
e3ba0ef Eliminate data races for strMiscWarning and fLargeWork*Found. (Gregory Maxwell)
c63198f Make QT runawayException call GetWarnings instead of directly access strMiscWarning. (Gregory Maxwell)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
…, make QT runawayException use GetWarnings

749be01 Move GetWarnings() into its own file. (Gregory Maxwell)
e3ba0ef Eliminate data races for strMiscWarning and fLargeWork*Found. (Gregory Maxwell)
c63198f Make QT runawayException call GetWarnings instead of directly access strMiscWarning. (Gregory Maxwell)
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 26, 2019
…, make QT runawayException use GetWarnings

749be01 Move GetWarnings() into its own file. (Gregory Maxwell)
e3ba0ef Eliminate data races for strMiscWarning and fLargeWork*Found. (Gregory Maxwell)
c63198f Make QT runawayException call GetWarnings instead of directly access strMiscWarning. (Gregory Maxwell)
zkbot added a commit to zcash/zcash that referenced this pull request Feb 21, 2020
Upstream PRs relating to strMiscWarning

This pulls in upstream PRs bitcoin/bitcoin#7114 and bitcoin/bitcoin#9236 (non-QT parts).

* Fixes bitcoin/bitcoin#6809 - run-of-the-mill exceptions should not get into `strMiscWarning` (which is reported by `getinfo`).
* Eliminate data races for `strMiscWarning` and `fLargeWork*Found`. This moves all access to these data structures through accessor functions and protects them with a lock.
denverbdr pushed a commit to ycashfoundation/ycash that referenced this pull request Mar 6, 2020
Upstream PRs relating to strMiscWarning

This pulls in upstream PRs bitcoin/bitcoin#7114 and bitcoin/bitcoin#9236 (non-QT parts).

* Fixes bitcoin/bitcoin#6809 - run-of-the-mill exceptions should not get into `strMiscWarning` (which is reported by `getinfo`).
* Eliminate data races for `strMiscWarning` and `fLargeWork*Found`. This moves all access to these data structures through accessor functions and protects them with a lock.
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request Dec 17, 2020
…ound

97a85eb [GUI] Connect alert signal (furszy)
ce58263 Move GetWarnings() into its own file. (furszy)
3fee808 util GetWarnings, adding "gui" parameter type. (furszy)
e074feb Eliminate data races for strMiscWarning and fLargeWork*Found. This moves all access to these datastructures through accessor functions and protects them with a lock. (furszy)
5fdd73e Make QT runawayException call GetWarnings instead of directly access strMiscWarning. (furszy)
c684718 Separate CTranslationInterface from CClientUIInterface (furszy)
0b62015 [Cleanup] Remove unused global fields from util.h/cpp (furszy)

Pull request description:

  Back ported two different PRs from upstream to solve possible races over the `strMiscWarning` and `fLargeWork*Found` global fields plus some small cleanup.

  dashpay#6022: to not depend on `guiinterface.h` every time that a back end text needs translations.
  bitcoin#9236: eliminating data races for strMiscWarning and fLargeWork*Found and making QT `runawayException` call `GetWarnings("gui")` instead of directly access `strMiscWarning`.

  Extra information:
  This work is part of a larger rabbit hole that i'm working on to be able to solve #1973 current issues and compile the project in macOS again (solving the newer boost version errors).

ACKs for top commit:
  Fuzzbawls:
    ACK 97a85eb
  random-zebra:
    utACK 97a85eb and merging...

Tree-SHA512: 0a2549f19ecadff1c3e275649599e9cf043404a213f8418e85cc009d7f56c98c704de53f3700a88acd9cdaf1e5ff73bc3b1d9951d76469c7283d2e7cfaaf6628
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants