Skip to content
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

mapArgs is modified by setgenerate RPC without locking #2132

Open
daira opened this issue Feb 26, 2017 · 5 comments
Open

mapArgs is modified by setgenerate RPC without locking #2132

daira opened this issue Feb 26, 2017 · 5 comments
Assignees
Labels
A-rpc-interface Area: RPC interface C-bug Category: This is a bug C-upstream-port Category: Changes that are ported from the Bitcoin Core codebase. S-fix-next Status: Consider fixing this soon.

Comments

@daira
Copy link
Contributor

daira commented Feb 26, 2017

https://github.com/zcash/zcash/blob/master/src/rpcmining.cpp#L315-L316

    mapArgs["-gen"] = (fGenerate ? "1" : "0");
    mapArgs ["-genproclimit"] = itostr(nGenProcLimit);

@laanwj wrote here:

We should probably change this at some point too to not update the mapArgs. Throughout the program we assume that mapArgs is read-only after initialization. This kind of r/w access would need proper locking around everything.

The problem was present in Bitcoin before we forked.

@daira daira added C-bug Category: This is a bug needs prioritization C-upstream-port Category: Changes that are ported from the Bitcoin Core codebase. A-rpc-interface Area: RPC interface labels Feb 26, 2017
@daira daira changed the title mapArgs is modified without locking mapArgs is modified by setgenerate RPC without locking Feb 27, 2017
@laanwj
Copy link
Contributor

laanwj commented Feb 28, 2017

See bitcoin/bitcoin#9243

@nathan-at-least nathan-at-least added this to the 1.0.8 milestone Mar 13, 2017
@daira daira modified the milestones: 1.0.9, 1.0.8 Mar 26, 2017
@nathan-at-least nathan-at-least modified the milestone: 1.0.9 May 10, 2017
@nathan-at-least
Copy link
Contributor

I left this in on the assumption the rebase from upstream is easy enough. Let's time box it.

@str4d
Copy link
Contributor

str4d commented May 17, 2017

@str4d str4d self-assigned this May 18, 2017
@str4d
Copy link
Contributor

str4d commented May 19, 2017

Another parent PR is bitcoin/bitcoin#6870 which itself should be merged after -maxmempool is added. As IIRC we have already discussed including that, I will do so in its own PR, so I will make a PR now with the earlier misc ones.

@nathan-at-least
Copy link
Contributor

Bumped out of 1.0.9 for a few reasons: First I want to require more scrutiny of upstream PRs, and second because we're out of time for this issue.

@nathan-at-least nathan-at-least removed this from the 1.0.9 milestone May 22, 2017
@daira daira added this to the 1.0.10 milestone May 31, 2017
@jackgavigan jackgavigan removed this from the 1.0.10 Release milestone Jun 12, 2017
zkbot added a commit that referenced this issue Mar 21, 2018
Misc upstream PRs

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6077
  - Second commit only (first was already applied to 0.11.X and then reverted)
- bitcoin/bitcoin#6284
- bitcoin/bitcoin#6489
- bitcoin/bitcoin#6462
- bitcoin/bitcoin#6647
- bitcoin/bitcoin#6235
- bitcoin/bitcoin#6905
- bitcoin/bitcoin#6780
  - Excluding second commit (QT) and third commit (requires bitcoin/bitcoin#6993)
- bitcoin/bitcoin#6961
  - Excluding QT parts, and a small `src/policy/policy.cpp` change which depends on a bunch of other PRs, which we'll have to remember to come back to.
- bitcoin/bitcoin#7044
- bitcoin/bitcoin#8856
- bitcoin/bitcoin#9002

Part of #2074 and #2132.
zkbot added a commit that referenced this issue Dec 4, 2019
Misc upstream PRs

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6077
  - Second commit only (first was already applied to 0.11.X and then reverted)
- bitcoin/bitcoin#6284
- bitcoin/bitcoin#6489
- bitcoin/bitcoin#6235
- bitcoin/bitcoin#6905
- bitcoin/bitcoin#6780
  - Excluding second commit (QT) and third commit (requires bitcoin/bitcoin#6993)
- bitcoin/bitcoin#6961
  - Excluding QT parts, and a small `src/policy/policy.cpp` change which depends on a bunch of other PRs, which we'll have to remember to come back to.
- bitcoin/bitcoin#7044
- bitcoin/bitcoin#8856
- bitcoin/bitcoin#9002

Part of #2074 and #2132.
@daira daira added the S-fix-next Status: Consider fixing this soon. label Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc-interface Area: RPC interface C-bug Category: This is a bug C-upstream-port Category: Changes that are ported from the Bitcoin Core codebase. S-fix-next Status: Consider fixing this soon.
Projects
None yet
Development

No branches or pull requests

5 participants